交互 背景色

This commit is contained in:
2023-05-26 19:12:08 +08:00
parent c091a2af83
commit 20135fc031
9 changed files with 223 additions and 42 deletions

View File

@@ -5,7 +5,7 @@
<div class="filter_item">
<div class="filter_label">设备</div>
<div class="filter-input-wrap">
<el-select v-model="value" placeholder="请选择">
<el-select v-model="value" filterable clearable placeholder="请选择">
<el-option
v-for="item in options"
:key="item.device_code"
@@ -19,8 +19,8 @@
<div class="wrap-buttons">
<button class="button button--primary" @click="getDatas">查询</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled1" @click="_openStart">开工</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled2" @click="_saveReport">报工</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled3" @click="showDialog">强制完成</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled2" @click="showDialog('1')">报工</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled3" @click="showDialog('2')">强制完成</button>
</div>
</div>
<div class="grid_wraper">
@@ -29,14 +29,15 @@
<th width="4%"></th>
<th width="8%">工单日期</th>
<th width="8%">工单号</th>
<th width="10%">状态</th>
<th width="7%">状态</th>
<th width="8%">设备</th>
<th width="8%">物料名称</th>
<th width="10%">物料规格</th>
<th width="10%">工序</th>
<th width="10%">计划生产</th>
<th width="9%">计划生产</th>
<th width="9%">待生产</th>
<th width="9%">已生产</th>
<th width="13%">开工时间</th>
<th width="9%">开工时间</th>
</tr>
<tr v-for="e in dataList" :key="e.workorder_id">
<td>
@@ -44,8 +45,9 @@
</td>
<td>{{e.create_time}}</td>
<td>{{e.workorder_code}}</td>
<td>{{['创建','下发','生产中','暂停', '完成'][Number(e.workorder_status) - 1]}}</td>
<td>{{['创建','下发','生产中','暂停', '完成', '强制完成'][Number(e.workorder_status) - 1]}}</td>
<td>{{e.device_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.workprocedure_name}}</td>
<td>{{e.plan_qty}}</td>
@@ -57,10 +59,35 @@
</div>
<jxDialog
ref="child"
title="提示"
:title="title"
:type="type"
@toSure="toSureDialog"
>
<div class="form_wraper">当前操作为强制确认确定继续操作吗</div>
<div v-if="type === '1'" class="form_wraper">
<div class="form">
<div class="form_item">
<div class="form_item__label">合格数量</div>
<div class="form_item__content">
<input type="number" class="form_item__input" v-model="reportQty">
</div>
</div>
<div class="form_item">
<div class="form_item__label">报废数量</div>
<div class="form_item__content">
<input type="number" class="form_item__input" v-model="nokQty">
</div>
</div>
</div>
<div class="form">
<div class="form_item">
<div class="form_item__label">报修数量</div>
<div class="form_item__content">
<input type="number" class="form_item__input" v-model="repareQty">
</div>
</div>
</div>
</div>
<div v-if="type === '2'" class="form_wraper">当前操作为强制确认确定继续操作吗</div>
</jxDialog>
</div>
</template>
@@ -82,7 +109,24 @@ export default {
disabled3: false,
dataList: [],
pkId: '',
pkObj: {}
pkObj: {},
title: '',
type: '',
reportQty: '',
nokQty: '',
repareQty: ''
}
},
watch: {
type (val) {
switch (val) {
case '1':
this.title = '请输入数量'
break
case '2':
this.title = '提示'
break
}
}
},
created () {
@@ -127,6 +171,7 @@ export default {
},
// 报工
async _saveReport () {
this.$refs.child.disabled = true
this.disabled2 = true
if (!this.pkId) {
this.toast('请选择一行')
@@ -134,22 +179,36 @@ export default {
return
}
try {
let res = await saveReport(this.pkId, this.pkObj.report_qty, this.pkObj.nok_qty, this.pkObj.repare_qty)
let res = await saveReport(this.pkId, this.reportQty, this.nokQty, this.repareQty)
this.toast(res.message)
this.disabled2 = false
this.pkId = ''
this.pkObj = {}
this.$refs.child.active = false
this.$refs.child.disabled = false
this.getDatas()
} catch (e) {
this.disabled2 = false
this.$refs.child.active = false
this.$refs.child.disabled = false
}
},
showDialog () {
showDialog (type) {
this.type = type
if (!this.pkId) {
this.toast('请选择一行')
return
}
this.$refs.child.active = true
switch (type) {
case '1':
this.reportQty = ''
this.nokQty = ''
this.repareQty = ''
break
case '2':
break
}
},
// 完工
async _tofinish () {
@@ -159,6 +218,8 @@ export default {
let res = await tofinish(this.pkObj)
this.toast(res.message)
this.disabled3 = false
this.pkId = ''
this.pkObj = {}
this.$refs.child.active = false
this.$refs.child.disabled = false
this.getDatas()
@@ -168,8 +229,15 @@ export default {
this.$refs.child.disabled = false
}
},
toSureDialog () {
this._tofinish()
toSureDialog (type) {
switch (type) {
case '1':
this._saveReport()
break
case '2':
this._tofinish()
break
}
},
toRadio (e) {
this.pkId = this.pkId === e.workorder_id ? '' : e.workorder_id