Commit 00d3aed2 by zhangzhen

细节优化

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