Commit a8ea6fea by zhangzhen

功能优化

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