This commit is contained in:
2024-02-19 09:48:42 +08:00
parent 8e6e19a0e6
commit 454b7273cf
3 changed files with 35 additions and 15 deletions

View File

@@ -283,7 +283,8 @@ uni-button:after {
background: #fff; background: #fff;
} }
.slide_new table tbody tr.checked td { .slide_new table tbody tr.checked td {
background-color: #fef6e4; background-color: #f2f2f2;
color: #000
} }
/** 提交栏 **/ /** 提交栏 **/

View File

@@ -53,15 +53,17 @@
<th>物料编码</th> <th>物料编码</th>
<th>物料名称</th> <th>物料名称</th>
<th>点位</th> <th>点位</th>
<th>物料数量</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.group_id === pkId}"> <tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.checked}">
<td>{{e.vehicle_code}}</td> <td>{{e.vehicle_code}}</td>
<td>{{e.vehicle_type}}</td> <td>{{e.vehicle_type}}</td>
<td>{{e.material_code}}</td> <td>{{e.material_code}}</td>
<td>{{e.material_name}}</td> <td>{{e.material_name}}</td>
<td>{{e.point_code}}</td> <td>{{e.point_code}}</td>
<td>{{e.material_qty}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -77,7 +79,7 @@
</view> </view>
<button class="zd-col-4 submit-button_new" @tap="clearUp">清空</button> <button class="zd-col-4 submit-button_new" @tap="clearUp">清空</button>
<button class="zd-col-6 submit-button_new" :class="{'btn-disabled': !index1 || !val1 || !val3 || !index2 || !$store.getters.publicObj}" :disabled="disabled1" @tap="_groupManual">开始组盘</button> <button class="zd-col-6 submit-button_new" :class="{'btn-disabled': !index1 || !val1 || !val3 || !index2 || !$store.getters.publicObj}" :disabled="disabled1" @tap="_groupManual">开始组盘</button>
<button class="zd-col-6 submit-button_new" :class="{'btn-disabled': !pkId}" :disabled="disabled2" @tap="_groupLink">开始配盘</button> <button class="zd-col-6 submit-button_new" :class="{'btn-disabled': checkArr.length === 0}" :disabled="disabled2" @tap="_groupLink">开始配盘</button>
</view> </view>
</view> </view>
</template> </template>
@@ -106,8 +108,7 @@
isV: false, isV: false,
disabled1: false, disabled1: false,
disabled2: false, disabled2: false,
pkId: '', checkArr: []
pkObj: {}
}; };
}, },
created () { created () {
@@ -150,6 +151,9 @@
/** grid */ /** grid */
async _queryVehicleGroup () { async _queryVehicleGroup () {
let res = await queryVehicleGroup() let res = await queryVehicleGroup()
res.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...res] this.dataList = [...res]
}, },
getMater () { getMater () {
@@ -158,8 +162,8 @@
}) })
}, },
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.group_id ? '' : e.group_id e.checked = !e.checked
this.pkObj = this.pkId === e.group_id ? e : {} this.checkArr = this.dataList.filter(i => { return i.checked === true })
}, },
isVirtual () { isVirtual () {
this.isV = !this.isV this.isV = !this.isV
@@ -174,7 +178,7 @@
try { try {
let res = await groupManual(this.index1, this.val1, this.index2, this.val4, this.val5, this.val3, this.isV) let res = await groupManual(this.index1, this.val1, this.index2, this.val4, this.val5, this.val3, this.isV)
this.disabled1 = false this.disabled1 = false
this.pkId = '' this.checkArr = []
this.clearUp() this.clearUp()
this._queryVehicleGroup() this._queryVehicleGroup()
uni.showToast({ uni.showToast({
@@ -188,14 +192,20 @@
/** 开始配盘 */ /** 开始配盘 */
async _groupLink () { async _groupLink () {
this.disabled2 = true this.disabled2 = true
if (!this.pkId) { if (this.checkArr.length === 0) {
this.disabled2 = false this.disabled2 = false
return return
} }
try { try {
let res = await groupLink(this.pkId, this.val1) let arr = []
this.checkArr.map(el => {
if (el.checked) {
arr.push(el.group_id)
}
})
let res = await groupLink(arr.toString(), this.val1)
this.disabled2 = false this.disabled2 = false
this.pkId = '' this.checkArr = []
this.clearUp() this.clearUp()
this._queryVehicleGroup() this._queryVehicleGroup()
uni.showToast({ uni.showToast({

View File

@@ -37,7 +37,7 @@
</view> </view>
</view> </view>
<view class="zd-col-22"> <view class="zd-col-22">
<view class="zd-row mgb10 flow_start_item" v-for="el in e.end_points" :key="el.point_code" @tap="checkcode2(el)" :class="{'flow_start_item_checked': pkId2 === el.point_code}"> <view class="zd-row mgb10 flow_start_item" v-for="el in e.end_points" :key="el.point_code" @tap="checkcode2(el, e)" :class="{'flow_start_item_checked': pkId2 === el.point_code}">
<view class="zd-col-8 pdl20 pdr20 font-size-1">{{el.point_code}}</view> <view class="zd-col-8 pdl20 pdr20 font-size-1">{{el.point_code}}</view>
<view class="zd-col-16 pdr20 font-size-2">{{el.point_name}}</view> <view class="zd-col-16 pdr20 font-size-2">{{el.point_name}}</view>
<view v-show="pkId2 === el.point_code" class="iconfont icon_choosed">&#xe66b;</view> <view v-show="pkId2 === el.point_code" class="iconfont icon_choosed">&#xe66b;</view>
@@ -68,7 +68,8 @@
dataList: [], dataList: [],
disabled: false, disabled: false,
pkId1: '', pkId1: '',
pkId2: '' pkId2: '',
pkId3: ''
}; };
}, },
created () { created () {
@@ -81,10 +82,18 @@
this.dataList = [...res] this.dataList = [...res]
}, },
checkcode1 (e) { checkcode1 (e) {
if (this.pkId3 !== '' && e.point_code !== this.pkId3) {
this.pkId2 = ''
this.pkId3 = ''
}
this.pkId1 = this.pkId1 === e.point_code ? '' : e.point_code this.pkId1 = this.pkId1 === e.point_code ? '' : e.point_code
}, },
checkcode2 (e) { checkcode2 (el, e) {
this.pkId2 = this.pkId2 === e.point_code ? '' : e.point_code if (this.pkId1 !== '' && this.pkId1 !== e.point_code) {
return
}
this.pkId2 = this.pkId2 === el.point_code ? '' : el.point_code
this.pkId3 = this.pkId2 === el.point_code ? e.point_code : ''
}, },
/** 重新下发 */ /** 重新下发 */
async toSure () { async toSure () {