配料任务修改

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

@@ -52,10 +52,7 @@ uni-button:after {
display: block;
line-height: 80rpx;
font-size: 28rpx;
color: #323232;
font-weight: bold;
letter-spacing: 4rpx;
padding-left: 10rpx;
color: #3e3e3e;
/* text-align:justify;
text-align-last: justify;
text-justify: inter-ideograph; */
@@ -162,8 +159,8 @@ uni-button:after {
top: 0;
background: #d7d7d7;
font-size: 26rpx;
line-height: 28rpx;
padding: 35rpx 10rpx;
line-height: 58rpx;
padding: 14rpx 20rpx;
color: #7d7d7d;
background-color: #dcdfea;
font-weight: bold;
@@ -377,29 +374,29 @@ uni-button[disabled]:not([type]), uni-button[disabled][type=default] {
transform: translateY(0);
}
.pophide {
transform: translateY(100%);
transform: translateY(300%);
}
.msg_wrapper {
position: fixed;
top: auto;
bottom: 0;
left: 0;
width: 100%;
height: calc(100% - var(--status-bar-height) - 72rpx);
top: 30%;
left: 5%;
width: 90%;
padding: 40rpx 30rpx;
background-color: #f6f6f6;
box-shadow: 0 -8px 16px 0 rgba(28,31,33,.1);
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
z-index: 301;
transition: all .3s;
transition: all .5s;
}
.msg_tip {
font-size: 28rpx;
line-height: 58rpx;
color: #6798ef;
font-weight: bold;
}
.msg_content {
width: 100%;
height: 100%;
overflow-y: scroll;
}
.msg_box {
width: 100%;
margin: 10rpx 0;
}
.msg_mask {
position: fixed;
@@ -412,26 +409,23 @@ uni-button[disabled]:not([type]), uni-button[disabled][type=default] {
z-index: 300;
}
.msg_btns {
width: 100%;
margin: 40rpx auto 0;
}
.msg_btn {
font-size: 34rpx;
line-height: 78rpx;
font-size: 30rpx;
line-height: 68rpx;
color: #fff;
background-color: #ff6a00;
border: 1rpx solid #ff6a00;
border-radius: 44rpx;
box-shadow: 0 8rpx 18rpx 0 rgba(0,0,0,.2);
border-radius: 34rpx;
box-shadow: 0 4rpx 9rpx 0 rgba(0,0,0,.2);
margin-top: 20rpx;
}
.msg_btn_cancle {
background-color: #fff;
border: 1rpx solid #ff6a00;
font-size: 34rpx;
line-height: 78rpx;
border-radius: 44rpx;
color: #000;
box-shadow: 0 8rpx 18rpx 0 rgba(0,0,0,.2);
border-color: #fff;
color: #666;
box-shadow: 0 4rpx 9rpx 0 rgba(0,0,0,.2);
}
.msg_btn:disabled {
background-color: #c9c9c9;
@@ -560,4 +554,12 @@ uni-button[disabled]:not([type]), uni-button[disabled][type=default] {
}
.point-item_n5:nth-child(n+6) {
margin-top: 20rpx
}
.checkbox {
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
border: 1rpx solid #6798ef;
text-align: center;
margin: 0 auto;
}

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) {

View File

@@ -29,4 +29,14 @@ export const queryWorks = () => request({
export const handConfirm = () => request({
url:'api/hand/confirm',
data: {work_code: code}
})
// 查询终点
export const queryZDDevice = () => request({
url:'api/hand/queryZDDevice',
data: {}
})
// 修改终点
export const confirmZZDevice = (code, work, ncode) => request({
url:'api/hand/confirmZZDevice',
data: {mfg_order_name: code, work_code: work, next_device_code: ncode}
})

View File

@@ -53,4 +53,12 @@ export const handConfirm = () => {
message: 'ok'
}
return res
}
export const queryZDDevice = () => {
let res = [{device_code: '10001', device_name: '车号1'}, {device_code: '2', device_name: '车号2'}]
return res
}
export const confirmZZDevice = () => {
let res = {message: 'ok'}
return res
}