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,11 +373,21 @@ ...@@ -371,11 +373,21 @@
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({ uni.showToast({
icon: "success", icon: "success",
title: "新增成功" title: "新增成功"
...@@ -384,18 +396,13 @@ ...@@ -384,18 +396,13 @@
this.onBack(); this.onBack();
}, 1500) }, 1500)
} }
}
}) })
}, },
onSubSave(i=0){ onSubSave(i=0){
saveSubList({ if(i >= this.formList.length){
...this.formList[i],
receiveId:this.id,
receiveType:0,
whCode:this.orderInfo.whCode,
companyCode:this.orderInfo.companyCode
}).then(res =>{
uni.hideLoading(); uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({ uni.showToast({
icon:"success", icon:"success",
title:"提交成功" title:"提交成功"
...@@ -403,6 +410,16 @@ ...@@ -403,6 +410,16 @@
setTimeout(()=>{ setTimeout(()=>{
this.onBack(); this.onBack();
},1500) },1500)
return;
}
saveSubList({
...this.formList[i],
receiveType:0,
whCode:this.orderInfo.whCode,
companyCode:this.orderInfo.companyCode
}).then(res =>{
if (res.data.__sys__.status === 0) {
this.onSubSave(++i);
} }
}) })
}, },
......
...@@ -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,10 +143,6 @@ ...@@ -143,10 +143,6 @@
</template> </template>
<script> <script>
import {
pathToBase64,
base64ToPath
} from '@/utils/index.js'
import {uploadFile2} from "@/api/index.js"; import {uploadFile2} from "@/api/index.js";
import { import {
toJsonData toJsonData
...@@ -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({
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<text>项目名称:</text> <text>项目名称:</text>
</view> </view>
<view class="text-blue" @tap="onNavToSelect"> <view class="text-blue" @tap="onNavToSelect">
<text>{{orderInfo.projName|| "请选择项目"}}</text> <text>{{orderInfo.projName|| "请选择项目合同"}}</text>
<text class="cuIcon-list"></text> <text class="cuIcon-list"></text>
</view> </view>
</view> </view>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<view class="title"> <view class="title">
<text>项目编号:</text> <text>项目编号:</text>
</view> </view>
<view class="text-blue" > <view class="text-blue">
<text>{{orderInfo.projCode}}</text> <text>{{orderInfo.projCode}}</text>
</view> </view>
</view> </view>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<view class="title"> <view class="title">
<text>合同名称:</text> <text>合同名称:</text>
</view> </view>
<view class="text-blue" > <view class="text-blue">
<text>{{orderInfo.contractName}}</text> <text>{{orderInfo.contractName}}</text>
</view> </view>
</view> </view>
...@@ -51,13 +51,13 @@ ...@@ -51,13 +51,13 @@
<view class="title"> <view class="title">
<text>合同编号:</text> <text>合同编号:</text>
</view> </view>
<view class="text-blue" > <view class="text-blue">
<text>{{orderInfo.contractNumber}}</text> <text>{{orderInfo.contractNumber}}</text>
</view> </view>
</view> </view>
<!-- <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>
...@@ -67,37 +67,37 @@ ...@@ -67,37 +67,37 @@
</view> </view>
</view> --> </view> -->
<view v-if="orderInfo.thisSettlementAmount" class="cu-form-group"> <view class="cu-form-group">
<view class="title"> <view class="title">
<text>结算金额:</text> <text>结算金额:</text>
</view> </view>
<view class="text-blue" > <view class="text-blue">
<text>{{orderInfo.thisSettlementAmount}}</text> <text>{{orderInfo.thisSettlementAmount || 0}}</text>
</view> </view>
</view> </view>
<view v-if="orderInfo.thisPriceTax" class="cu-form-group"> <view class="cu-form-group">
<view class="title"> <view class="title">
<text>含税金额:</text> <text>含税金额:</text>
</view> </view>
<view class="text-blue" > <view class="text-blue">
<text>{{orderInfo.thisPriceTax}}</text> <text>{{orderInfo.thisPriceTax || 0}}</text>
</view> </view>
</view> </view>
<view v-if="orderInfo.thisSettlementTax" class="cu-form-group"> <view class="cu-form-group">
<view class="title"> <view class="title">
<text>结算税额:</text> <text>结算税额:</text>
</view> </view>
<view class="text-blue" > <view class="text-blue">
<text>{{orderInfo.thisSettlementTax}}</text> <text>{{orderInfo.thisSettlementTax || 0}}</text>
</view> </view>
</view> </view>
<view v-if="orderInfo.totalContractPrice" class="cu-form-group"> <view class="cu-form-group">
<view class="title"> <view class="title">
<text>合同金额:</text> <text>合同金额:</text>
</view> </view>
<view class="text-blue" > <view class="text-blue">
<text>{{orderInfo.totalContractPrice}}</text> <text>{{orderInfo.totalContractPrice || 0}}</text>
</view> </view>
</view> </view>
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
<view class="title"> <view class="title">
<text>累计结算金额:</text> <text>累计结算金额:</text>
</view> </view>
<view class="text-blue" > <view class="text-blue">
<text>{{orderInfo.cumulativeSettlementAmount}}</text> <text>{{orderInfo.cumulativeSettlementAmount}}</text>
</view> </view>
</view> </view>
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
<view class="title"> <view class="title">
<text>累计结算税额:</text> <text>累计结算税额:</text>
</view> </view>
<view class="text-blue" > <view class="text-blue">
<text>{{orderInfo.cumulativeSettlementTax}}</text> <text>{{orderInfo.cumulativeSettlementTax}}</text>
</view> </view>
</view> </view>
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
<view class="title"> <view class="title">
<text>累计结算含税金额:</text> <text>累计结算含税金额:</text>
</view> </view>
<view class="text-blue" > <view class="text-blue">
<text>{{orderInfo.cumulativePriceTax}}</text> <text>{{orderInfo.cumulativePriceTax}}</text>
</view> </view>
</view> </view>
...@@ -134,11 +134,45 @@ ...@@ -134,11 +134,45 @@
<text>结算类别:</text> <text>结算类别:</text>
</view> </view>
<view class="text-blue"> <view class="text-blue">
<picker @change="onTypeChange" :value="settlementCategoryIndex" :range="settlementCategoryList" <picker @change="onTypeChange" :value="settlementTypeIndex"
range-key="label"> :range="settlementTypeList" range-key="label">
<view class="uni-input">
<text
class="text-blue">{{ settlementTypeIndex >=0 ? settlementTypeList[settlementTypeIndex].label:'请选择'}}</text>
<text class="cuIcon-right"></text>
</view>
</picker>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>税点:</text>
</view>
<view class="text-blue">
<picker @change="onTaxChange" :value="taxPointsIndex"
:range="taxPointsList" range-key="label">
<view class="uni-input"> <view class="uni-input">
<text <text
class="text-blue">{{ settlementCategoryIndex >=0 ? settlementCategoryList[settlementCategoryIndex].label:'请选择'}}</text> class="text-blue">{{ taxPointsIndex >=0 ? taxPointsList[taxPointsIndex].label:'请选择'}}</text>
<text class="cuIcon-right"></text>
</view>
</picker>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>价税分离:</text>
</view>
<view class="text-blue">
<picker @change="onPriceTaxChange" :value="priceTaxSeparationIndex"
:range="priceTaxSeparationList" range-key="label">
<view class="uni-input">
<text
class="text-blue">{{ priceTaxSeparationIndex >=0 ? priceTaxSeparationList[priceTaxSeparationIndex].label:'请选择'}}</text>
<text class="cuIcon-right"></text> <text class="cuIcon-right"></text>
</view> </view>
</picker> </picker>
...@@ -164,9 +198,11 @@ ...@@ -164,9 +198,11 @@
<text class="text-lg text-bold text-black">合同清单</text> <text class="text-lg text-bold text-black">合同清单</text>
<view v-if="orderInfo.projCode" class="flex-row"> <view v-if="orderInfo.projCode" class="flex-row">
<button class="cu-btn bg-green sm">选择合同</button> <button class="cu-btn bg-green sm" @tap="onNavToSelectList(1)">选择合同</button>
<button v-if="['1','2'].includes(orderInfo.contractType)" class="cu-btn bg-green sm">选择签证单</button> <button v-if="['1','2'].includes(orderInfo.contractType)" class="cu-btn bg-green sm"
<button v-if="orderInfo.contractType == '2'" class="cu-btn bg-green sm">选择扣款单</button> @tap="onNavToSelectList(3)">选择签证单</button>
<button v-if="orderInfo.contractType == '2'" class="cu-btn bg-green sm"
@tap="onNavToSelectList(2)">选择扣款单</button>
</view> </view>
</view> </view>
<view class="form-content-box "> <view class="form-content-box ">
...@@ -177,7 +213,8 @@ ...@@ -177,7 +213,8 @@
<text>结算依据:</text> <text>结算依据:</text>
</view> </view>
<view class=""> <view class="">
<u-input v-model="item.settlementBasis" color="#0081ff" inputAlign="right" type="text" :border="border" placeholder="请输入结算依据" /> <u-input v-model="item.settlementBasis" color="#0081ff" inputAlign="right" type="text"
:border="border" placeholder="请输入结算依据" />
</view> </view>
</view> </view>
...@@ -186,7 +223,8 @@ ...@@ -186,7 +223,8 @@
<text>任务名称:</text> <text>任务名称:</text>
</view> </view>
<view class=""> <view class="">
<u-input v-model="item.taskName" color="#0081ff" inputAlign="right" type="text" :border="border" placeholder="请输入任务名称" /> <u-input v-model="item.taskName" color="#0081ff" inputAlign="right" type="text"
:border="border" placeholder="请输入任务名称" />
</view> </view>
</view> </view>
...@@ -195,16 +233,20 @@ ...@@ -195,16 +233,20 @@
<text>工程内容:</text> <text>工程内容:</text>
</view> </view>
<view class=""> <view class="">
<u-input v-model="item.engineeringContent" color="#0081ff" inputAlign="right" type="text" :border="border" placeholder="请输入工程内容" /> <u-input v-model="item.engineeringContent" color="#0081ff" inputAlign="right"
type="text" :border="border" placeholder="请输入工程内容" />
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title"> <view class="title">
<text class="text-xl text-red">*</text>
<text>结算工程量:</text> <text>结算工程量:</text>
</view> </view>
<view class=""> <view class="">
<u-input v-model="item.thisEngineeringQuantity" @change="onPriceChange($event,k)" color="#0081ff" inputAlign="right" type="number" :border="border" placeholder="请输入工程量" /> <u-input v-model="item.thisEngineeringQuantity" @change="onPriceChange($event,k)"
color="#0081ff" inputAlign="right" type="number" :border="border"
placeholder="请输入工程量" />
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
...@@ -212,7 +254,8 @@ ...@@ -212,7 +254,8 @@
<text>累计结算工程量:</text> <text>累计结算工程量:</text>
</view> </view>
<view class=""> <view class="">
<u-input v-model="item.cumulativeEngineeringQuantity" :disabled="true" color="#0081ff" inputAlign="right" type="number" :border="border" placeholder="请输入工程量" /> <u-input v-model="item.cumulativeEngineeringQuantity" :disabled="true" color="#0081ff"
inputAlign="right" type="number" :border="border" placeholder="请输入工程量" />
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
...@@ -220,7 +263,8 @@ ...@@ -220,7 +263,8 @@
<text>单位:</text> <text>单位:</text>
</view> </view>
<view class=""> <view class="">
<u-input v-model="item.unit" color="#0081ff" inputAlign="right" type="text" :border="border" placeholder="请输入单位" /> <u-input v-model="item.unit" color="#0081ff" inputAlign="right" type="text"
:border="border" placeholder="请输入单位" />
</view> </view>
</view> </view>
...@@ -230,7 +274,9 @@ ...@@ -230,7 +274,9 @@
<text>单价:</text> <text>单价:</text>
</view> </view>
<view class="text-blue"> <view class="text-blue">
<u-input v-model="item.unitPrice" color="#0081ff" inputAlign="right" @change="onPriceChange2($event,k)" type="number" :border="border" placeholder="请输入单价" /> <u-input v-model="item.unitPrice" color="#0081ff" inputAlign="right"
@change="onPriceChange2($event,k)" type="number" :border="border"
placeholder="请输入单价" />
</view> </view>
</view> </view>
...@@ -250,14 +296,15 @@ ...@@ -250,14 +296,15 @@
<text>备注:</text> <text>备注:</text>
</view> </view>
<view class="text-blue"> <view class="text-blue">
<u-input v-model="item.remarks" color="#0081ff" inputAlign="right" type="text" :border="border" placeholder="请输入备注" /> <u-input v-model="item.remarks" color="#0081ff" inputAlign="right" type="text"
:border="border" placeholder="请输入备注" />
</view> </view>
</view> </view>
</form> </form>
</view> </view>
</view> </view>
<view class="" style="margin-bottom: 140upx;"> <view v-if="orderInfo.contractType != 2" class="" style="margin-bottom: 140upx;">
<button class="cu-btn bg-gradual-green" @tap="onAddSub"> <button class="cu-btn bg-gradual-green" @tap="onAddSub">
<text class="cuIcon-add"></text> <text class="cuIcon-add"></text>
<text>新增明细</text> <text>新增明细</text>
...@@ -280,6 +327,7 @@ ...@@ -280,6 +327,7 @@
toJsonData toJsonData
} from "@/utils/tools.js"; } from "@/utils/tools.js";
import moment from "@/common/moment.js"; import moment from "@/common/moment.js";
import {getDict} from "@/api/index.js"
import { import {
save save
} from "@/api/settlement-doc.js"; } from "@/api/settlement-doc.js";
...@@ -291,75 +339,168 @@ ...@@ -291,75 +339,168 @@
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,
orderInfo: { orderInfo: {
reviewStatus:'3', reviewStatus: '3',
contractDate: moment().format("YYYY-MM-DD") contractDate: moment().format("YYYY-MM-DD")
}, },
formList:[], formList: [],
settlementCategoryList:[ settlementCategoryList: [{
{ value: 1,
value:1,
label: '过程结算' label: '过程结算'
}, },
{ {
value:1, value: 1,
label: '最终结算' label: '最终结算'
} }
], ],
settlementCategoryIndex:-1 settlementCategoryIndex: -1,
priceTaxSeparationList:[],
priceTaxSeparationIndex:-1,
taxPointsList:[],
taxPointsIndex:-1,
settlementTypeList:[],
settlementTypeIndex:-1
}; };
}, },
onLoad() {
this.onLoading();
},
methods: { methods: {
onTypeChange(e){ onLoading() {
// hggp.cw.priceTaxSeparation 价税分离
// hggp.cw.taxPoints 税点
// hggp.cw.settlementType 结算类别
getDict({
codeset: 'hggp.cw.priceTaxSeparation'
}).then(res => {
if (res.data.list && res.data.list.length) {
this.priceTaxSeparationList = res.data.list
}
})
getDict({
codeset: 'hggp.cw.taxPoints'
}).then(res => {
if (res.data.list && res.data.list.length) {
this.taxPointsList = res.data.list
}
})
getDict({
codeset: 'hggp.cw.settlementType'
}).then(res => {
if (res.data.list && res.data.list.length) {
this.settlementTypeList = res.data.list
}
})
},
onNavToSelectList(val) {
console.log(val)
uni.navigateTo({
url: `/pages/settlement-doc/select-list?selectIndex=${val}&contractNumber=${this.orderInfo.contractNumber}&contractType=${this.orderInfo.contractType}`,
events: {
acceptDataFromOpenedPage2: (data) => {
console.log(data)
this.formList.push(data);
this.$forceUpdate();
}
}
})
},
onCalculatePrice(){
let num = 0
console.log(this.formList,"this.formList")
if(this.formList && this.formList.length){
this.formList.forEach(item=>{
if(item.totalPrice){
num +=item.totalPrice
}
})
this.orderInfo.thisSettlementAmount = num;
console.log(this.orderInfo.thisSettlementAmount)
this.$forceUpdate();
}
},
onTypeChange(e) {
let index = Number(e.target.value);
if (this.settlementTypeIndex === index) return
this.settlementTypeIndex = index;
},
onTaxChange(e) {
let index = Number(e.target.value);
if (this.taxPointsIndex === index) return
this.taxPointsIndex = index;
},
onPriceTaxChange(e) {
let index = Number(e.target.value); let index = Number(e.target.value);
if (this.settlementCategoryIndex === index) return if (this.priceTaxSeparationIndex === index) return
this.settlementCategoryIndex = index; this.priceTaxSeparationIndex = index;
}, },
onPriceChange(e,i){ onPriceChange(e, i) {
console.log(e,i,"1") this.formList[i].totalPrice =Number(this.formList[i].unitPrice)*e;
this.$forceUpdate();
this.onCalculatePrice()
}, },
onPriceChange2(e,i){ onPriceChange2(e, i) {
console.log(e,i,'2') this.formList[i].totalPrice =Number(this.formList[i].thisEngineeringQuantity)*e;
this.$forceUpdate();
this.onCalculatePrice()
}, },
onAddSub(){ onAddSub() {
if(!this.orderInfo.projCode){ if (!this.orderInfo.projCode) {
uni.showToast({ uni.showToast({
icon:"none", icon: "none",
title:"请先选择项目合同" title: "请先选择项目合同"
}) })
return return
} }
this.formList.push({ this.formList.push({
settlementBasis: '',//结算依据 settlementBasis: '扣款单', //结算依据
taskName:'', //任务名称 taskName: '', //任务名称
engineeringContent:'',//工程内容 engineeringContent: '', //工程内容
thisEngineeringQuantity:'',//工程结算量 thisEngineeringQuantity: '', //工程结算量
cumulativeEngineeringQuantity:'',//至本次累计结算工程量 cumulativeEngineeringQuantity: '', //至本次累计结算工程量
unit:'',//单位 unit: '', //单位
unitPrice:'',//单价 unitPrice: '', //单价
totalPrice:"" //合计 totalPrice: "", //合计
selectIndex:2
}) })
}, },
onNavToSelect(){ onNavToSelect() {
let that = this; let that = this;
uni.navigateTo({ uni.navigateTo({
url:"/pages/settlement-doc/index", url: "/pages/settlement-doc/index",
events:{ events: {
acceptDataFromOpenedPage: (data) => { acceptDataFromOpenedPage: (data) => {
console.log(data) console.log(data)
that.orderInfo = { that.orderInfo = {
...that.orderInfo, ...that.orderInfo,
...data ...data
} }
console.log(that.orderInfo,9999) console.log(that.orderInfo, 9999)
that.$forceUpdate(); that.$forceUpdate();
} }
} }
}) })
}, },
onSubmit() { onSubmit() {
if (!this.orderInfo.projCode) {
uni.showToast({
icon: "none",
title: "请先选择项目合同"
})
return
}
if (!this.formList.length) {
uni.showToast({
icon: "none",
title: "请先添加明细"
})
return
}
this.show = true this.show = true
}, },
onOpenCalendar() { onOpenCalendar() {
...@@ -375,34 +516,13 @@ ...@@ -375,34 +516,13 @@
}, },
onSave() { onSave() {
this.show = false; this.show = false;
if (!this.orderInfo.projCode) {
uni.showToast({
icon: "none",
title: "请选择项目"
})
return
}
if (!this.orderInfo.contractContent) {
uni.showToast({
icon: "none",
title: "请输入扣款事由"
})
return
}
if (!this.orderInfo.totalContractPriceIncluding) {
uni.showToast({
icon: "none",
title: "请输入扣款金额"
})
return
}
uni.showLoading({ uni.showLoading({
title: "加载中..." title: "加载中..."
}) })
save({ save({
...this.orderInfo, ...this.orderInfo,
contractDate: moment(this.orderInfo.contractDate).format("YYYYMMDD") contractDate: moment(this.orderInfo.contractDate).format("YYYYMMDD")
}).then(res => { },this.formList).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.data.__sys__.status === 0) { if (res.data.__sys__.status === 0) {
uni.showToast({ uni.showToast({
...@@ -761,16 +881,18 @@ ...@@ -761,16 +881,18 @@
} }
.content-part-2 { .content-part-2 {
.header{ .header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.flex-row{
.cu-btn{ .flex-row {
.cu-btn {
margin: 0 6upx; margin: 0 6upx;
} }
} }
} }
.form-content-box { .form-content-box {
display: flex; display: flex;
background-color: transparent; background-color: transparent;
......
...@@ -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}`
}) })
} }
} }
......
<template>
<view>
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
<text class="cuIcon-back text-white text-bold text-xl"></text>
</view>
</block>
<block slot="content">
<text class="text-white">选择{{selectTypeEnum[selectIndex]}}</text>
</block>
<block slot="right">
<text class="text-green 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'}">
</view>
<view class="flex-col data-content" >
<view class="flex-col part-3">
<view v-for="(item,k) in projectDataList" :key="k" class="content-item" @tap="onSelect(k)">
<view v-if="selectIndex==3" class="flex-col content-box" :class="k === current?'active':''">
<view class="flex-row">
<text class="text-gray part-1">甲方名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title ellipsis">{{item.partyA}}</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">{{item.contractName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">主合同号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.contractNumber}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">项目编号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.projCode}}</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">{{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 v-else-if="selectIndex==2" class="flex-col content-box" :class="k === current?'active':''">
<view class="flex-row">
<text class="text-gray part-1">甲方名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title ellipsis">{{item.partyA}}</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">{{item.contractName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">主合同号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.contractNumber}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">项目编号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.projCode}}</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">{{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">{{item.contractContent}}</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 v-else-if="selectIndex==1" class="flex-col content-box" :class="k === current?'active':''">
<view class="flex-row">
<text class="text-gray part-1">公司名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title ellipsis">{{item.companyName}}</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">{{item.inventory}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">合同号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.contractNumber}}</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">{{item.provisionalQuantity}}</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.unitPriceExcludingTax)}}</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.totalPriceExcluding)}}</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.totalPriceIncluding)}}</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.laborCosts)}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {toJsonData} from "@/utils/tools.js";
import { getList1,getList2,getList3,getList4,getList5 } from "@/api/settlement-doc.js";
import {getDict} from "@/api/index.js"
export default {
data() {
return {
projectDataList:[],
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
queryData: {
contractNumber:''
},
pageData:{
showCount: "true",
limit:1000,
offset:0
},
current:0,
eventChannel: null,
contractType:1,
contractTypeEnum:{},
selectIndex:1,
selectTypeEnum:{
1:"合同清单",
2:"扣款单",
3:"签证单"
}
};
},
onLoad(option) {
if(option && option.selectIndex){
this.selectIndex = option.selectIndex
}
if(option && option.contractNumber){
this.queryData.contractNumber = option.contractNumber
}
if(option && option.contractType){
this.contractType = option.contractType
}
this.eventChannel = this.getOpenerEventChannel();
this.onLoading();
},
methods: {
onCheck(){
this.eventChannel.emit('acceptDataFromOpenedPage2', {
settlementBasis:this.selectTypeEnum[this.selectIndex],
taskName:'',
engineeringContent:"",
thisEngineeringQuantity: this.projectDataList[this.current].provisionalQuantity || 1,
cumulativeEngineeringQuantity:'',
unit:"",
unitPrice: this.projectDataList[this.current].unitPriceExcludingTax || this.projectDataList[this.current].totalContractPriceIncluding ||this.projectDataList[this.current].totalContractPriceIncluding,
totalPrice:"",
selectIndex: this.selectIndex
} );
this.onBack();
},
onSelect(k){
this.current = k;
},
onBack(){
uni.navigateBack();
},
onLoading() {
getDict({
codeset:'hggp.cw.contractType'
}).then(res=>{
if(res.data.list && res.data.list.length){
res.data.list.forEach(item=>{
this.contractTypeEnum[item.value] = item.label
})
}
if(this.selectIndex ==1){
if(this.contractType ==2){
this.onGetList4()
}else{
this.onGetList();
}
}else if(this.selectIndex ==2){
this.onGetList2();
}else if(this.selectIndex ==3){
if(this.contractType ==2){
this.onGetList5();
}else{
this.onGetList3();
}
}
})
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getList1({
...this.queryData
},this.pageData).then(res => {
uni.hideLoading();
this.projectDataList= toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns);
console.log(this.projectDataList)
})
},
onGetList2() {
uni.showLoading({
title: "加载中"
})
getList2({
...this.queryData
},this.pageData).then(res => {
uni.hideLoading();
this.projectDataList = toJsonData(res.data.__blocks__.result2.rows,res.data.__blocks__.result2.meta.columns)
})
},
onGetList3() {
uni.showLoading({
title: "加载中"
})
getList3({
...this.queryData
},this.pageData).then(res => {
uni.hideLoading();
this.projectDataList = toJsonData(res.data.__blocks__.result3.rows,res.data.__blocks__.result3.meta.columns)
})
},
onGetList4() {
uni.showLoading({
title: "加载中"
})
getList4({
...this.queryData
},this.pageData).then(res => {
uni.hideLoading();
this.projectDataList = toJsonData(res.data.__blocks__.result1.rows,res.data.__blocks__.result1.meta.columns)
})
},
onGetList5() {
uni.showLoading({
title: "加载中"
})
getList5({
...this.queryData
},this.pageData).then(res => {
uni.hideLoading();
this.projectDataList = toJsonData(res.data.__blocks__.result3.rows,res.data.__blocks__.result3.meta.columns)
})
}
}
}
</script>
<style>
page {
background-color: #ffffff;
}
</style>
<style lang="scss" scoped>
.page-content-box{
width: 100vw;
height: 100vh;
overflow: hidden;
}
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 96%;
align-items: center;
margin: 30upx auto 12upx;
.flex-between {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border-radius: 20upx;
padding: 16upx 20upx;
background-color: rgba(246, 246, 248, 1);
.image {
width: 34upx;
margin-right: 8upx;
max-height: 42upx;
}
.text-blue {
color: #4a93f8;
font-weight: bold;
}
}
}
.u-tabs-box {
width: 100%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 30upx auto;
width: 96%;
.circle-par {
display: flex;
justify-content: center;
align-items: center;
}
.header {
border-radius: 12upx 12upx 0 0;
background-color: #eef2fe;
color: #101010;
font-size: 30upx;
border: 1px solid #d1dcfd;
padding: 14upx 24upx;
}
.content {
border-radius: 0 0 12upx 12upx;
background-color: #ffffff;
color: #101010;
font-size: 30upx;
border: 1px solid #cecece;
border-top: none;
}
}
.flex-content {
display: flex;
width: 100%;
justify-content: center;
}
.part-3 {
flex-direction: column;
padding-bottom: 40upx;
.content-item {
display: flex;
flex-direction: column;
width: 94%;
margin: 24upx auto 8upx;
padding-bottom: 24upx;
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
.content-box {
position: relative;
z-index: 2;
box-shadow: 0 0 12upx rgba(0, 0, 0, 0.34);
border-radius: 12upx;
margin-top: -20upx;
background-color: #ffffff;
padding: 24upx;
.flex-row{
margin: 6upx 0;
.part-1{
width: 180upx;
text-align-last: justify;
}
.part-2{
margin-right: 24upx;
}
}
}
.active{
box-shadow: 0 0 12upx #4a93f8;
}
}
.content-item:last-child {
border-bottom: none;
}
}
.flex-center {
display: flex;
align-items: center;
}
.line-progress {
align-items: center;
}
.u-page__item__slot-icon {
width: 24px;
height: 24px;
}
.part-left {
align-items: center;
}
.circle-center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.margin-top-sm {
margin-top: 10upx;
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.icon {
width: 36upx;
max-height: 50upx;
margin-right: 6upx;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.content-part-1 {
display: flex;
flex-direction: column;
align-items: center;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 92%;
padding: 30upx 0;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.form-content-box {
width: 92%;
padding: 12upx 0;
border-radius: 12upx;
box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
.title {
display: flex;
flex-direction: row;
width: 240upx;
align-items: center;
}
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.float-box{
position: fixed;
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
border-radius: 25px;
background-color: #4a93f8;
color: #ffffff;
box-shadow: 0 0 16upx rgba(74, 147, 248, 0.34),0 0 12upx rgba(74, 147, 248, 0.34) inset;
z-index: 99;
font-size: 32upx;
}
.factory-name{
max-width: 360upx;
.factory-title{
// width: 360upx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.ellipsis{
max-width: 420upx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
\ No newline at end of file
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