组盘
This commit is contained in:
@@ -53,15 +53,17 @@
|
||||
<th>物料编码</th>
|
||||
<th>物料名称</th>
|
||||
<th>点位</th>
|
||||
<th>物料数量</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<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_type}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.point_code}}</td>
|
||||
<td>{{e.material_qty}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -77,7 +79,7 @@
|
||||
</view>
|
||||
<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': !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>
|
||||
</template>
|
||||
@@ -106,8 +108,7 @@
|
||||
isV: false,
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
checkArr: []
|
||||
};
|
||||
},
|
||||
created () {
|
||||
@@ -150,6 +151,9 @@
|
||||
/** grid */
|
||||
async _queryVehicleGroup () {
|
||||
let res = await queryVehicleGroup()
|
||||
res.map(el => {
|
||||
this.$set(el, 'checked', false)
|
||||
})
|
||||
this.dataList = [...res]
|
||||
},
|
||||
getMater () {
|
||||
@@ -158,8 +162,8 @@
|
||||
})
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.group_id ? '' : e.group_id
|
||||
this.pkObj = this.pkId === e.group_id ? e : {}
|
||||
e.checked = !e.checked
|
||||
this.checkArr = this.dataList.filter(i => { return i.checked === true })
|
||||
},
|
||||
isVirtual () {
|
||||
this.isV = !this.isV
|
||||
@@ -174,7 +178,7 @@
|
||||
try {
|
||||
let res = await groupManual(this.index1, this.val1, this.index2, this.val4, this.val5, this.val3, this.isV)
|
||||
this.disabled1 = false
|
||||
this.pkId = ''
|
||||
this.checkArr = []
|
||||
this.clearUp()
|
||||
this._queryVehicleGroup()
|
||||
uni.showToast({
|
||||
@@ -188,14 +192,20 @@
|
||||
/** 开始配盘 */
|
||||
async _groupLink () {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
if (this.checkArr.length === 0) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
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.pkId = ''
|
||||
this.checkArr = []
|
||||
this.clearUp()
|
||||
this._queryVehicleGroup()
|
||||
uni.showToast({
|
||||
|
||||
Reference in New Issue
Block a user