Commit 140c2825 by zhangzhen

功能完善

parent f6ccb28e
......@@ -88,7 +88,7 @@ const setResultData = (data={}) => {
return paramsData
}
const setResultDataAndDetail = (data={},detail=[]) => {
const setResultDataAndDetail = (data={},detail={}) => {
let obj = {}
for (let i in data) {
if (data[i] !== '') {
......@@ -140,6 +140,53 @@ const setResultDataAndDetail = (data={},detail=[]) => {
return paramsData
}
const setResultDataAndParams = (list=[],params={}) => {
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"inqu_status":{
"attr": {},
"meta": {
"columns": []
},
"rows": []
},
"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));
})
if( params ){
let keyList2 = Object.keys(params);
keyList2.forEach((item, index) => {
paramsData.__blocks__.inqu_status.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.inqu_status.rows.push(Object.values(params));
}
return paramsData
}
export const getList = (params,pageData) => {
let url = `/service/S_CW_FK_01`
let d = setParamsData(params,pageData)
......@@ -153,6 +200,12 @@ export const getSelectList = (params,pageData) => {
}
export const getSubList = (params,pageData) => {
let url = `/service/S_CW_FK_05`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const save = (data) => {
let url = `/service/S_CW_FK_03`
let d = setResultData(data);
......@@ -166,38 +219,14 @@ export const updateSubmitStatus = (data) => {
}
export const getProList = (params,pageData) => {
let url = `/service/S_CW_HT_01`
let url = `/service/S_CW_SP_03`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
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)
export const saveBySelect = (list,params) => {
let url = `/service/S_CW_SP_04`
let d = setResultDataAndParams(list,params);
return http.post(url, d)
}
......
......@@ -164,32 +164,30 @@ export const getProList = (params,pageData) => {
return http.post(url, d)
}
export const getList3 = (params,pageData) => {
export const getList1 = (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`
export const getList3 = (params,pageData) => {
let url = `/service/S_CW_QZ_03`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList2 = (params,pageData) => {
let url = `/service/S_CW_QZ_03`
export const getList11 = (params,pageData) => {
let url = `/service/S_CW_QZ_11`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList4 = (params,pageData) => {
let url = `/service/S_CW_QZ_04`
export const getList12 = (params,pageData) => {
let url = `/service/S_CW_QZ_12`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const getList5 = (params,pageData) => {
let url = `/service/S_CW_QZ_05`
export const getList13 = (params,pageData) => {
let url = `/service/S_CW_QZ_13`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
......
......@@ -642,6 +642,17 @@
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/payment-order/edit",
"style" :
{
"navigationBarTitleText" : "付款单详情",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
}
],
"globalStyle": {
......
......@@ -131,7 +131,7 @@
</view>
</view>
<view v-if="!orderInfo.id || orderInfo.status != 2" class="footer-box">
<view v-if="!orderInfo.id || orderInfo.status != 1" class="footer-box">
<button class="cu-btn block bg-blue" @tap="onSubmit(1)">提 交</button>
<button v-if="orderInfo.id" class="cu-btn block bg-red" @tap="onSubmit(2)">删 除</button>
</view>
......@@ -363,8 +363,7 @@
})
this.orderInfo = list[0];
if (this.orderInfo.id) {
this.factoryIndex = this.factoryList.findIndex(item => item.value === this.orderInfo
.companyCode);
this.factoryIndex = this.factoryList.findIndex(item => item.value === this.orderInfo.companyCode);
this.onGetDeviceList();
}
}
......
......@@ -144,7 +144,12 @@
//不良品类
form: {},
factoryIndex:0,
factoryList:[],
factoryList:[
{
label:"全部",
value:''
}
],
floatTop:"",
floatLeft: "",
floatBoxStatus: false,
......@@ -217,13 +222,14 @@
},
onLoading() {
getParamsList().then(res=>{
this.factoryList = res.data.map(item=>{
let list = res.data.map(item=>{
this.factoryEnum[item.companyCode] = item.companyName
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list]
this.$forceUpdate();
this.onGetList();
})
......
......@@ -277,7 +277,12 @@
//不良品类
form: {},
index: 0,
factoryList: [],
factoryList: [
{
label: '全部',
value: ''
}
],
innerHeight: window.innerHeight,
innerWidth: window.innerWidth,
startTimeStamp: 0,
......@@ -340,12 +345,13 @@
},
onLoading() {
getParamsList().then(res => {
this.factoryList = res.data.map(item => {
let list = res.data.map(item => {
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list];
this.pageData.offset = 0;
this.projectDataList = [];
this.subList = []
......
......@@ -206,8 +206,7 @@
title: "加载中..."
})
save({
...this.orderInfo,
signingDate: moment(this.orderInfo.signingDate).format("YYYYMMDD")
...this.orderInfo
}).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
......
......@@ -99,17 +99,11 @@
<view class="cu-form-group">
<view class="title">
<text v-if="orderInfo.reviewStatus !=3" class="text-xl text-red">*</text>
<text>扣款日期:</text>
</view>
<view v-if="orderInfo.reviewStatus ==3" class="">
<text>{{orderInfo.totalContractPriceIncluding}}</text>
</view>
<view v-else class="text-blue" @tap="onOpenCalendar">
<text>{{orderInfo.signingDate||"请选择日期"}}</text>
<text class="cuIcon-right"></text>
<view class="">
<text>{{orderInfo.signingDate}}</text>
</view>
</view>
<view class="cu-form-group">
......@@ -197,8 +191,7 @@
})
updateSubmitStatus({
...this.orderInfo,
reviewStatus:3,
signingDate: moment(this.orderInfo.signingDate).format("YYYYMMDD")
reviewStatus:3
}).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
......
......@@ -96,9 +96,13 @@
<text class="text-gray part-2">:</text>
<text class="text-title">{{submitStatusEnum[item.reviewStatus]}}</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.createdTime}}</text>
</view>
</view>
</view>
<view v-if="projectDataList.length" style="padding: 12px 6% 0;">
......@@ -223,7 +227,13 @@
},this.pageData).then(res => {
uni.hideLoading();
let list = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns)
let list = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns).map(item => {
let createdTime =item.createdTime? item.createdTime.split(''):[];
return {
...item,
createdTime:createdTime.length>=13? `${createdTime[0]}${createdTime[1]}${createdTime[2]}${createdTime[3]}/${createdTime[4]}${createdTime[5]}/${createdTime[6]}${createdTime[7]} ${createdTime[8]}${createdTime[9]}:${createdTime[10]}${createdTime[11]}:${createdTime[12]}${createdTime[13]}` :''
}
})
if (this.pageData.offset == 0) {
this.projectDataList = list
} else {
......
......@@ -150,7 +150,12 @@
//不良品类
form: {},
factoryIndex:0,
factoryList:[],
factoryList:[
{
label:"全部",
value:''
}
],
floatTop:"",
floatLeft: "",
floatBoxStatus: false,
......@@ -245,13 +250,14 @@
})
})
getParamsList().then(res=>{
this.factoryList = res.data.map(item=>{
let list = res.data.map(item=>{
this.factoryEnum[item.companyCode] = item.companyName
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list]
this.$forceUpdate();
this.onGetUserByCompanyCode();
})
......
......@@ -188,7 +188,12 @@
//不良品类
form: {},
index:0,
factoryList:[],
factoryList:[
{
label: '全部',
value: ''
}
],
innerHeight: window.innerHeight,
innerWidth: window.innerWidth,
startTimeStamp:0,
......@@ -256,12 +261,13 @@
},
onLoading() {
getParamsList().then(res=>{
this.factoryList = res.data.map(item=>{
let list = res.data.map(item=>{
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list];
this.$forceUpdate();
this.ongetCount();
this.onGetList();
......
......@@ -7,7 +7,7 @@
</view>
</block>
<block slot="content">
<text class="text-white">新增结算</text>
<text class="text-white">新增付款</text>
</block>
<block slot="right">
<view class="margin-right" @tap="onNavToSelect">
......@@ -22,9 +22,146 @@
<view class="flex-col content-part-1">
<view class="flex-row header">
<image src="../../static/icon10.png" mode="widthFix"></image>
<text class="text-lg text-bold text-black">结算单</text>
<text class="text-lg text-bold text-black">{{selectList.length? '可结算清单': '清单详情'}}</text>
</view>
<view class="form-content-box">
<view v-if="selectList && selectList.length" class="form-content-box">
<form v-for="(item,k) in selectList" :key="k" class="form-box">
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>公司名称:</text>
</view>
<view class="text-blue">
<text>{{item.companyName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>供应商名称:</text>
</view>
<view class="text-blue">
<text>{{item.partyA}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>剩余付款金额:</text>
</view>
<view class="text-blue">
<text>{{Number(item.remainingAmount)}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>来源单号:</text>
</view>
<view class="text-blue">
<text>{{item.settlementNumber}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>票据类型:</text>
</view>
<view class="text-blue">
<text>{{item.billTybe}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>发票号:</text>
</view>
<view class="text-blue">
<text>{{item.billNumber}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>税率(%):</text>
</view>
<view class="text-blue">
<text>{{item.taxPoints}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>不含税金额:</text>
</view>
<view class="text-blue">
<text>{{item.thisSettlementAmount}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>税额:</text>
</view>
<view class="text-blue">
<text>{{item.thisSettlementTax}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>发票总额:</text>
</view>
<view class="text-blue">
<text>{{Number(item.totalContractPriceIncluding)}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>收票日期:</text>
</view>
<view class="text-blue">
<text>{{item.receiveDate}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>本次付款金额:</text>
</view>
<u-input v-model="item.thisAmount"
color="#0081ff" inputAlign="right" type="number" :border="border"
placeholder="请输入付款金额" />
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
<text>付款日期:</text>
</view>
<view class="text-blue" @tap="onOpenCalendar(k)">
<text>{{item.signingDate||"请选择日期"}}</text>
<text class="cuIcon-right"></text>
</view>
</view>
</form>
</view>
<view v-else class="form-content-box">
<form>
<view class="cu-form-group">
<view class="title">
......@@ -42,9 +179,6 @@
</picker>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text class="text-xl text-red">*</text>
......@@ -89,7 +223,8 @@
getDict
} from "@/api/index.js"
import {
save
save,
saveBySelect
} from "@/api/payment-order.js";
import {
getParamsList
......@@ -111,7 +246,9 @@
contractDate: moment().format("YYYY-MM-DD")
},
factoryList: [],
factoryIndex: -1
factoryIndex: -1,
selectList:[],
editIndex:''
};
},
onLoad() {
......@@ -135,11 +272,22 @@
this.factoryIndex = index;
},
onNavToSelect() {
let checkedId = '';
if(this.selectList.length){
checkedId = this.selectList.map(item => item.id).join();
}
uni.navigateTo({
url: `/pages/payment-order/index`,
url: `/pages/payment-order/index?checkedId=${checkedId}`,
events: {
acceptDataFromOpenedPage: (data) => {
this.selectList = data.data;
this.$forceUpdate();
}
}
})
},
onOpenCalendar(){
onOpenCalendar(val){
this.editIndex = val;
this.show2 = true;
},
onSubmit() {
......@@ -150,7 +298,12 @@
this.show2 = false;
},
onConfirm(e) {
this.orderInfo.signingDate = e[0];
if(this.selectList.length){
this.selectList[this.editIndex].signingDate = e[0];
}else{
this.orderInfo.signingDate = e[0];
}
this.onCancel();
},
onSave() {
......@@ -158,22 +311,49 @@
uni.showLoading({
title: "加载中..."
})
save({
...this.orderInfo,
companyName: this.factoryList[this.factoryIndex].label,
companyCode: this.factoryList[this.factoryIndex].value
}).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
icon: "success",
title: "新增成功"
})
setTimeout(() => {
this.onBack();
}, 1500)
}
})
if(this.selectList && this.selectList.length){
let list = this.selectList.map(item => {
return {
...item,
receiveDate: moment(this.orderInfo.receiveDate).format("YYYYMMDD")
}
})
saveBySelect(list,{
hiddenConditions:'1',
billState: '1',
mainId: this.selectList.length && this.selectList[0].mainId? this.selectList[0].mainId : ''
}).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
icon: "success",
title: "新增成功"
})
setTimeout(() => {
this.onBack();
}, 1500)
}
})
}else{
save({
...this.orderInfo,
companyName: this.factoryList[this.factoryIndex].label,
companyCode: this.factoryList[this.factoryIndex].value,
signingDate: moment(this.orderInfo.signingDate).format("YYYYMMDD")
}).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
icon: "success",
title: "新增成功"
})
setTimeout(() => {
this.onBack();
}, 1500)
}
})
}
},
onChange(e) {
let index = Number(e.target.value);
......@@ -402,12 +582,15 @@
display: flex;
flex-direction: column;
width: 100%;
padding: 12upx 0;
border-radius: 4upx;
margin-bottom: 120upx;
// box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.form-box{
margin: 0 0 40upx;
background-color: #ffffff;
}
.cu-form-group {
height: 32px;
......@@ -416,7 +599,7 @@
.title {
display: flex;
flex-direction: row;
width: 200upx;
width: 260upx;
align-items: center;
}
......
......@@ -23,14 +23,6 @@
<form>
<view class="cu-form-group">
<view class="title">
<text>项目名称:</text>
</view>
<view class="">
<text>{{orderInfo.projName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>公司名称:</text>
</view>
<view class="">
......@@ -39,15 +31,7 @@
</view>
<view class="cu-form-group">
<view class="title">
<text>主合同名称:</text>
</view>
<view class="">
<text>{{orderInfo.contractName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>主合同号:</text>
<text>来源单号:</text>
</view>
<view class="">
<text>{{orderInfo.contractNumber}}</text>
......@@ -55,71 +39,36 @@
</view>
<view class="cu-form-group">
<view class="title">
<text>项目编号:</text>
<text>付款单号:</text>
</view>
<view class="">
<text>{{orderInfo.projCode}}</text>
<text>{{orderInfo.incomeNumber}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>结算编号</text>
<text>付款总额</text>
</view>
<view class="">
<text>{{orderInfo.settlementNumber}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>结算类别:</text>
</view>
<view class="">
<text>{{settlementTypeEnum[orderInfo.settlementType]}}</text>
<text>{{Number(orderInfo.totalContractPriceIncluding) || 0}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>结算金额</text>
<text>付款日期</text>
</view>
<view class="">
<text>{{orderInfo.thisSettlementAmount}}</text>
<text>{{orderInfo.signingDate}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>结算税额</text>
<text>核销状态</text>
</view>
<view class="">
<text>{{orderInfo.thisSettlementTax}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>结算含税额:</text>
</view>
<view class="">
<text>{{orderInfo.thisPriceTax}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text v-if="orderInfo.reviewStatus !=3" class="text-xl text-red">*</text>
<text>结算日期:</text>
</view>
<view v-if="orderInfo.reviewStatus ==3" class="">
<text>{{orderInfo.contractDate}}</text>
</view>
<view v-else class="text-blue" @tap="onOpenCalendar">
<text>{{orderInfo.contractDate||"请选择日期"}}</text>
<text class="cuIcon-right"></text>
<text>{{cancelStatusEnum[orderInfo.cancelStatus]}}</text>
</view>
</view>
<view class="cu-form-group">
......@@ -127,13 +76,64 @@
<text>审批状态:</text>
</view>
<view class="">
<text>{{submitStatusEnum[orderInfo.reviewStatus]}}</text>
<text>{{reviewStatusEnum[orderInfo.reviewStatus]}}</text>
</view>
</view>
</form>
</view>
</view>
<view class="flex-col content-part-1 content-part-2">
<view class="flex-row header">
<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">
<form class="item-form">
<view class="cu-form-group">
<view class="title">
<text>公司名称:</text>
</view>
<view class="">
<text>{{item.companyName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>供应商名称:</text>
</view>
<view class="">
<text>{{item.partyA}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>来源单号:</text>
</view>
<view class="">
<text>{{item.contractNumber}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>收款总额:</text>
</view>
<view class="">
<text>{{item.totalContractPriceIncluding}}</text>
</view>
</view>
</form>
</view>
</view>
<view v-if="subList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
<view v-if="orderInfo.reviewStatus && orderInfo.reviewStatus!=3" class="footer-box">
<button class="cu-btn block bg-blue" @tap="onSubmit(1)">提交</button>
</view>
......@@ -145,6 +145,7 @@
</template>
<script>
import { getDict } from '@/api/index.js';
import {
toJsonData
} from "@/utils/tools.js";
......@@ -152,7 +153,7 @@
import {
getParamsData
} from "@/api/product-warehousing.js";
import { getList } from "@/api/settlement-doc.js";
import { getList,getSubList } from "@/api/payment-order.js";
export default {
data() {
......@@ -175,7 +176,10 @@
settlementTypeEnum:{
1:'部分结算',
2:'最终结算'
}
},
reviewStatusEnum:{},
cancelStatusEnum:{},
subList:[]
};
},
onLoad(option) {
......@@ -226,11 +230,34 @@
},
onBack() {
uni.redirectTo({
url:'/pages/settlement-doc/list'
url:'/pages/payment-order/list'
})
},
onLoading() {
this.onGetList();
getDict({
codeset:"hggp.cw.cancelStatus"
}).then(res=>{
if(res.data.list && res.data.list.length){
res.data.list.forEach(item=>{
this.cancelStatusEnum[item.value] = item.label;
})
}
})
getDict({
codeset:"hggp.cw.reviewStatus"
}).then(res=>{
if(res.data.list && res.data.list.length){
res.data.list.forEach(item=>{
this.reviewStatusEnum[item.value] = item.label;
})
}
this.onGetList();
})
},
onGetList() {
uni.showLoading({
......@@ -247,9 +274,26 @@
...list[0],
signingDate: moment(list[0].signingDate).format("YYYY-MM-DD")
}
this.onGetSubList()
}
})
},
onGetSubList() {
uni.showLoading({
title: "加载中"
})
getSubList({
mainId: this.id
}).then(res => {
uni.hideLoading()
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns);
if (list && list.length) {
this.subList = list
}
})
}
}
}
......@@ -578,9 +622,11 @@
.content-part-2 {
.form-content-box {
display: flex;
flex-direction: column;
align-items: center;
background-color: transparent;
justify-content: center;
margin-bottom: 100upx;
}
}
......@@ -590,7 +636,7 @@
border-radius: 12upx;
background-color: #ffffff;
box-shadow: 0 4upx 6upx rgba(0, 0, 0, 0.34);
margin-bottom: 120upx;
margin-bottom: 32upx;
}
.form-item-label {
......
......@@ -7,7 +7,7 @@
</view>
</block>
<block slot="content">
<text class="text-white">选择合同</text>
<text class="text-white">选择采购收票</text>
</block>
<block slot="right">
<text class="text-white text-bold text-lg margin-right" @tap="onCheck">确 定</text>
......@@ -19,43 +19,62 @@
<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 class="flex-col content-box" :class="k === current?'active':''">
<view class="flex-col content-box" :class="current.includes(k)?'active':''">
<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-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.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">{{Number(item.remainingAmount)}}</text>
</view>
<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-title ellipsis">{{item.contractName}}</text>
<text class="text-title">{{item.settlementNumber}}</text>
</view>
<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-title">{{contractTypeEnum[item.contractType]}}</text>
<text class="text-title ellipsis">{{billTybeEnum[item.billTybe]}}</text>
</view>
<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-title">{{item.contractNumber}}</text>
<text class="text-title ellipsis">{{item.billNumber}}</text>
</view>
<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-title">{{item.projCode}}</text>
<text class="text-title ellipsis">{{Number(item.taxPoints)}}</text>
</view>
<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-title ellipsis">{{item.partyB}}</text>
<text class="text-title ellipsis">{{Number(item.thisSettlementAmount)}}</text>
</view>
<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-title ellipsis">{{Number(item.thisSettlementTax)}}</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 class="flex-row">
<text class="text-gray part-1">收票日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title ellipsis">{{item.receiveDate}}</text>
</view>
</view>
......@@ -67,8 +86,8 @@
<script>
import {toJsonData} from "@/utils/tools.js";
import { getProList } from "@/api/settlement-doc.js";
import {getDict} from "@/api/index.js"
import { getProList } from "@/api/payment-order.js";
import moment from "@/common/moment";
export default {
......@@ -80,16 +99,25 @@
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
queryData: {},
queryData: {
hiddenConditions: "1",
billState: '1'
},
pageData:{
showCount: "true",
limit:5,
limit:500,
offset:0
},
current:0,
current:[],
checkedId:[],
eventChannel: null,
contractTypeEnum:{},
contractNumber:''
contractNumber:'',
billTybeEnum:{
1: '增值税专用发票',
0: '普通电子发票'
},
mainId:''
};
},
onLoad(option) {
......@@ -98,6 +126,12 @@
}else{
this.contractNumber = ''
}
if(option && option.mainId){
this.mainId = option.mainId;
}
if(option && option.checkedId){
this.checkedId = option.checkedId.split(",")
}
this.eventChannel = this.getOpenerEventChannel();
this.onLoading();
},
......@@ -109,30 +143,34 @@
},
methods: {
onCheck(){
this.eventChannel.emit('acceptDataFromOpenedPage', {
...this.projectDataList[this.current],
totalContractPrice: this.projectDataList[this.current].totalContractPriceExcluding
} );
if(this.current && this.current.length){
let list = this.current.map(val => {
return {
...this.projectDataList[val],
billId: this.projectDataList[val].id,
mainId: this.mainId
}
})
this.eventChannel.emit('acceptDataFromOpenedPage', {data:list});
}
this.onBack();
},
onSelect(k){
this.current = k;
if(this.current.includes(k)){
this.current = this.current.filter(item => item !== k)
} else {
this.current.push(k)
}
},
onBack(){
uni.navigateBack();
},
onLoading() {
getDict({
codeset:'hggp.cw.contractType'
}).then(res=>{
console.log(res,9999)
if(res.data.list && res.data.list.length){
res.data.list.forEach(item=>{
this.contractTypeEnum[item.value] = item.label
})
}
})
this.onGetList();
},
onGetList() {
......@@ -144,12 +182,25 @@
},this.pageData).then(res => {
uni.hideLoading();
let list = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns)
let list = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns).map(item=>{
return {
...item,
signingDate: moment(item.signingDate).format("YYYY-MM-DD"),
receiveDate: moment(item.receiveDate).format("YYYY-MM-DD")
}
})
if(this.contractNumber){
list = list.filter(item=>item.contractNumber != this.contractNumber);
}
if (this.pageData.offset == 0) {
this.projectDataList = list
this.projectDataList = list;
if(this.checkedId && this.checkedId.length){
this.current = this.checkedId.map(item => {
return this.projectDataList.findIndex(val => val.id === item)
})
}
} else {
this.projectDataList = [...this.projectDataList, ...list]
}
......@@ -297,7 +348,7 @@
.flex-row{
margin: 6upx 0;
.part-1{
width: 140upx;
width: 180upx;
text-align-last: justify;
}
.part-2{
......
......@@ -37,7 +37,7 @@
<view class="header-title" @tap="onNavToOrderInfo(item)">
<image src="../../static/icon5.png" mode="widthFix"></image>
<view class="flex-between">
<text class="text-black text-bold ellipsis">{{item.partyA}}</text>
<text class="text-black text-bold ellipsis">{{item.partyA.length>=2 ? item.partyA : item.companyName}}</text>
<view class="margin-right text-blue">
<text class="">详情</text>
<text class="cuIcon-right"></text>
......@@ -277,7 +277,7 @@
},
onNavToOrderInfo(val){
uni.navigateTo({
url:`/pages/settlement-doc/edit?id=${val.id}`
url:`/pages/payment-order/edit?id=${val.id}`
})
}
}
......
......@@ -142,7 +142,12 @@
//不良品类
form: {},
factoryIndex:0,
factoryList:[],
factoryList:[
{
label: '全部',
value: ''
}
],
floatTop:"",
floatLeft: "",
floatBoxStatus: false,
......@@ -192,13 +197,14 @@
},
onLoading() {
getParamsList().then(res=>{
this.factoryList = res.data.map(item=>{
let list = res.data.map(item=>{
this.factoryEnum[item.companyCode] = item.companyName
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list];
this.$forceUpdate();
this.onGetList();
})
......
......@@ -398,9 +398,13 @@
},
onNavToSelectList(val) {
console.log(val)
let ids = this.formList.map(item=>item.id);
let ids = ''
if(this.formList.length){
ids = this.formList.filter(item => Number(item.selectIndex) === val).map(item=> item.id).join();
}
uni.navigateTo({
url: `/pages/settlement-doc/select-list?selectIndex=${val}&contractNumber=${this.orderInfo.contractNumber}&contractType=${this.orderInfo.contractType}`,
url: `/pages/settlement-doc/select-list?selectIndex=${val}&contractNumber=${this.orderInfo.contractNumber}&contractType=${this.orderInfo.contractType}&ids=${ids}`,
events: {
acceptDataFromOpenedPage2: (data) => {
console.log(data)
......@@ -424,7 +428,7 @@
this.orderInfo.cumulativeSettlementAmount = num;//累计结算金额
if(this.taxPointsIndex>=0){
this.orderInfo.thisPriceTax = num*(1+Number(this.taxPointsList[this.taxPointsIndex].label)/100); //含税金额
this.orderInfo.thisPriceTax =(num*(1+Number(this.taxPointsList[this.taxPointsIndex].label)/100)).toFixed(2); //含税金额
this.orderInfo.cumulativePriceTax = this.orderInfo.thisPriceTax; // 累计含税金额
this.orderInfo.thisSettlementTax = this.orderInfo.thisPriceTax - num; // 税额
this.orderInfo.cumulativeSettlementTax = this.orderInfo.thisSettlementTax; // 累计税额
......@@ -492,6 +496,7 @@
...that.orderInfo,
...data
}
that.formList = [];
console.log(that.orderInfo, 9999)
that.$forceUpdate();
}
......@@ -555,6 +560,14 @@
uni.showLoading({
title: "加载中..."
})
let formList = this.formList.map(item =>{
return {
...item,
unitPrice: item.unitPrice.toString(),
totalPrice: item.totalPrice.toString()
}
})
save({
projCode: this.orderInfo.projCode,
projName: this.orderInfo.projName,
......@@ -565,15 +578,15 @@
taxPoints:this.taxPointsList[this.taxPointsIndex].value,
priceTaxSeparation:this.priceTaxSeparationList[this.priceTaxSeparationIndex].value,
contractDate:this.orderInfo.contractDate,
thisSettlementAmount:this.orderInfo.thisSettlementAmount,
thisSettlementTax:this.orderInfo.thisSettlementTax,
thisPriceTax:this.orderInfo.thisPriceTax,
thisSettlementAmount:this.orderInfo.thisSettlementAmount.toString(),
thisSettlementTax:this.orderInfo.thisSettlementTax.toString(),
thisPriceTax:this.orderInfo.thisPriceTax.toString(),
totalContractPrice:this.orderInfo.totalContractPrice,
cumulativeSettlementAmount:this.orderInfo.cumulativeSettlementAmount,
cumulativeSettlementTax:this.orderInfo.cumulativeSettlementTax,
cumulativePriceTax:this.orderInfo.cumulativePriceTax,
cumulativeSettlementAmount:this.orderInfo.cumulativeSettlementAmount.toString(),
cumulativeSettlementTax:this.orderInfo.cumulativeSettlementTax.toString(),
cumulativePriceTax:this.orderInfo.cumulativePriceTax.toString(),
},this.formList).then(res => {
},).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
......
......@@ -153,7 +153,7 @@
<script>
import {toJsonData} from "@/utils/tools.js";
import { getList1,getList2,getList3,getList4,getList5 } from "@/api/settlement-doc.js";
import { getList1,getList3,getList11,getList12,getList13 } from "@/api/settlement-doc.js";
import {getDict} from "@/api/index.js"
......@@ -183,7 +183,8 @@
1:"合同清单",
2:"扣款单",
3:"签证单"
}
},
ids:''
};
},
onLoad(option) {
......@@ -196,6 +197,10 @@
if(option && option.contractType){
this.contractType = option.contractType
}
if(option && option.ids){
this.ids = option.ids
console.log(this.ids)
}
this.eventChannel = this.getOpenerEventChannel();
this.onLoading();
......@@ -212,13 +217,14 @@
let thisEngineeringQuantity = this.projectDataList[this.current].provisionalQuantity || 1
this.eventChannel.emit('acceptDataFromOpenedPage2', {
id: this.projectDataList[this.current].id,
settlementBasis:this.selectTypeEnum[this.selectIndex],
taskName:'',
engineeringContent:"",
thisEngineeringQuantity,
cumulativeEngineeringQuantity:'',
unit:"",
unitPrice,
unitPrice:Number(unitPrice),
totalPrice: Number(thisEngineeringQuantity)* Number(unitPrice),
selectIndex: this.selectIndex
} );
......@@ -241,16 +247,16 @@
}
if(this.selectIndex ==1){
if(this.contractType ==2){
this.onGetList4()
this.onGetList11()
}else{
this.onGetList();
this.onGetList1();
}
}else if(this.selectIndex ==2){
this.onGetList2();
this.onGetList12();
}else if(this.selectIndex ==3){
if(this.contractType ==2){
this.onGetList5();
this.onGetList13();
}else{
this.onGetList3();
}
......@@ -258,58 +264,63 @@
}
})
},
onGetList() {
onGetList1() {
uni.showLoading({
title: "加载中"
})
getList1({
...this.queryData
...this.queryData,
inventoryIds: this.ids
},this.pageData).then(res => {
uni.hideLoading();
this.projectDataList= toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns);
this.projectDataList = toJsonData(res.data.__blocks__.result.rows,res.data.__blocks__.result.meta.columns);
console.log(this.projectDataList)
})
},
onGetList2() {
onGetList3() {
uni.showLoading({
title: "加载中"
})
getList2({
...this.queryData
getList3({
...this.queryData,
appentIds: this.ids
},this.pageData).then(res => {
uni.hideLoading();
this.projectDataList = toJsonData(res.data.__blocks__.result2.rows,res.data.__blocks__.result2.meta.columns)
this.projectDataList = toJsonData(res.data.__blocks__.result3.rows,res.data.__blocks__.result3.meta.columns)
})
},
onGetList3() {
onGetList12() {
uni.showLoading({
title: "加载中"
})
getList3({
...this.queryData
getList12({
...this.queryData,
deductionIds: this.ids
},this.pageData).then(res => {
uni.hideLoading();
this.projectDataList = toJsonData(res.data.__blocks__.result3.rows,res.data.__blocks__.result3.meta.columns)
this.projectDataList = toJsonData(res.data.__blocks__.result2.rows,res.data.__blocks__.result2.meta.columns)
})
},
onGetList4() {
onGetList11() {
uni.showLoading({
title: "加载中"
})
getList4({
...this.queryData
getList11({
...this.queryData,
inventoryIds: this.ids
},this.pageData).then(res => {
uni.hideLoading();
this.projectDataList = toJsonData(res.data.__blocks__.result1.rows,res.data.__blocks__.result1.meta.columns)
})
},
onGetList5() {
onGetList13() {
uni.showLoading({
title: "加载中"
})
getList5({
...this.queryData
getList13({
...this.queryData,
appentIds: this.ids
},this.pageData).then(res => {
uni.hideLoading();
this.projectDataList = toJsonData(res.data.__blocks__.result3.rows,res.data.__blocks__.result3.meta.columns)
......
......@@ -240,7 +240,12 @@
//不良品类
form: {},
index: 0,
factoryList: [],
factoryList: [
{
label: '全部',
value: ''
}
],
innerHeight: window.innerHeight,
innerWidth: window.innerWidth,
startTimeStamp: 0,
......@@ -303,12 +308,13 @@
},
onLoading() {
getParamsList().then(res => {
this.factoryList = res.data.map(item => {
let list = res.data.map(item => {
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list];
this.pageData.offset = 0;
this.projectDataList = [];
this.subList = []
......
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