Commit 59067845 by zhangzhen

细节优化

parent dfcad55f
......@@ -119,6 +119,11 @@ export const getList = (params,pageData) => {
return http.post(url, d)
}
export const getList2 = (params,pageData) => {
let url = `/service/S_SC_RW_02`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getSubList = (params,pageData) => {
let url = `/service/S_SC_RW_06`
......
......@@ -228,7 +228,7 @@
countData:{}
};
},
onLoad(option) {
onShow() {
this.pageData.offset = 0;
this.onLoading();
},
......
......@@ -93,7 +93,18 @@
placeholder="请输入任务数量"
border="surround"
:disabled="true"
v-model="orderInfo.quantity"
v-model="orderInfo.taskQuantity"
></u--input>
</view>
<view class="flex-col">
<view class="margin-sm">
<text class="text-black text-title text-lg">任务重量:</text>
</view>
<u--input
placeholder="请输入任务数量"
border="surround"
:disabled="true"
v-model="orderInfo.taskWeight"
></u--input>
</view>
<view class="flex-col">
......@@ -111,7 +122,31 @@
<u--input
placeholder="请输入报工数量"
border="surround"
v-model="orderInfo.finishQuantity"
v-model="orderInfo.quantity"
@change="onChange"
></u--input>
</view>
<view class="flex-col">
<view class="margin-sm">
<text class="text-black text-title text-lg">报工重量:</text>
</view>
<u--input
placeholder="请输入报工重量"
border="surround"
:disabled="true"
v-model="orderInfo.weight"
></u--input>
</view>
<view v-if="tipShow" class="flex-col">
<view class="margin-sm">
<text class="text-red">*</text>
<text class="text-black text-title text-lg">超报原因:</text>
</view>
<u--input
placeholder="请输入超报原因"
border="surround"
v-model="orderInfo.exceedReason"
></u--input>
</view>
......@@ -125,7 +160,6 @@
</view>
</view>
</view>
</view>
<view class="flex-col content-part-1">
......@@ -149,6 +183,7 @@
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import {
getList2,
orderSave
} from "@/api/product-order.js";
......@@ -163,19 +198,47 @@
queryData: {},
minDate: moment().subtract(1,'M').format("YYYY-MM-DD"),
fileList: [],
id:'',
tipShow:false
};
},
onLoad() {
const eventChannel = this.getOpenerEventChannel();
eventChannel.on('acceptDataFromOpenerPage', (data) => {
onLoad(option) {
if(option && option.id){
this.id = option.id
this.onLoading()
}
},
methods: {
onChange(e){
console.log(e,99999)
this.orderInfo.weight = e*Number(this.orderInfo.singleWeight);
if(e > Number(this.orderInfo.unregisterQuantity)){
this.tipShow = true
}else{
this.tipShow = false
this.orderInfo.exceedReason = ''
}
},
onLoading(){
uni.showLoading({
title: "加载中"
})
getList2({
taskId:this.id
}).then(res => {
uni.hideLoading();
if(res.data.__sys__.status === 0){
let rows = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta.columns)
if(rows&&rows.length){
this.orderInfo = {
...data.data,
registerDate: data.data.registerDate? data.data.registerDate : moment().format("YYYY-MM-DD"),
finishQuantity: ''
...rows[0],
quantity: rows[0].unregisterQuantity,
weight: Number(rows[0].unregisterQuantity)*Number(rows[0].singleWeight)
};
}
}
})
},
methods: {
// 删除图片
deletePic(event) {
this.fileList.splice(event.index, 1)
......@@ -214,6 +277,13 @@
this.show2 = true;
},
onOpenTip(){
if(Number(this.orderInfo.quantity) > Number(this.orderInfo.unregisterQuantity) && !this.orderInfo.exceedReason){
uni.showToast({
icon:"none",
title:"请输入超报原因"
})
return
}
this.show = true;
},
onCancel(){
......@@ -231,9 +301,23 @@
title:"提交中..."
})
orderSave({
taskId: this.orderInfo.id,
taskId: this.id,
productCode: this.orderInfo.productCode,
productName: this.orderInfo.productName,
spec: this.orderInfo.spec,
length: this.orderInfo.length,
singleWeight: this.orderInfo.singleWeight,
taskQuantity: this.orderInfo.taskQuantity,
taskWeight: this.orderInfo.taskWeight,
processName:this.orderInfo.processName,
registeredQuantity: this.orderInfo.taskQuantity - this.orderInfo.unregisterQuantity,
registeredWeight: this.orderInfo.registeredWeight,
unregisterQuantity: this.orderInfo.unregisterQuantity,
unregisterWeight: this.orderInfo.unregisterWeight,
groupName: this.orderInfo.groupCode,
quantity: this.orderInfo.quantity,
exceedReason: this.orderInfo.exceedReason||' ',
registerDate: this.orderInfo.registerDate || moment().format("YYYY-MM-DD"),
quantity: this.orderInfo.finishQuantity,
docId: this.fileList && this.fileList.length? this.fileList.map(item=>item.id).join():''
}).then(res=>{
if(res.data.__sys__.status===0){
......
......@@ -54,9 +54,9 @@
<view class="header-title">
<image src="../../static/icon5.png" mode="widthFix"></image>
<view class="flex-between">
<text class="text-black text-bold">{{item.productName|| ''}}</text>
<text class="text-black text-bold">{{item.productName|| ''}}-{{item.productCode}}</text>
<view class="text-blue">
<text class="">明细</text>
<text class="">详情</text>
<text class="cuIcon-right"></text>
</view>
......@@ -322,10 +322,7 @@
},
onNavToOrderInfo(val){
uni.navigateTo({
url:`/pages/product-order/index?id=`+val.id,
success: (res) => {
res.eventChannel.emit('acceptDataFromOpenerPage', { data: val})
}
url:`/pages/product-order/index?id=`+val.id
})
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment