Commit a8ea6fea by zhangzhen

功能优化

parent ed9fb6a1
...@@ -113,3 +113,9 @@ export const getProList = (params,pageData) => { ...@@ -113,3 +113,9 @@ export const getProList = (params,pageData) => {
} }
export const del = (data) => {
let url = `/service/S_XS_KK_04`
let d = setResultData(data);
return http.post(url, d)
}
...@@ -88,6 +88,34 @@ const setResultData = (data={}) => { ...@@ -88,6 +88,34 @@ const setResultData = (data={}) => {
return paramsData return paramsData
} }
const setResultDataForList = (list=[]) => {
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"result": {
"attr": {},
"meta": {
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(list[0]);
keyList.forEach((item, index) => {
paramsData.__blocks__.result.meta.columns.push({
pos: index,
name: item
})
})
list.forEach(item => {
paramsData.__blocks__.result.rows.push(Object.values(item));
})
return paramsData
}
const setResultDataAndDetail = (data={},detail={}) => { const setResultDataAndDetail = (data={},detail={}) => {
let obj = {} let obj = {}
for (let i in data) { for (let i in data) {
...@@ -220,6 +248,13 @@ export const save = (data) => { ...@@ -220,6 +248,13 @@ export const save = (data) => {
} }
export const updateList = (data) => {
let url = `/service/S_CW_FK_06`
let d = setResultDataForList(data);
return http.post(url, d)
}
// 审核 // 审核
export const updateSubmitStatus = (data) => { export const updateSubmitStatus = (data) => {
let url = `/service/S_CW_FK_02` let url = `/service/S_CW_FK_02`
......
...@@ -21,7 +21,7 @@ const setParamsData = (data = {},pageData) => { ...@@ -21,7 +21,7 @@ const setParamsData = (data = {},pageData) => {
"result": { "result": {
"attr": { "attr": {
count: 0, count: 0,
limit: pageData && pageData.limit? pageData.limit : 10, limit: pageData && pageData.limit? pageData.limit : 100,
offset: pageData && pageData.offset? pageData.offset*pageData.limit : 0, offset: pageData && pageData.offset? pageData.offset*pageData.limit : 0,
orderBy: "", orderBy: "",
showCount: pageData && pageData.showCount? pageData.showCount : "true" showCount: pageData && pageData.showCount? pageData.showCount : "true"
...@@ -146,6 +146,17 @@ export const getList = (params,pageData) => { ...@@ -146,6 +146,17 @@ export const getList = (params,pageData) => {
return http.post(url, d) return http.post(url, d)
} }
export const getSubList = (data) => {
let url = `/service/S_XS_JS_03`
return http.post(url, data)
}
export const saveSubList = (data) => {
let url = `/service/S_XS_JS_04`
let d = setResultDataAndDetail({},data)
return http.post(url, d)
}
export const save = (data,Detail) => { export const save = (data,Detail) => {
let url = `/service/S_XS_JS_02` let url = `/service/S_XS_JS_02`
let d = setResultDataAndDetail(data,Detail); let d = setResultDataAndDetail(data,Detail);
...@@ -164,6 +175,12 @@ export const getProList = (params,pageData) => { ...@@ -164,6 +175,12 @@ export const getProList = (params,pageData) => {
return http.post(url, d) return http.post(url, d)
} }
export const getProList2 = (params,pageData) => {
let url = `/service/S_CW_HT_02`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList1 = (params,pageData) => { export const getList1 = (params,pageData) => {
let url = `/service/S_CW_QZ_01` let url = `/service/S_CW_QZ_01`
let d = setParamsData(params,pageData) let d = setParamsData(params,pageData)
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</view> </view>
<view class="text-blue"> <view class="text-blue">
<u-input v-model="orderInfo.totalContractPriceIncluding" color="#0081ff" inputAlign="right" <u-input v-model="orderInfo.totalContractPriceIncluding" color="#0081ff" inputAlign="right"
type="text" :border="border" placeholder="请输入扣款金额" /> type="number" :border="border" placeholder="请输入扣款金额" />
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
content: "请确认是否进行新增扣款单?", content: "请确认是否进行新增扣款单?",
statusBarHeight: uni.getStorageSync("statusHeight") || 0, statusBarHeight: uni.getStorageSync("statusHeight") || 0,
orderInfo: { orderInfo: {
reviewStatus:'3', reviewStatus:'0',
signingDate: moment().format("YYYY-MM-DD") signingDate: moment().format("YYYY-MM-DD")
}, },
}; };
......
...@@ -120,6 +120,7 @@ ...@@ -120,6 +120,7 @@
<view v-if="orderInfo.reviewStatus && orderInfo.reviewStatus!=3" class="footer-box"> <view v-if="orderInfo.reviewStatus && orderInfo.reviewStatus!=3" class="footer-box">
<button class="cu-btn block bg-blue" @tap="onSubmit(1)">提交</button> <button class="cu-btn block bg-blue" @tap="onSubmit(1)">提交</button>
<button class="cu-btn block bg-red" @tap="onSubmit(2)">删除</button>
</view> </view>
<u-calendar :show="show2" mode="single" :defaultDate="orderInfo.signingDate" :minDate="minDate" :monthNum='4' <u-calendar :show="show2" mode="single" :defaultDate="orderInfo.signingDate" :minDate="minDate" :monthNum='4'
@confirm="onConfirm" @close="onCancel"></u-calendar> @confirm="onConfirm" @close="onCancel"></u-calendar>
...@@ -138,7 +139,8 @@ ...@@ -138,7 +139,8 @@
} from "@/api/product-warehousing.js"; } from "@/api/product-warehousing.js";
import { import {
getList, getList,
updateSubmitStatus updateSubmitStatus,
del
} from "@/api/debit-note.js"; } from "@/api/debit-note.js";
export default { export default {
...@@ -171,6 +173,8 @@ ...@@ -171,6 +173,8 @@
}, },
methods: { methods: {
onSubmit(t) { onSubmit(t) {
this.submitType = t;
this.content = t==1? '请确认是否进行审核操作?':'请确认是否进行删除操作?'
this.show = true this.show = true
}, },
onOpenCalendar() { onOpenCalendar() {
...@@ -189,6 +193,7 @@ ...@@ -189,6 +193,7 @@
uni.showLoading({ uni.showLoading({
title: "加载中..." title: "加载中..."
}) })
if(this.submitType == 1){
updateSubmitStatus({ updateSubmitStatus({
...this.orderInfo, ...this.orderInfo,
reviewStatus:3 reviewStatus:3
...@@ -200,10 +205,25 @@ ...@@ -200,10 +205,25 @@
title: "提交成功" title: "提交成功"
}) })
setTimeout(() => { setTimeout(() => {
this.onGetList();
}, 1500)
}
})
}else{
del(this.orderInfo).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
icon: "success",
title: "提交成功"
})
setTimeout(() => {
this.onBack(); this.onBack();
}, 1500) }, 1500)
} }
}) })
}
}, },
onBack() { onBack() {
uni.redirectTo({ uni.redirectTo({
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<text class="text-white">选择项目</text> <text class="text-white">选择项目</text>
</block> </block>
<block slot="right"> <block slot="right">
<text class="text-green text-bold text-lg margin-right" @tap="onCheck">确 定</text> <text class="text-white text-bold text-lg margin-right" @tap="onCheck">确 定</text>
</block> </block>
</cu-custom> </cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}"> <view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
......
...@@ -323,7 +323,12 @@ ...@@ -323,7 +323,12 @@
url: `/pages/payment-order/index?checkedId=${checkedId}`, url: `/pages/payment-order/index?checkedId=${checkedId}`,
events: { events: {
acceptDataFromOpenedPage: (data) => { acceptDataFromOpenedPage: (data) => {
this.selectList = data.data; this.selectList = data.data.map(item => {
return {
...item,
thisAmount: Number(item.remainingAmount)
}
});
this.$forceUpdate(); this.$forceUpdate();
} }
} }
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
</view> </view>
</block> </block>
<block slot="content"> <block slot="content">
<text class="text-white">结算单详情</text> <text class="text-white">付款单详情</text>
</block> </block>
<block slot="right"> <block slot="right">
<view v-if="subList && subList.length" class="right-btn" @tap="onEditOrSave"> <view v-if="orderInfo.reviewStatus == '0' && subList && subList.length" class="right-btn" @tap="onEditOrSave">
<text class="text-white">{{isEdit? '保存' : '编辑'}}</text> <text class="text-white">{{isEdit? '保存' : '编辑'}}</text>
</view> </view>
</block> </block>
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<view class="flex-col content-part-1 content-part-2"> <view class="flex-col content-part-1 content-part-2">
<view class="flex-row header"> <view class="flex-row header">
<text class="text-lg text-bold text-black">清单明细</text> <text class="text-lg text-bold text-black">付款清单</text>
</view> </view>
<view class="form-content-box margin-bottom"> <view class="form-content-box margin-bottom">
<view v-for="(item,i) in subList" :key="i" class="sub-item-box"> <view v-for="(item,i) in subList" :key="i" class="sub-item-box">
...@@ -121,9 +121,19 @@ ...@@ -121,9 +121,19 @@
<text>{{item.contractNumber}}</text> <text>{{item.contractNumber}}</text>
</view> </view>
</view> </view>
<view v-if="item.remainingAmount" class="cu-form-group">
<view class="title">
<text>剩余金额:</text>
</view>
<view class="">
<text>{{Number(item.remainingAmount)}}</text>
</view>
</view>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title"> <view class="title">
<text>收款额:</text> <text>收款额:</text>
</view> </view>
<view v-if="isEdit && item.isEdit" class=""> <view v-if="isEdit && item.isEdit" class="">
<u-input v-model="item.totalContractPriceIncluding" <u-input v-model="item.totalContractPriceIncluding"
...@@ -134,6 +144,15 @@ ...@@ -134,6 +144,15 @@
<text>{{item.totalContractPriceIncluding}}</text> <text>{{item.totalContractPriceIncluding}}</text>
</view> </view>
</view> </view>
<view class="cu-form-group">
<view class="title">
<text>创建时间:</text>
</view>
<view class="">
<text>{{item.createdDate}}</text>
</view>
</view>
</form> </form>
...@@ -163,13 +182,14 @@ ...@@ -163,13 +182,14 @@
<script> <script>
import { getDict } from '@/api/index.js'; import { getDict } from '@/api/index.js';
import { import {
toJsonData toJsonData,
formatForLen14
} from "@/utils/tools.js"; } from "@/utils/tools.js";
import moment from "@/common/moment.js"; import moment from "@/common/moment.js";
import { import {
getParamsData getParamsData
} from "@/api/product-warehousing.js"; } from "@/api/product-warehousing.js";
import { getList,getSubList,updateSubmitStatus,updateWriteoffStatus } from "@/api/payment-order.js"; import { getList,getSubList,updateSubmitStatus,updateWriteoffStatus,updateList,saveBySelect } from "@/api/payment-order.js";
export default { export default {
data() { data() {
...@@ -200,7 +220,6 @@ ...@@ -200,7 +220,6 @@
}, },
methods: { methods: {
onEditOrSave(){ onEditOrSave(){
if(this.isEdit){ if(this.isEdit){
this.submitType = 3; this.submitType = 3;
this.content = '请确认是否进行数据保存操作?' this.content = '请确认是否进行数据保存操作?'
...@@ -216,21 +235,45 @@ ...@@ -216,21 +235,45 @@
} }
}, },
onNavToSelect() { onNavToSelect() {
if(this.isEdit){
uni.showToast({
icon:"none",
title:"请将数据保存后操作"
})
return
}
let checkedId = ''; let checkedId = '';
if(this.selectList.length){ if(this.subList.length){
checkedId = this.selectList.map(item => item.id).join(); checkedId = this.subList.filter(item => item.isEdit)?.map(item => item.id).join();
} }
this.mainId = this.id;
uni.navigateTo({ uni.navigateTo({
url: `/pages/payment-order/index?checkedId=${checkedId}`, url: `/pages/payment-order/index?mainId=${this.id}&checkedId=${checkedId}`,
events: { events: {
acceptDataFromOpenedPage: (data) => { acceptDataFromOpenedPage: (data) => {
this.selectList = data.data; this.isEdit = true;
let list = data.data.map(item => {
return {
...item,
totalContractPriceIncluding: Number(item.remainingAmount),
isEdit: true
}
});
this.subList = [...list,...this.subList];
console.log(this.subList,99999)
this.$forceUpdate(); this.$forceUpdate();
} }
} }
}) })
}, },
onSubmit(t) { onSubmit(t) {
if(this.isEdit){
uni.showToast({
icon:"none",
title:"请将数据保存后提交"
})
return
}
this.submitType = t; this.submitType = t;
this.content = this.submitType ==1? '请确认是否进行审核通过操作?':"请确认是否进行核销通过操作?" this.content = this.submitType ==1? '请确认是否进行审核通过操作?':"请确认是否进行核销通过操作?"
this.show = true this.show = true
...@@ -279,6 +322,44 @@ ...@@ -279,6 +322,44 @@
}) })
} else if(this.submitType ==3){ } else if(this.submitType ==3){
this.isEdit = false; this.isEdit = false;
if(this.mainId){
let list = this.subList.filter(item => item.isEdit).map(item => {
return {
...item,
thisAmount: item.totalContractPriceIncluding
}
})
saveBySelect(list,{
hiddenConditions:'1',
billState: '1',
mainId: this.mainId
}).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
icon: "success",
title: "新增成功"
})
this.mainId = ""
setTimeout(() => {
this.onGetList();
}, 1500)
}
})
}else{
updateList(this.subList).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
icon: "success",
title: "操作成功"
})
}
setTimeout(() => {
this.onGetList();
}, 1500)
})
}
} }
}, },
onBack() { onBack() {
...@@ -344,9 +425,11 @@ ...@@ -344,9 +425,11 @@
.columns); .columns);
if (list && list.length) { if (list && list.length) {
this.subList = list.map(item => { this.subList = list.map(item => {
return { return {
...item, ...item,
totalContractPriceIncluding: Number(item.totalContractPriceIncluding) totalContractPriceIncluding: Number(item.totalContractPriceIncluding),
createdDate: formatForLen14(item.createdTime)
} }
}) })
} }
......
...@@ -149,15 +149,13 @@ ...@@ -149,15 +149,13 @@
return { return {
...this.projectDataList[val], ...this.projectDataList[val],
billId: this.projectDataList[val].id, billId: this.projectDataList[val].id,
mainId: this.mainId mainId: this.mainId,
contractNumber: this.projectDataList[val].billNumber
} }
}) })
this.eventChannel.emit('acceptDataFromOpenedPage', {data:list}); this.eventChannel.emit('acceptDataFromOpenedPage', {data:list});
} }
this.onBack(); this.onBack();
}, },
onSelect(k){ onSelect(k){
......
...@@ -109,11 +109,11 @@ ...@@ -109,11 +109,11 @@
<text class="text-gray part-2">:</text> <text class="text-gray part-2">:</text>
<text class="text-title">{{item.finishQuantity}}</text> <text class="text-title">{{item.finishQuantity}}</text>
</view> </view>
<view class="flex-row"> <!-- <view class="flex-row">
<text class="text-gray part-1">完成状态</text> <text class="text-gray part-1">完成状态</text>
<text class="text-gray part-2">:</text> <text class="text-gray part-2">:</text>
<text class="text-title">{{Number(item.finishQuantity) >= Number(item.quantity)? '已完工':'未完工'}}</text> <text class="text-title">{{Number(item.finishQuantity) >= Number(item.quantity)? '已完工':'未完工'}}</text>
</view> </view> -->
</view> </view>
...@@ -184,11 +184,11 @@ ...@@ -184,11 +184,11 @@
}, },
{ {
name: '未完工', name: '未完工',
value: 0 value: '0'
}, },
{ {
name: '已完工', name: '已完工',
value: 1 value: '1'
} }
], ],
value: 0, value: 0,
......
...@@ -250,15 +250,14 @@ ...@@ -250,15 +250,14 @@
placeholder="请输入工程量" /> placeholder="请输入工程量" />
</view> </view>
</view> </view>
<!-- <view class="cu-form-group"> <view class="cu-form-group">
<view class="title"> <view class="title">
<text>累计结算工程量:</text> <text>累计结算工程量:</text>
</view> </view>
<view class=""> <view class="">
<u-input v-model="item.cumulativeEngineeringQuantity" :disabled="true" color="#0081ff" <text>{{item.cumulativeEngineeringQuantity}}</text>
inputAlign="right" type="number" :border="border" placeholder="请输入工程量" /> </view>
</view> </view>
</view> -->
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title"> <view class="title">
<text>单位:</text> <text>单位:</text>
...@@ -285,7 +284,7 @@ ...@@ -285,7 +284,7 @@
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title"> <view class="title">
<text class="text-xl text-red">*</text> <text class="text-xl text-red">*</text>
<text></text> <text></text>
</view> </view>
<view class="text-blue"> <view class="text-blue">
<text>{{item.totalPrice || 0 }}</text> <text>{{item.totalPrice || 0 }}</text>
...@@ -346,15 +345,6 @@ ...@@ -346,15 +345,6 @@
contractDate: moment().format("YYYY-MM-DD") contractDate: moment().format("YYYY-MM-DD")
}, },
formList: [], formList: [],
settlementCategoryList: [{
value: 1,
label: '过程结算'
},
{
value: 1,
label: '最终结算'
}
],
settlementCategoryIndex: -1, settlementCategoryIndex: -1,
priceTaxSeparationList:[], priceTaxSeparationList:[],
priceTaxSeparationIndex:-1, priceTaxSeparationIndex:-1,
......
...@@ -173,3 +173,12 @@ export function getDictItem(dicts, dictType) { ...@@ -173,3 +173,12 @@ export function getDictItem(dicts, dictType) {
} }
return obj return obj
} }
// 将14位数的时间字符串转化为时间格式
export function formatForLen14 (dateStr) {
if(dateStr && dateStr.length===14){
let strList = dateStr.split('');
dateStr = `${strList[0]}${strList[1]}${strList[2]}${strList[3]}/${strList[4]}${strList[5]}/${strList[6]}${strList[7]} ${strList[8]}${strList[9]}:${strList[10]}${strList[11]}:${strList[12]}${strList[13]}`
}
return dateStr
}
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