|
@@ -10,11 +10,11 @@
|
|
|
<div class="add-customer-btn">
|
|
|
<el-button
|
|
|
class="el-button--small-yh"
|
|
|
- type="primary"
|
|
|
+ type="warning"
|
|
|
:disabled="detailData.seeDisabled"
|
|
|
size="small"
|
|
|
@click="applySettlement"
|
|
|
- >申请结算</el-button>
|
|
|
+ >生成账单</el-button>
|
|
|
<el-button
|
|
|
class="el-button--small-yh"
|
|
|
type="primary"
|
|
@@ -124,6 +124,15 @@
|
|
|
@row-del="rowDel"
|
|
|
@saveColumn="saveColumn('goods')"
|
|
|
>
|
|
|
+ <template slot="corpId" slot-scope="{ row, index }">
|
|
|
+ <customer-dialog
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.corpName"
|
|
|
+ :cropIndex="index"
|
|
|
+ @getcorpId="getcorpId"
|
|
|
+ ></customer-dialog>
|
|
|
+ <span v-else>{{ row.corpName }}</span>
|
|
|
+ </template>
|
|
|
<template slot="code" slot-scope="{row,index}">
|
|
|
<el-button
|
|
|
type="text"
|
|
@@ -466,6 +475,24 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog
|
|
|
+ title="账单"
|
|
|
+ append-to-body
|
|
|
+ class="el-dialogDeep"
|
|
|
+ :visible.sync="applySettlementDialog"
|
|
|
+ width="60%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ v-dialog-drag
|
|
|
+ >
|
|
|
+ <apply-payment
|
|
|
+ :billType="billType"
|
|
|
+ :billData="billData"
|
|
|
+ @choceFun="choceFun"
|
|
|
+ >
|
|
|
+ </apply-payment>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -501,6 +528,9 @@ import _ from "lodash";
|
|
|
import option from "./configuration/mainList.json";
|
|
|
import { contrastObj, contrastList } from "@/util/contrastData";
|
|
|
import { getMarketPrice, getPurchasePrice } from "@/api/basicData/fees"
|
|
|
+import customerDialog from "@/components/customer-dialog/main";
|
|
|
+//账单组件
|
|
|
+import ApplyPayment from "../../../components/finance/applyPayment";
|
|
|
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
@@ -509,11 +539,18 @@ export default {
|
|
|
type: Object
|
|
|
}
|
|
|
},
|
|
|
+ components:{
|
|
|
+ customerDialog,
|
|
|
+ ApplyPayment
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
saveLoading: false,
|
|
|
disabled: false,
|
|
|
form: {},
|
|
|
+ billType:"销售", //账单类型
|
|
|
+ billData:{}, //账单需要数据
|
|
|
+ applySettlementDialog:false,//生成账单组件
|
|
|
configuration: {
|
|
|
multipleChoices: false,
|
|
|
multiple: false,
|
|
@@ -1070,7 +1107,8 @@ export default {
|
|
|
//初始化查询
|
|
|
async created() {
|
|
|
this.rowHeight = (window.innerHeight - 130) + 'px'
|
|
|
- this.customerContact = await this.getColumnData(this.getColumnName(15), customerContact);
|
|
|
+ this.customerContact = customerContact
|
|
|
+ // this.customerContact = await this.getColumnData(this.getColumnName(15), customerContact);
|
|
|
this.advantageProject = await this.getColumnData(this.getColumnName(16), advantageProject);
|
|
|
this.getWorkDicts("payment_term").then(res => {
|
|
|
this.paymentOption = res.data.data
|
|
@@ -1139,7 +1177,7 @@ export default {
|
|
|
delete this.form.orderItemsList
|
|
|
delete this.form.orderFeesList
|
|
|
delete this.form.orderFilesList
|
|
|
- delete this.form.corpName
|
|
|
+ // delete this.form.corpName
|
|
|
delete this.form.belongToCorpList
|
|
|
// 获取最大值
|
|
|
let num = []
|
|
@@ -1202,6 +1240,9 @@ export default {
|
|
|
copyOrder() {
|
|
|
this.queryData(this.form.id, true)
|
|
|
},
|
|
|
+ getcorpId(row) {
|
|
|
+ this.contactsData[row.index].corpId = row.id;
|
|
|
+ },
|
|
|
// 采购金额获取
|
|
|
getPurchasePrice(row) {
|
|
|
getPurchasePrice({code: row.code}).then(res => {
|
|
@@ -1216,20 +1257,47 @@ export default {
|
|
|
},
|
|
|
// 生成采购单
|
|
|
saveSell() {
|
|
|
- if (!this.form.id) {
|
|
|
- return this.$message.error("此单据没有提交记录,请先提交");
|
|
|
- }
|
|
|
- this.$confirm("是否生成采购单?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- saveSell(this.form.id).then(res => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- this.$message.success("生成成功");
|
|
|
- }
|
|
|
+ // if (!this.form.id) {
|
|
|
+ // return this.$message.error("此单据没有提交记录,请先提交");
|
|
|
+ // }
|
|
|
+ if (contrastObj(this.form, this.oldForm) ||
|
|
|
+ contrastList(this.contactsData, this.oldGoodsList) ||
|
|
|
+ contrastList(this.advantageProjectData, this.oldFeesList) ||
|
|
|
+ contrastList(this.bankOfDepositData, this.oldUploadList)
|
|
|
+ ) {
|
|
|
+ this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.editCustomer(false)
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.info('已取消')
|
|
|
+ // this.$confirm("是否生成采购单?", {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // type: "warning"
|
|
|
+ // }).then(() => {
|
|
|
+ // saveSell(this.form.id).then(res => {
|
|
|
+ // if (res.data.code == 200) {
|
|
|
+ // this.$message.success("生成成功");
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$confirm("是否生成采购单?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ saveSell(this.form.id).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.$message.success("生成成功");
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
},
|
|
|
//点击行可编辑
|
|
|
handleRowClick(row, event, column) {
|
|
@@ -1291,24 +1359,24 @@ export default {
|
|
|
}).then(() => {
|
|
|
this.editCustomer(false)
|
|
|
}).catch(() => {
|
|
|
- // this.$message({
|
|
|
- // type: 'info',
|
|
|
- // message: '已取消'
|
|
|
- // });
|
|
|
- this.selection.forEach(item => {
|
|
|
- lsit.push(item.id)
|
|
|
- })
|
|
|
- let data = {
|
|
|
- id: this.form.id,
|
|
|
- orderItemIds: lsit
|
|
|
- }
|
|
|
- generateShipment(data).then(res => {
|
|
|
- this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
|
|
|
- this.$router.push({
|
|
|
- path: "/businessManagement/deliveryNotice/index",
|
|
|
- query: {form: JSON.stringify(res.data.data)},
|
|
|
- });
|
|
|
- })
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消'
|
|
|
+ });
|
|
|
+ // this.selection.forEach(item => {
|
|
|
+ // lsit.push(item.id)
|
|
|
+ // })
|
|
|
+ // let data = {
|
|
|
+ // id: this.form.id,
|
|
|
+ // orderItemIds: lsit
|
|
|
+ // }
|
|
|
+ // generateShipment(data).then(res => {
|
|
|
+ // this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
|
|
|
+ // this.$router.push({
|
|
|
+ // path: "/businessManagement/deliveryNotice/index",
|
|
|
+ // query: {form: JSON.stringify(res.data.data)},
|
|
|
+ // });
|
|
|
+ // })
|
|
|
})
|
|
|
} else {
|
|
|
// lsit.push(this.selection[item].id)
|
|
@@ -1343,7 +1411,28 @@ export default {
|
|
|
this.editCustomer(true)
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
- } else {}
|
|
|
+ } else {
|
|
|
+ this.beforeBillData(true)
|
|
|
+ this.applySettlementDialog = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //生成账单 拿到主表信息
|
|
|
+ beforeBillData(type){
|
|
|
+ this.billData = {
|
|
|
+ srcOrderno:this.form.orgOrderNo,
|
|
|
+ itemType:"销售",
|
|
|
+ corpsName:this.form.corpName,
|
|
|
+ corpId:this.form.corpId,
|
|
|
+ }
|
|
|
+ console.log(this.form)
|
|
|
+ console.log(this.billData )
|
|
|
+ if(type){ //申请货款
|
|
|
+ this.billData.srcId = -1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //关闭账单
|
|
|
+ choceFun(){
|
|
|
+ this.applySettlementDialog = false
|
|
|
},
|
|
|
//商品选中触发
|
|
|
productSelection(selection) {
|
|
@@ -1367,7 +1456,7 @@ export default {
|
|
|
removeGoodsRepeat() {
|
|
|
let obj = []
|
|
|
this.goodsConfiguration.dicData = this.goodsConfiguration.dicData.reduce((current,next) => {
|
|
|
- obj[next.id] ? '': obj[next.id] = true && current.push(next)
|
|
|
+ obj[next.cname] ? '': obj[next.cname] = true && current.push(next)
|
|
|
return current
|
|
|
}, [])
|
|
|
},
|