Commit b2850a19 by zhangzhen

细节优化

parent 56caa378
...@@ -169,9 +169,9 @@ export const uploadFile2 = (data) => { ...@@ -169,9 +169,9 @@ export const uploadFile2 = (data) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let tokenHeaders = uni.getStorageSync("tokenHeaders"); let tokenHeaders = uni.getStorageSync("tokenHeaders");
uni.uploadFile({ uni.uploadFile({
url: `${config.baseUrl}/upload/file/app`, url: `${config.baseUrl}/upload/file/app?path=${data.path||'HGSC'}&docTag=hg_file003&ename=uploadFile&fileLocation=&isTOES=`,
filePath: data.url, filePath: data.url,
name: 'file', name: 'uploadFile',
header: { header: {
[tokenHeaders]: uni.getStorageSync(tokenHeaders) [tokenHeaders]: uni.getStorageSync(tokenHeaders)
}, },
......
...@@ -88,15 +88,67 @@ const setResultData = (data={}) => { ...@@ -88,15 +88,67 @@ const setResultData = (data={}) => {
return paramsData return paramsData
} }
const setResultDataAndDetail = (data={},detail=[]) => {
let obj = {}
for (let i in data) {
if (data[i] !== '') {
obj[i] = data[i]
}
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"detail1":{
"attr": {},
"meta": {
"columns": []
},
"rows": []
},
"result": {
"attr": {},
"meta": {
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.result.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.result.rows.push(Object.values(obj));
if(detail&&detail.length){
let keyList2 = Object.keys(detail[0]);
keyList2.forEach((item, index) => {
paramsData.__blocks__.detail1.meta.columns.push({
pos: index,
name: item
})
})
detail.forEach(item=>{
paramsData.__blocks__.detail1.rows.push(Object.values(item));
})
}
return paramsData
}
export const getList = (params,pageData) => { export const getList = (params,pageData) => {
let url = `/service/S_XS_JS_01` let url = `/service/S_XS_JS_01`
let d = setParamsData(params,pageData) let d = setParamsData(params,pageData)
return http.post(url, d) return http.post(url, d)
} }
export const save = (data) => { export const save = (data,Detail) => {
let url = `/service/S_XS_KK_02` let url = `/service/S_XS_JS_02`
let d = setResultData(data); let d = setResultDataAndDetail(data,Detail);
return http.post(url, d) return http.post(url, d)
} }
...@@ -113,3 +165,33 @@ export const getProList = (params,pageData) => { ...@@ -113,3 +165,33 @@ export const getProList = (params,pageData) => {
} }
export const getList3 = (params,pageData) => {
let url = `/service/S_CW_QZ_01`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList1 = (params,pageData) => {
let url = `/service/S_CW_QZ_02`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList2 = (params,pageData) => {
let url = `/service/S_CW_QZ_03`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList4 = (params,pageData) => {
let url = `/service/S_CW_QZ_04`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList5 = (params,pageData) => {
let url = `/service/S_CW_QZ_05`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
...@@ -587,6 +587,28 @@ ...@@ -587,6 +587,28 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh" : false "enablePullDownRefresh" : false
} }
},
{
"path" : "pages/settlement-doc/select-list",
"style" :
{
"navigationBarTitleText" : "选择合同",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/settlement-doc/edit",
"style" :
{
"navigationBarTitleText" : "详情",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
} }
], ],
"globalStyle": { "globalStyle": {
......
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
show: false, show: false,
show2: false, show2: false,
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"), minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
content: "请确认是否进行新增入库?", content: "请确认是否进行新增领料单?",
statusBarHeight: uni.getStorageSync("statusHeight") || 0, statusBarHeight: uni.getStorageSync("statusHeight") || 0,
value: 0, value: 0,
orderInfo: {}, orderInfo: {},
...@@ -318,25 +318,12 @@ ...@@ -318,25 +318,12 @@
this.formList[i].inventTypeDetail= list.param10Field !== 'null'? list.param10Field : '0'; this.formList[i].inventTypeDetail= list.param10Field !== 'null'? list.param10Field : '0';
this.formList[i].inventName =list.textField; this.formList[i].inventName =list.textField;
this.formList[i].inventCode =list.value this.formList[i].inventCode =list.value
this.formList[i].price = 0
this.formList[i].amount = 0
this.$forceUpdate(); this.$forceUpdate();
}, },
onSubmit() { onSubmit() {
this.show = true
},
onOpenCalendar() {
this.show2 = true;
},
onCancel() {
this.show = false;
this.show2 = false;
},
onConfirm(e) {
this.receiptDate = e;
this.onCancel();
},
onSave() {
this.show = false;
if (this.factoryIndex < 0) { if (this.factoryIndex < 0) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
...@@ -358,6 +345,21 @@ ...@@ -358,6 +345,21 @@
}) })
return return
} }
this.show = true
},
onOpenCalendar() {
this.show2 = true;
},
onCancel() {
this.show = false;
this.show2 = false;
},
onConfirm(e) {
this.receiptDate = e;
this.onCancel();
},
onSave() {
this.show = false;
uni.showLoading({ uni.showLoading({
title: "加载中..." title: "加载中..."
}) })
...@@ -371,38 +373,53 @@ ...@@ -371,38 +373,53 @@
whName: this.projectList[this.projectIndex].label, whName: this.projectList[this.projectIndex].label,
receiptDate: moment(this.receiptDate[0]).format("YYYYMMDD") receiptDate: moment(this.receiptDate[0]).format("YYYYMMDD")
}).then(res => { }).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) { if (res.data.__sys__.status === 0) {
if(this.formList&&this.formList.length){ if(this.formList&&this.formList.length){
let l= toJsonData(res.data.__blocks__.entity.rows, res.data.__blocks__.entity.meta.columns)
if(l.length){
this.formList = this.formList.map(item => {
return {
receiveId: l[0].id,
...item
}
})
this.onSubSave(0)
}
}else{
uni.hideLoading();
uni.showToast({
icon: "success",
title: "新增成功"
})
setTimeout(() => {
this.onBack();
}, 1500)
} }
uni.showToast({
icon: "success",
title: "新增成功"
})
setTimeout(() => {
this.onBack();
}, 1500)
} }
}) })
}, },
onSubSave(i=0){ onSubSave(i=0){
if(i >= this.formList.length){
uni.hideLoading();
uni.showToast({
icon:"success",
title:"提交成功"
})
setTimeout(()=>{
this.onBack();
},1500)
return;
}
saveSubList({ saveSubList({
...this.formList[i], ...this.formList[i],
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();
if (res.data.__sys__.status === 0) { if (res.data.__sys__.status === 0) {
uni.showToast({ this.onSubSave(++i);
icon:"success",
title:"提交成功"
})
setTimeout(()=>{
this.onBack();
},1500)
} }
}) })
}, },
......
...@@ -299,6 +299,8 @@ ...@@ -299,6 +299,8 @@
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.amount = 0
this.$forceUpdate(); this.$forceUpdate();
}, },
......
...@@ -143,11 +143,7 @@ ...@@ -143,11 +143,7 @@
</template> </template>
<script> <script>
import { import {uploadFile2} from "@/api/index.js";
pathToBase64,
base64ToPath
} from '@/utils/index.js'
import {uploadFile2} from "@/api/index.js";
import { import {
toJsonData toJsonData
} from "@/utils/tools.js"; } from "@/utils/tools.js";
...@@ -200,6 +196,7 @@ ...@@ -200,6 +196,7 @@
const result = await uploadFile2({ const result = await uploadFile2({
url: lists[i].url url: lists[i].url
}) })
console.log(result,99999)
let item = this.fileList[fileListLen] let item = this.fileList[fileListLen]
this.fileList.splice(fileListLen, 1, Object.assign(item, { this.fileList.splice(fileListLen, 1, Object.assign(item, {
status: 'success', status: 'success',
...@@ -230,6 +227,7 @@ ...@@ -230,6 +227,7 @@
this.onCancel(); this.onCancel();
}, },
onConfirmSave(){ onConfirmSave(){
console.log(this.fileList,999)
this.onCancel(); this.onCancel();
uni.showLoading({ uni.showLoading({
title:"提交中..." title:"提交中..."
...@@ -237,7 +235,8 @@ ...@@ -237,7 +235,8 @@
orderSave({ orderSave({
taskId: this.orderInfo.id, taskId: this.orderInfo.id,
registerDate: this.orderInfo.registerDate || moment().format("YYYY-MM-DD"), registerDate: this.orderInfo.registerDate || moment().format("YYYY-MM-DD"),
quantity: this.orderInfo.finishQuantity quantity: this.orderInfo.finishQuantity,
matId: this.fileList && this.fileList.length? this.fileList.map(item=>item.id).join():''
}).then(res=>{ }).then(res=>{
if(res.data.__sys__.status===0){ if(res.data.__sys__.status===0){
uni.showToast({ uni.showToast({
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</view> </view>
</block> </block>
<block slot="content"> <block slot="content">
<text class="text-white">扣款单详情</text> <text class="text-white">结算单详情</text>
</block> </block>
</cu-custom> </cu-custom>
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
}, },
onBack() { onBack() {
uni.redirectTo({ uni.redirectTo({
url:'/pages/debit-note/list' url:'/pages/settlement-doc/list'
}) })
}, },
onLoading() { onLoading() {
......
...@@ -51,6 +51,13 @@ ...@@ -51,6 +51,13 @@
<text class="text-gray part-2">:</text> <text class="text-gray part-2">:</text>
<text class="text-title ellipsis">{{item.partyB}}</text> <text class="text-title ellipsis">{{item.partyB}}</text>
</view> </view>
<view class="flex-row">
<text class="text-gray part-1">合同总价</text>
<text class="text-gray part-2">:</text>
<text class="text-title ellipsis">{{Number(item.totalContractPriceIncluding)}}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
}, },
onNavToOrderInfo(val){ onNavToOrderInfo(val){
uni.navigateTo({ uni.navigateTo({
url:`/pages/debit-note/edit?id=${val.id}` url:`/pages/settlement-doc/edit?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