Commit b2850a19 by zhangzhen

细节优化

parent 56caa378
......@@ -169,9 +169,9 @@ export const uploadFile2 = (data) => {
return new Promise((resolve, reject) => {
let tokenHeaders = uni.getStorageSync("tokenHeaders");
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,
name: 'file',
name: 'uploadFile',
header: {
[tokenHeaders]: uni.getStorageSync(tokenHeaders)
},
......
......@@ -88,15 +88,67 @@ const setResultData = (data={}) => {
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) => {
let url = `/service/S_XS_JS_01`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const save = (data) => {
let url = `/service/S_XS_KK_02`
let d = setResultData(data);
export const save = (data,Detail) => {
let url = `/service/S_XS_JS_02`
let d = setResultDataAndDetail(data,Detail);
return http.post(url, d)
}
......@@ -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 @@
"navigationStyle": "custom",
"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": {
......
......@@ -237,7 +237,7 @@
show: false,
show2: false,
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
content: "请确认是否进行新增入库?",
content: "请确认是否进行新增领料单?",
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
value: 0,
orderInfo: {},
......@@ -318,25 +318,12 @@
this.formList[i].inventTypeDetail= list.param10Field !== 'null'? list.param10Field : '0';
this.formList[i].inventName =list.textField;
this.formList[i].inventCode =list.value
this.formList[i].price = 0
this.formList[i].amount = 0
this.$forceUpdate();
},
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) {
uni.showToast({
icon: "none",
......@@ -358,6 +345,21 @@
})
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({
title: "加载中..."
})
......@@ -371,38 +373,53 @@
whName: this.projectList[this.projectIndex].label,
receiptDate: moment(this.receiptDate[0]).format("YYYYMMDD")
}).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
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){
if(i >= this.formList.length){
uni.hideLoading();
uni.showToast({
icon:"success",
title:"提交成功"
})
setTimeout(()=>{
this.onBack();
},1500)
return;
}
saveSubList({
...this.formList[i],
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:"提交成功"
})
setTimeout(()=>{
this.onBack();
},1500)
this.onSubSave(++i);
}
})
},
......
......@@ -299,6 +299,8 @@
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();
},
......
......@@ -143,11 +143,7 @@
</template>
<script>
import {
pathToBase64,
base64ToPath
} from '@/utils/index.js'
import {uploadFile2} from "@/api/index.js";
import {uploadFile2} from "@/api/index.js";
import {
toJsonData
} from "@/utils/tools.js";
......@@ -200,6 +196,7 @@
const result = await uploadFile2({
url: lists[i].url
})
console.log(result,99999)
let item = this.fileList[fileListLen]
this.fileList.splice(fileListLen, 1, Object.assign(item, {
status: 'success',
......@@ -230,6 +227,7 @@
this.onCancel();
},
onConfirmSave(){
console.log(this.fileList,999)
this.onCancel();
uni.showLoading({
title:"提交中..."
......@@ -237,7 +235,8 @@
orderSave({
taskId: this.orderInfo.id,
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=>{
if(res.data.__sys__.status===0){
uni.showToast({
......
......@@ -7,7 +7,7 @@
</view>
</block>
<block slot="content">
<text class="text-white">扣款单详情</text>
<text class="text-white">结算单详情</text>
</block>
</cu-custom>
......@@ -214,7 +214,7 @@
},
onBack() {
uni.redirectTo({
url:'/pages/debit-note/list'
url:'/pages/settlement-doc/list'
})
},
onLoading() {
......
......@@ -51,6 +51,13 @@
<text class="text-gray part-2">:</text>
<text class="text-title ellipsis">{{item.partyB}}</text>
</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>
......
......@@ -268,7 +268,7 @@
},
onNavToOrderInfo(val){
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