刻字管理模块

This commit is contained in:
2023-08-25 14:32:42 +08:00
parent a46575030a
commit 80df265f9a
4 changed files with 60 additions and 26 deletions

View File

@@ -15,9 +15,9 @@
</div>
</div>
<div class="search-item">
<div class="search-label"></div>
<div class="search-label"></div>
<div class="filter_input_wraper">
<input type="number" class="filter-input" v-model="$route.query.weight" disabled>
<input type="number" class="filter-input" v-model="$route.query.num" disabled>
</div>
</div>
<div class="search-item_3 flex-end">
@@ -39,7 +39,7 @@
<th>计划数量</th>
<th>生产数量</th>
<th>物料规格</th>
<th>重量(g)</th>
<th>数量</th>
<th>物料编号</th>
<th>物料名称</th>
</tr>
@@ -55,7 +55,7 @@
<td>{{e.plan_qty | numeric(3)}}</td>
<td>{{e.dq_real_qty | numeric(3)}}</td>
<td>{{ e.material_spec }}</td>
<td><input type="number" class="input" v-model="e.weight" @blur="handleBlur(e)"></td>
<td><input type="number" class="input" v-model="e.qty" @blur="handleBlur(e)"></td>
<td>{{ e.material_code }}</td>
<td>{{ e.material_name }}</td>
</tr>
@@ -86,7 +86,7 @@ export default {
this.checkArr = []
res.content.map(el => {
this.$set(el, 'checked', false)
this.$set(el, 'weight', '')
this.$set(el, 'qty', '')
})
this.dataList = [...res.content]
}
@@ -95,17 +95,17 @@ export default {
if (this.checkArr.length === 0) {
return
}
let weight = accDiv(this.$route.query.weight, this.checkArr.length)
weight = Number(weight).toFixed(0)
let qty = accDiv(this.$route.query.num, this.checkArr.length)
qty = Number(qty).toFixed(0)
this.dataList.map(el => {
if (el.checked === true) {
this.$set(el, 'weight', weight)
this.$set(el, 'qty', qty)
}
})
},
toCancle () {
this.dataList.map(el => {
this.$set(el, 'weight', '')
this.$set(el, 'qty', '')
})
},
// 确认上料
@@ -118,8 +118,8 @@ export default {
let total = 0
let flag = false
this.checkArr.map(el => {
total = accAdd(total, el.weight)
if (el.weight === '') {
total = accAdd(total, el.qty)
if (el.qty === '') {
flag = true
}
})
@@ -128,15 +128,15 @@ export default {
this.disabled1 = false
return
}
if (Number(total) > Number(this.$route.query.weight)) {
this.toast('总量之和不大于库存量')
if (Number(total) > Number(this.$route.query.num)) {
this.toast('总量之和不大于库存量')
this.disabled1 = false
return
}
try {
let arr = []
this.checkArr.map(el => {
arr.push({device_code: el.device_code, weight: el.weight, struct_code: this.$route.query.code})
arr.push({device_code: el.device_code, qty: el.qty, struct_code: this.$route.query.code})
})
let res = await kzSubmitkz(arr)
if (res.code === 200) {
@@ -149,7 +149,7 @@ export default {
}
},
handleBlur (e) {
e.weight = Math.trunc(Number(e.weight))
e.qty = Math.trunc(Number(e.qty))
},
toRadio (e) {
e.checked = !e.checked

View File

@@ -18,6 +18,7 @@
<th>载具号</th>
<th>物料规格</th>
<th>重量(kg)</th>
<th>数量</th>
<th>物料编号</th>
<th>入库时间</th>
<th>是否已挑料</th>
@@ -31,6 +32,7 @@
<td>{{e.storagevehicle_code}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.canuse_qty | unitskg}}</td>
<td>{{ e.m_qty }}</td>
<td>{{ e.material_code }}</td>
<td>{{ e.instorage_time }}</td>
<td>{{ e.is_pick === true ? '是' : '否' }}</td>
@@ -110,7 +112,7 @@ export default {
path: '/letteringmachineselect',
query: {
code: this.pkObj.struct_code,
weight: this.pkObj.canuse_qty,
num: this.pkObj.m_qty,
spec: this.pkObj.material_spec
}
})

View File

@@ -17,9 +17,9 @@
</div>
<div class="search-item_2">
<button class="button button--primary" @click="_KzTasks">查询</button>
<button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': pkId === ''}" @click="toSure1">强制完成</button>
<button class="button button--primary" :disabled="disabled2" :class="{'button--defalut': pkId === ''}" @click="toSure2">强制取消</button>
<button class="button button--primary" :disabled="disabled3" :class="{'button--defalut': pkId === ''}" @click="_kzresend">重新下发</button>
<button class="button button--primary" :disabled="disabled3" :class="{'button--defalut': pkId === ''}" @click="_kzresend">下发</button>
<button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': pkId === ''}" @click="toSure1('1')">强制完成</button>
<button class="button button--primary" :disabled="disabled2" :class="{'button--defalut': pkId === ''}" @click="toSure2('2')">强制取消</button>
</div>
</div>
</div>
@@ -57,12 +57,26 @@
</tbody>
</table>
</div>
<jxDialog
ref="child"
title="提示"
:type="type"
@toSure="toSureDialog"
@toCancle="toCancle"
>
<div v-show="type === '1'" class="form_wraper">是否强制完成该任务</div>
<div v-show="type === '2'" class="form_wraper">是否强制取消该任务</div>
</jxDialog>
</div>
</template>
<script>
import jxDialog from '@components/dialog.vue'
import {dictAll, KzTasks, operation, kzresend} from '@config/getData2.js'
export default {
components: {
jxDialog
},
data () {
return {
options1: [],
@@ -72,7 +86,8 @@ export default {
pkObj: {},
disabled1: false,
disabled2: false,
disabled3: false
disabled3: false,
type: ''
}
},
created () {
@@ -101,21 +116,37 @@ export default {
this.pkId = this.pkId === e.task_id ? '' : e.task_id
this.pkObj = this.pkId === e.task_id ? e : {}
},
toSure1 () {
toSure1 (type) {
this.disabled1 = true
if (this.pkId === '') {
this.disabled1 = false
return
}
this._operation('forceFinish')
this.type = type
this.$refs.child.active = true
},
toSure2 () {
toSure2 (type) {
this.disabled2 = true
if (this.pkId === '') {
this.disabled2 = false
return
}
this._operation('cancel')
this.type = type
this.$refs.child.active = true
},
toSureDialog (type) {
switch (type) {
case '1':
this._operation('forceFinish')
break
case '2':
this._operation('cancel')
break
}
},
toCancle () {
this.disabled1 = false
this.disabled2 = false
},
async _operation (type) {
try {
@@ -129,6 +160,7 @@ export default {
} catch (e) {
this.disabled1 = false
this.disabled2 = false
this.$refs.child.active = false
}
},
// 重新下发

View File

@@ -3,8 +3,8 @@
<div class="search-confirm-wrap">
<div class="search-wrap">
<div class="search-item_3">
<button class="button button--primary" :disabled="disabled1" @click="toSure">刻字上料</button>
<button class="button button--primary" :disabled="disabled2" @click="_tmpsendVechile">空框搬回</button>
<button class="button button--primary" :disabled="disabled1" @click="toSure">临时刻字上料</button>
<button class="button button--primary" :disabled="disabled2" @click="_tmpsendVechile">临时空框搬回</button>
</div>
</div>
</div>