配料任务修改

This commit is contained in:
2025-02-15 12:51:56 +08:00
parent e563eebf91
commit 5bcf7cfc2c
4 changed files with 115 additions and 35 deletions

View File

@@ -7,6 +7,7 @@
<table>
<thead>
<tr>
<th>选择</th>
<th>任务编码</th>
<th>状态</th>
<th>工单编码</th>
@@ -15,11 +16,16 @@
<th>物料重量</th>
<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.work_code === pkId}">
<tr v-for="(e, i) in dataList" :key="i">
<td @tap="toCheck(e)">
<view class="checkbox">
<uni-icons type="checkmarkempty" size="20" :color="e.work_code === pkId ? '#4e6ef2' : '#fff'"></uni-icons>
</view>
</td>
<td>{{e.work_code}}</td>
<td>{{ e.status }}</td>
<td>{{ e.mfg_order_name }}</td>
@@ -28,7 +34,7 @@
<td>{{ e.qty }}</td>
<td>{{ e.require_num }}</td>
<td>{{ e.remain_num }}</td>
<td>{{ e.resource_name }}</td>
<td @tap="updateCode(e)">{{ e.next_device_code }}</td>
</tr>
</tbody>
</table>
@@ -39,13 +45,29 @@
<button class="zd-col-11 button-default" @tap="clearUp">清空</button>
<button class="zd-col-11 button-primary" :disabled="disabled" :class="{'button-info': !pkId}" @tap="_handConfirm">确认</button>
</view>
<view class="msg_wrapper" :class="show ? 'popshow' : 'pophide'">
<view class="msg_tip">工单编码{{pkObj.mfg_order_name}}</view>
<view class="msg_content">
<view class="zd-row">
<view class="zd-col-6 filter_label">选择终点</view>
<view class="zd-col-18 filter_input_wraper">
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
</view>
</view>
<view class="msg_btns">
<button class="zd-col-24 msg_btn" :disabled="disabled" @tap="_confirmZZDevice">确定</button>
<button class="zd-col-24 msg_btn msg_btn_cancle" @tap.stop="show = false">返回</button>
</view>
</view>
<view v-if="show" class="msg_mask"></view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {queryWorks, handConfirm} from '@/utils/getData2.js'
import {queryWorks, handConfirm, queryZDDevice, confirmZZDevice} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -54,16 +76,34 @@
data() {
return {
title: '',
options1: [],
index1: '',
disabled: false,
dataList: [],
pkId: ''
pkId: '',
pkObj: {},
show: false
};
},
onLoad (options) {
this.title = options.title
this._queryWorks()
},
created () {
this._queryZDDevice()
},
methods: {
async _queryZDDevice () {
let res = await queryZDDevice()
this.options1 = [...res]
this.options1.map(el => {
this.$set(el, 'text', el.device_name)
this.$set(el, 'value', el.device_code)
})
},
selectChange1 (e) {
this.index1 = e
},
async _queryWorks () {
let res = await queryWorks()
this.dataList = [...res]
@@ -76,6 +116,26 @@
toCheck (e) {
this.pkId = this.pkId === e.work_code ? '' : e.work_code
},
updateCode (e) {
this.show = true
this.pkObj = e
this.index1 = ''
},
async _confirmZZDevice () {
this.disabled = true
try {
let res = await confirmZZDevice(this.pkObj.mfg_order_name, this.pkObj.work_code, this.index1)
this.show = false
this.disabled = false
this._queryWorks()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
async _handConfirm () {
this.disabled = true
if (!this.pkId) {