Commit 00d3aed2 by zhangzhen

细节优化

parent 32fc8895
...@@ -423,9 +423,13 @@ ...@@ -423,9 +423,13 @@
}).then(res => { }).then(res => {
this.inventRecordList = toJsonData(res.data.__blocks__.invent_code_box_block_id.rows, res.data this.inventRecordList = toJsonData(res.data.__blocks__.invent_code_box_block_id.rows, res.data
.__blocks__.invent_code_box_block_id.meta.columns).map(item => { .__blocks__.invent_code_box_block_id.meta.columns).map(item => {
let spec = item.param3Field;
if(!spec.trim()){
spec = `${Number(item.param4Field)}*${Number(item.param5Field)}*${Number(item.param6Field)}`
}
return { return {
...item, ...item,
label: `${item.textField}_${item.param3Field}` , label: `${item.textField}_${spec}` ,
value: item.valueField, value: item.valueField,
name: item.textField name: item.textField
} }
...@@ -664,7 +668,7 @@ ...@@ -664,7 +668,7 @@
.title { .title {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
width: 200upx; width: 220upx;
align-items: center; align-items: center;
} }
......
...@@ -505,10 +505,14 @@ ...@@ -505,10 +505,14 @@
.__blocks__.invent_code_box_block_id.meta.columns) .__blocks__.invent_code_box_block_id.meta.columns)
if(list && list.length){ if(list && list.length){
this.inventRecordList = list.map(item => { this.inventRecordList = list.map(item => {
this.inventRecordEnum[item.valueField] = `${item.textField}_${item.param3Field}` let spec = item.param3Field;
if(!spec.trim()){
spec = `${Number(item.param4Field)}*${Number(item.param5Field)}*${Number(item.param6Field)}`
}
this.inventRecordEnum[item.valueField] = `${item.textField}_${spec}`
return { return {
...item, ...item,
label: `${item.textField}_${item.param3Field}` , label: `${item.textField}_${spec}` ,
value: item.valueField, value: item.valueField,
name: item.textField name: item.textField
} }
......
...@@ -70,10 +70,11 @@ ...@@ -70,10 +70,11 @@
<text>存货名称:</text> <text>存货名称:</text>
</view> </view>
<view v-if="orderInfo.status=='0'" class="text-blue"> <view v-if="orderInfo.status=='0'" class="text-blue">
<picker @change="onInventRecordChange" :value="inventRecordIndex" :range="inventRecordList" <picker @change="onInventRecordChange" :value="inventRecordIndex"
range-key="label"> :range="inventRecordList" range-key="label">
<view class="uni-input form-item-label"> <view class="uni-input form-item-label">
<text class="text-blue">{{inventRecordIndex>=0 ? inventRecordList[inventRecordIndex].label:'请选择存货名称'}}</text> <text
class="text-blue">{{inventRecordIndex>=0 ? inventRecordList[inventRecordIndex].label:'请选择存货名称'}}</text>
<text class="cuIcon-right text-blue"></text> <text class="cuIcon-right text-blue"></text>
</view> </view>
</picker> </picker>
...@@ -129,12 +130,13 @@ ...@@ -129,12 +130,13 @@
<text>数量:</text> <text>数量:</text>
</view> </view>
<view v-if="orderInfo.status=='0'" class="text-blue"> <view v-if="orderInfo.status=='0'" class="text-blue">
<u-input v-model="subListObj.invQty" color="#0081ff" inputAlign="right" @change="onNumChange" type="text" :border="border" placeholder="请输入数量" /> <u-input v-model="subListObj.invQty" color="#0081ff" inputAlign="right"
@change="onNumChange" type="text" :border="border" placeholder="请输入数量" />
</view> </view>
<view v-else class=""> <view v-else class="">
<text>{{Number(subListObj.invQty) || 0 }}</text> <text>{{Number(subListObj.invQty) || 0 }}</text>
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
...@@ -144,7 +146,7 @@ ...@@ -144,7 +146,7 @@
<view class=""> <view class="">
<text>{{Number(subListObj.invUnitWeight) || 0 }}</text> <text>{{Number(subListObj.invUnitWeight) || 0 }}</text>
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title"> <view class="title">
...@@ -154,7 +156,7 @@ ...@@ -154,7 +156,7 @@
<text>{{Number(subListObj.invWeight) || 0 }}</text> <text>{{Number(subListObj.invWeight) || 0 }}</text>
</view> </view>
</view> </view>
<!-- <view class="cu-form-group"> <!-- <view class="cu-form-group">
<view class="title"> <view class="title">
<text v-if="orderInfo.status=='0'" class="text-xl text-red">*</text> <text v-if="orderInfo.status=='0'" class="text-xl text-red">*</text>
<text>单价:</text> <text>单价:</text>
...@@ -246,7 +248,7 @@ ...@@ -246,7 +248,7 @@
submitType: 1, submitType: 1,
otherEnterDate: [], otherEnterDate: [],
subList: [], subList: [],
inventTypeIndex:-1, inventTypeIndex: -1,
inventTypeBoxList: [], inventTypeBoxList: [],
inventTypeBoxEnum: {}, inventTypeBoxEnum: {},
subListObj: { subListObj: {
...@@ -259,9 +261,9 @@ ...@@ -259,9 +261,9 @@
}, },
id: '', id: '',
subId: '', subId: '',
inventRecordList:[], inventRecordList: [],
inventRecordEnum:{}, inventRecordEnum: {},
inventRecordIndex:-1 inventRecordIndex: -1
}; };
}, },
onLoad(option) { onLoad(option) {
...@@ -274,35 +276,35 @@ ...@@ -274,35 +276,35 @@
}, },
methods: { methods: {
onNumChange(e){ onNumChange(e) {
this.subListObj.invWeight = Number(e) * Number(this.subListObj.invUnitWeight); this.subListObj.invWeight = Number(e) * Number(this.subListObj.invUnitWeight);
}, },
onPriceChange(e){ onPriceChange(e) {
this.subListObj.amount = Number(e) * Number(this.subListObj.invQty); this.subListObj.amount = Number(e) * Number(this.subListObj.invQty);
}, },
onInventRecordChange(e){ onInventRecordChange(e) {
let index = Number(e.target.value); let index = Number(e.target.value);
if (this.inventRecordIndex === index) return if (this.inventRecordIndex === index) return
this.inventRecordIndex = index; this.inventRecordIndex = index;
let list = this.inventRecordList[this.inventRecordIndex]; let list = this.inventRecordList[this.inventRecordIndex];
this.subListObj.inventType = list.param1Field; this.subListObj.inventType = list.param1Field;
this.subListObj.inventRecordId = list.param2Field; this.subListObj.inventRecordId = list.param2Field;
this.subListObj.invSpec = list.param3Field; this.subListObj.invSpec = list.param3Field;
this.subListObj.invLength = list.param4Field; this.subListObj.invLength = list.param4Field;
this.subListObj.invWidth = list.param5Field; this.subListObj.invWidth = list.param5Field;
this.subListObj.invThick = list.param6Field; this.subListObj.invThick = list.param6Field;
this.subListObj.invQty = list.param7Field; this.subListObj.invQty = list.param7Field;
this.subListObj.invUnitWeight= list.param8Field; this.subListObj.invUnitWeight = list.param8Field;
this.subListObj.invWeight= list.param9Field; this.subListObj.invWeight = list.param9Field;
this.subListObj.inventTypeDetail= list.param10Field !== 'null'? list.param10Field : '0'; this.subListObj.inventTypeDetail = list.param10Field !== 'null' ? list.param10Field : '0';
this.subListObj.inventName =list.textField; this.subListObj.inventName = list.textField;
this.subListObj.inventCode =list.value this.subListObj.inventCode = list.value
this.subListObj.price = 0 this.subListObj.price = 0
this.subListObj.amount = 0 this.subListObj.amount = 0
this.$forceUpdate(); this.$forceUpdate();
}, },
onSubmit(t) { onSubmit(t) {
...@@ -318,40 +320,40 @@ ...@@ -318,40 +320,40 @@
this.show = false; this.show = false;
if (this.submitType == 1) { if (this.submitType == 1) {
uni.showLoading({ uni.showLoading({
title:"加载中..." title: "加载中..."
}) })
saveSubList({ saveSubList({
...this.subListObj, ...this.subListObj,
receiveId:this.id, receiveId: this.id,
receiveType:0, receiveType: 0,
whCode:this.orderInfo.whCode, whCode: this.orderInfo.whCode,
companyCode:this.orderInfo.companyCode companyCode: this.orderInfo.companyCode
}).then(res =>{ }).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.data.__sys__.status === 0) { if (res.data.__sys__.status === 0) {
uni.showToast({ uni.showToast({
icon:"success", icon: "success",
title:"提交成功" title: "提交成功"
}) })
setTimeout(()=>{ setTimeout(() => {
this.onBack(); this.onBack();
},1500) }, 1500)
} }
}) })
} else { } else {
uni.showLoading({ uni.showLoading({
title:"加载中..." title: "加载中..."
}) })
deleteSubInfo(this.subListObj).then(res=>{ deleteSubInfo(this.subListObj).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.data.__sys__.status === 0) { if (res.data.__sys__.status === 0) {
uni.showToast({ uni.showToast({
icon:"success", icon: "success",
title:"提交成功" title: "提交成功"
}) })
setTimeout(()=>{ setTimeout(() => {
this.onBack(); this.onBack();
},1500) }, 1500)
} }
}) })
} }
...@@ -392,14 +394,12 @@ ...@@ -392,14 +394,12 @@
value: item.valueField value: item.valueField
} }
}); });
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta.columns); let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns);
if (list && list.length) { if (list && list.length) {
this.orderInfo = list[0]; this.orderInfo = list[0];
} }
this.onGetInventInfo(); this.onGetInventInfo();
if(this.subId){
this.onGetSubList();
}
}) })
}, },
onGetSubList() { onGetSubList() {
...@@ -411,29 +411,42 @@ ...@@ -411,29 +411,42 @@
id: this.subId id: this.subId
}).then(res => { }).then(res => {
uni.hideLoading() uni.hideLoading()
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta.columns); let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns);
if (list.length && this.subId) { if (list.length && this.subId) {
this.subListObj = list.find(item => item.id === this.subId); this.subListObj = list.find(item => item.id === this.subId);
this.inventRecordIndex = this.inventRecordList.findIndex(item=> item.value === this.subListObj.inventCode); this.inventRecordIndex = this.inventRecordList.findIndex(item => item.value === this
.subListObj.inventCode);
} }
}) })
}, },
onGetInventInfo(){ onGetInventInfo() {
getInventInfo({ getInventInfo({
whCode:this.orderInfo.whCode, whCode: this.orderInfo.whCode,
companyCode:this.orderInfo.companyCode companyCode: this.orderInfo.companyCode
}).then(res => { }).then(res => {
let list = toJsonData(res.data.__blocks__.invent_code_box_block_id.rows, res.data.__blocks__
this.inventRecordList = toJsonData(res.data.__blocks__.invent_code_box_block_id.rows, res.data .invent_code_box_block_id.meta.columns)
.__blocks__.invent_code_box_block_id.meta.columns).map(item => { if (list && list.length) {
this.inventRecordEnum[item.valueField] = `${item.textField}_${item.param3Field}` this.inventRecordList = list.map(item => {
return { let spec = item.param3Field;
...item, if (!spec.trim()) {
label: `${item.textField}_${item.param3Field}` , spec =
value: item.valueField, `${Number(item.param4Field)}*${Number(item.param5Field)}*${Number(item.param6Field)}`
name: item.textField }
} this.inventRecordEnum[item.valueField] = `${item.textField}_${spec}`
}); return {
...item,
label: `${item.textField}_${spec}`,
value: item.valueField,
name: item.textField
}
});
}
if (this.subId && this.inventRecordIndex ===-1) {
this.onGetSubList();
}
}) })
} }
} }
...@@ -660,11 +673,12 @@ ...@@ -660,11 +673,12 @@
.cu-form-group { .cu-form-group {
height: 32px; height: 32px;
min-height: 32px; min-height: 32px;
padding: 1px 10px 1px 30upx; padding: 1px 10px 1px 30upx;
.title { .title {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
width: 200upx; width: 236upx;
align-items: center; align-items: center;
} }
} }
...@@ -683,6 +697,7 @@ ...@@ -683,6 +697,7 @@
width: 100vw; width: 100vw;
height: 120upx; height: 120upx;
margin-bottom: 100upx; margin-bottom: 100upx;
.btn-box { .btn-box {
width: 80%; width: 80%;
} }
...@@ -749,7 +764,8 @@ ...@@ -749,7 +764,8 @@
width: 100%; width: 100%;
padding: 24upx 36upx; padding: 24upx 36upx;
background-color: #ffffff; background-color: #ffffff;
z-index: 8; z-index: 8;
.cu-btn { .cu-btn {
display: flex; display: flex;
flex: 1; flex: 1;
...@@ -762,7 +778,12 @@ ...@@ -762,7 +778,12 @@
display: flex; display: flex;
background-color: transparent; background-color: transparent;
justify-content: center; justify-content: center;
.cu-form-group{
padding: 2px 20upx 2upx 20upx;
.title{
width: 200upx;
}
}
} }
} }
...@@ -774,15 +795,18 @@ ...@@ -774,15 +795,18 @@
box-shadow: 0 4upx 6upx rgba(0, 0, 0, 0.34); box-shadow: 0 4upx 6upx rgba(0, 0, 0, 0.34);
margin-bottom: 120upx; margin-bottom: 120upx;
} }
.form-item-label{
.form-item-label {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
.text-blue{
.text-blue {
white-space: normal; white-space: normal;
} }
} }
.cu-form-group uni-picker::after{
.cu-form-group uni-picker::after {
color: transparent; color: transparent;
} }
</style> </style>
\ No newline at end of file
...@@ -802,6 +802,12 @@ ...@@ -802,6 +802,12 @@
display: flex; display: flex;
background-color: transparent; background-color: transparent;
justify-content: center; justify-content: center;
.cu-form-group{
padding: 2px 20upx 2upx 20upx;
.title{
width: 252upx;
}
}
} }
.form-content-box:last-child { .form-content-box:last-child {
......
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