Commit b92d97da by chenwq

联调

1 parent ba1812f9
...@@ -126,6 +126,12 @@ export function createPaymentBill(data) { ...@@ -126,6 +126,12 @@ export function createPaymentBill(data) {
return request(data, "post") return request(data, "post")
} }
// 生成应付单
export function createReceiptBill(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.jd.receipt'
return request(data, "post")
}
// 查询应付转账信息 // 查询应付转账信息
export function getBillTransferInfo(data) { export function getBillTransferInfo(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.transfer.out.info' data.method = 'dj.api.smartcarlife.reconciliationBill.transfer.out.info'
...@@ -204,6 +210,24 @@ export function updateJdDetail(data) { ...@@ -204,6 +210,24 @@ export function updateJdDetail(data) {
return request(data, 'post') return request(data, 'post')
} }
// 应收应付单 - 用户手动新增明细
export function addJdDetail(data) {
data.method = 'dj.smartcarlife.api.jdbill.detail.add'
return request(data, 'post')
}
// 应收应付单-删除明细-仅手动新增的明细可删
export function deleteJdDetail(data) {
data.method = 'dj.smartcarlife.api.jdbill.detail.delete'
return request(data, 'post')
}
// 应收应付单-删除明细-仅手动新增的明细可删
export function push2Jd(data) {
data.method = 'dj.smartcarlife.api.jdbill.push2kingdee'
return request(data, 'post')
}
// 日志列表查询 // 日志列表查询
export function getJdBillLog(data) { export function getJdBillLog(data) {
data.method = 'dj.smartcarlife.api.jdbill.log' data.method = 'dj.smartcarlife.api.jdbill.log'
......
...@@ -50,19 +50,19 @@ ...@@ -50,19 +50,19 @@
<auth-button :data="scope.scope" :show-btn-ids="['9051107']" /> <auth-button :data="scope.scope" :show-btn-ids="['9051107']" />
</span> </span>
<!-- 生成应收单 --> <!-- 生成应收单 -->
<span style="margin-right: 10px;" v-if="(!scope.scope.receivableBillIds) && scope.scope.reconciliationBillStatus == '3' && scope.scope.billType == '1'"> <span style="margin-right: 10px;" v-if="((!scope.scope.receivableBillIds) || (scope.scope.receivableBillIds.length == 0)) && scope.scope.reconciliationBillStatus == '3' && scope.scope.billType == '1'">
<auth-button :data="scope.scope" :show-btn-ids="['9051108']" /> <auth-button :data="scope.scope" :show-btn-ids="['9051108']" />
</span> </span>
<!-- 生成应付单 --> <!-- 生成应付单 -->
<span style="margin-right: 10px;" v-if="(!scope.scope.payableBillIds) && scope.scope.reconciliationBillStatus == '3'"> <span style="margin-right: 10px;" v-if="((!scope.scope.payableBillIds) || (scope.scope.payableBillIds.length == 0)) && scope.scope.reconciliationBillStatus == '3'">
<auth-button :data="scope.scope" :show-btn-ids="['9051109']" /> <auth-button :data="scope.scope" :show-btn-ids="['9051109']" />
</span> </span>
<!-- 查看应收单 --> <!-- 查看应收单 -->
<span style="margin-right: 10px;" v-if="scope.scope.receivableBillIds && scope.scope.reconciliationBillStatus == '3' && scope.scope.billType == '1'"> <span style="margin-right: 10px;" v-if="scope.scope.receivableBillIds && scope.scope.receivableBillIds.length && scope.scope.reconciliationBillStatus == '3' && scope.scope.billType == '1'">
<auth-button :data="scope.scope" :show-btn-ids="['9051110']" /> <auth-button :data="scope.scope" :show-btn-ids="['9051110']" />
</span> </span>
<!-- 查看应付单 --> <!-- 查看应付单 -->
<span style="margin-right: 10px;" v-if="scope.scope.payableBillIds && scope.scope.reconciliationBillStatus == '3'"> <span style="margin-right: 10px;" v-if="scope.scope.payableBillIds && scope.scope.payableBillIds.length && scope.scope.reconciliationBillStatus == '3'">
<auth-button :data="scope.scope" :show-btn-ids="['9051111']" /> <auth-button :data="scope.scope" :show-btn-ids="['9051111']" />
</span> </span>
<!-- 应付转账 --> <!-- 应付转账 -->
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
<script> <script>
import { Util, deepClone } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { getBillList, billDetailPage, billConfirm, billCancel, billConfirmChange, billCancelChange, getBillTransferInfo, createPaymentBill } from '@api/accountManage' import { getBillList, billDetailPage, billConfirm, billCancel, billConfirmChange, billCancelChange, getBillTransferInfo, createPaymentBill, createReceiptBill } from '@api/accountManage'
import { tmplTypeList, billStatusList, sceneTypeList } from "../constant/baseData" import { tmplTypeList, billStatusList, sceneTypeList } from "../constant/baseData"
import ChangeDetailDialog from '../components/ChangeDetailDialog' import ChangeDetailDialog from '../components/ChangeDetailDialog'
import SystemBillDialog from "../components/SystemBillDialog" import SystemBillDialog from "../components/SystemBillDialog"
...@@ -460,7 +460,16 @@ export default { ...@@ -460,7 +460,16 @@ export default {
// 生成应收 // 生成应收
handleCreateReceiveBill(row) { handleCreateReceiveBill(row) {
this.createPaymentBill(row) const params = {
id: row.id
}
this.loading = true
createReceiptBill(params).then(() => {
this.$message.success("操作成功")
this.$refs.recordTable.refreshTable(false, true)
}).finally(() => {
this.loading = false
})
}, },
// 生成应付 // 生成应付
......
...@@ -33,7 +33,10 @@ export default { ...@@ -33,7 +33,10 @@ export default {
optionsName: 'customerOpt', optionsName: 'customerOpt',
isHide: false, isHide: false,
// 用于判断该字段出现与否;流量方对账单,才会出现此字段 // 用于判断该字段出现与否;流量方对账单,才会出现此字段
billType: 'receive' billType: 'receive',
changeAttr: (value, targetItem) => {
this.editData[targetItem.labelName] = this.baseData[targetItem.optionsName].find(item => item[targetItem.optionId] == value)?.[targetItem.optionLabel] || ''
}
}, },
{ {
label: "供应商", label: "供应商",
...@@ -43,9 +46,12 @@ export default { ...@@ -43,9 +46,12 @@ export default {
optionList: [], optionList: [],
optionId: 'number', optionId: 'number',
optionLabel: 'name', optionLabel: 'name',
optionsName: 'customerOpt', optionsName: 'supplierOpt',
isHide: false, isHide: false,
billType: 'pay' billType: 'pay',
changeAttr: (value, targetItem) => {
this.editData[targetItem.labelName] = this.baseData[targetItem.optionsName].find(item => item[targetItem.optionId] == value)?.[targetItem.optionLabel] || ''
}
}, },
{ {
label: "结算组织", label: "结算组织",
...@@ -55,7 +61,10 @@ export default { ...@@ -55,7 +61,10 @@ export default {
optionList: [], optionList: [],
optionId: 'number', optionId: 'number',
optionLabel: 'name', optionLabel: 'name',
optionsName: 'settlementOrgOpt' optionsName: 'settlementOrgOpt',
changeAttr: (value, targetItem) => {
this.editData[targetItem.labelName] = this.baseData[targetItem.optionsName].find(item => item[targetItem.optionId] == value)?.[targetItem.optionLabel] || ''
}
}, },
{ {
label: "收款组织", label: "收款组织",
...@@ -67,33 +76,38 @@ export default { ...@@ -67,33 +76,38 @@ export default {
optionLabel: 'name', optionLabel: 'name',
optionsName: 'rcvOrgOpt', optionsName: 'rcvOrgOpt',
isHide: false, isHide: false,
billType: 'receive' changeAttr: (value, targetItem) => {
}, this.editData[targetItem.labelName] = this.baseData[targetItem.optionsName].find(item => item[targetItem.optionId] == value)?.[targetItem.optionLabel] || ''
{ }
label: "付款组织",
name: "rcvOrgCode",
labelName: "rcvOrgName",
type: "select",
optionList: [],
optionId: 'number',
optionLabel: 'name',
optionsName: 'rcvOrgOpt',
isHide: false,
billType: 'pay'
}, },
// { // {
// label: "发票类型", // label: "付款组织",
// name: "", // name: "rcvOrgCode",
// labelName: "", // labelName: "rcvOrgName",
// type: "select", // type: "select",
// optionList: [], // optionList: [],
// optionId: 'number', // optionId: 'number',
// optionLabel: 'name', // optionLabel: 'name',
// optionsName: '', // optionsName: 'rcvOrgOpt',
// isHide: false, // isHide: false,
// billType: 'pay' // billType: 'pay'
// }, // },
{ {
label: "发票类型",
name: "invoiceTypeNumber",
labelName: "invoiceTypeName",
type: "select",
optionList: [],
optionId: 'number',
optionLabel: 'name',
optionsName: 'invoiceTypeOpt',
isHide: false,
billType: 'pay',
changeAttr: (value, targetItem) => {
this.editData[targetItem.labelName] = this.baseData[targetItem.optionsName].find(item => item[targetItem.optionId] == value)?.[targetItem.optionLabel] || ''
}
},
{
label: "物料名称", label: "物料名称",
name: "materialCode", name: "materialCode",
labelName: "materialCodeName", labelName: "materialCodeName",
...@@ -101,7 +115,10 @@ export default { ...@@ -101,7 +115,10 @@ export default {
optionList: [], optionList: [],
optionId: 'number', optionId: 'number',
optionLabel: 'name', optionLabel: 'name',
optionsName: 'materialOpt' optionsName: 'materialOpt',
changeAttr: (value, targetItem) => {
this.editData[targetItem.labelName] = this.baseData[targetItem.optionsName].find(item => item[targetItem.optionId] == value)?.[targetItem.optionLabel] || ''
}
}, },
{ {
label: "含税单价", label: "含税单价",
...@@ -116,12 +133,15 @@ export default { ...@@ -116,12 +133,15 @@ export default {
{ {
label: "税率", label: "税率",
name: "taxRate", name: "taxRate",
labelName: "taxRateName", labelName: "taxRate",
type: "select", type: "select",
optionList: [], optionList: [],
optionId: 'taxRate', optionId: 'taxRate',
optionLabel: 'taxRate', optionLabel: 'taxRate',
optionsName: 'taxRateOpt' optionsName: 'taxRateOpt',
changeAttr: (value, targetItem) => {
this.editData[targetItem.labelName] = this.baseData[targetItem.optionsName].find(item => item[targetItem.optionId] == value)?.[targetItem.optionLabel]
}
}, { }, {
label: "业务类型", label: "业务类型",
name: "businessTypeCode", name: "businessTypeCode",
...@@ -130,7 +150,10 @@ export default { ...@@ -130,7 +150,10 @@ export default {
optionList: [], optionList: [],
optionId: 'number', optionId: 'number',
optionLabel: 'name', optionLabel: 'name',
optionsName: 'businessTypeOpt' optionsName: 'businessTypeOpt',
changeAttr: (value, targetItem) => {
this.editData[targetItem.labelName] = this.baseData[targetItem.optionsName].find(item => item[targetItem.optionId] == value)?.[targetItem.optionLabel] || ''
}
}, },
{ {
label: "4S门店", label: "4S门店",
...@@ -140,11 +163,13 @@ export default { ...@@ -140,11 +163,13 @@ export default {
], ],
baseData: { baseData: {
customerOpt: [], customerOpt: [],
supplierOpt: [],
settlementOrgOpt: [], settlementOrgOpt: [],
rcvOrgOpt: [], rcvOrgOpt: [],
materialOpt: [], materialOpt: [],
taxRateOpt: [], taxRateOpt: [],
businessTypeOpt: [] businessTypeOpt: [],
invoiceTypeOpt: []
}, },
apiList: [{ apiList: [{
api: 'getJdCustPage', api: 'getJdCustPage',
...@@ -153,13 +178,18 @@ export default { ...@@ -153,13 +178,18 @@ export default {
billType: 'receive' billType: 'receive'
}, { }, {
api: 'getJdOrgPage', api: 'getJdOrgPage',
nameList: ['settlementOrgCode', 'rcvOrgCode'] nameList: ['settlementOrgCode']
}, {
api: 'getJdOrgPage',
nameList: ['rcvOrgCode']
}, { }, {
api: 'getJdSupplierPage', api: 'getJdSupplierPage',
nameList: ['supplierId'], nameList: ['supplierId'],
billType: 'pay' billType: 'pay'
}, }, {
{ api: 'getJdInvoiceTypePage',
nameList: ['invoiceTypeNumber']
}, {
api: 'getJdMaterialPage', api: 'getJdMaterialPage',
nameList: ['materialCode'] nameList: ['materialCode']
}, { }, {
...@@ -184,11 +214,11 @@ export default { ...@@ -184,11 +214,11 @@ export default {
}, },
mounted() { mounted() {
console.log(api, 'api---') console.log(this.info, 'info---')
this.title = this.info.billTypeStr === 'receive' ? '新增应收明细' : '新增应付明细' this.title = this.info.billTypeStr === 'receive' ? '新增应收明细' : '新增应付明细'
this.editFormData = this.info.billTypeStr === 'receive' ? deepClone(this.receiveEditFormData) : [] this.editFormData = deepClone(this.receiveEditFormData)
console.log(this.editFormData, 'this.editFormData---') console.log(this.editFormData, 'this.editFormData---')
this.dealAttrHideShow() this.dealAttr()
this.dealOpts() this.dealOpts()
}, },
...@@ -221,21 +251,22 @@ export default { ...@@ -221,21 +251,22 @@ export default {
findIdx(name) { findIdx(name) {
return this.editFormData.findIndex(item => item.name == name) return this.editFormData.findIndex(item => item.name == name)
}, },
dealAttrHideShow() { dealAttr() {
const dealExistList = ['customerCode', 'supplierId', 'settlementOrgCode', 'rcvOrgCode']
this.editFormData[this.findIdx('rcvOrgCode')].label = this.info.billTypeStr === 'receive' ? '收款组织' : '付款组织'
this.editFormData.forEach(item => { this.editFormData.forEach(item => {
if (item.billType && item.billType !== this.info.billTypeStr) { item.isHide = item.billType && (item.billType != this.info.billTypeStr)
item.isHide = true if (dealExistList.includes(item.name) && this.info[item.name]) {
} else { item.type = 'showTxt'
item.isHide = false this.editData[item.name] = this.info[item.name]
this.editData[item.labelName] = this.info[item.labelName]
item.name = item.labelName
} }
}) })
}, },
dealOpts() { dealOpts() {
for (let i = 0; i < this.apiList.length; i++) { for (let i = 0; i < this.apiList.length; i++) {
const item = this.apiList[i] const item = this.apiList[i]
// if (item.billType && item.billType !== this.info.billTypeStr) {
// break
// }
const params = { const params = {
currentPage: 1, currentPage: 1,
pageSize: 999 pageSize: 999
...@@ -255,10 +286,10 @@ export default { ...@@ -255,10 +286,10 @@ export default {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => { this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (valid) { if (valid) {
var params = deepClone(this.editData) var params = deepClone(this.editData)
params.id = this.info.id params.billId = this.info.billId
console.log(params, 'params---') console.log(params, 'params---')
this.loading = true this.loading = true
api.updateJdDetail(params).then(() => { api.addJdDetail(params).then(() => {
this.$message.success("操作成功") this.$message.success("操作成功")
this.$emit('handleConfirm') this.$emit('handleConfirm')
}).finally(() => { }).finally(() => {
......
<template> <template>
<div> <div>
<d2-dialog :title="billTypeStr == 'receive' ? '应收单详情' : '应付单详情'" :is-visible="billVisible" class="privacyDailog" width="80%" @closeDialog="handleClose" @confirmDialog="handleConfirm"> <d2-dialog :title="billTypeStr == 'receive' ? '应收单详情' : '应付单详情'" :is-visible="billVisible" class="privacyDailog" width="80%" btnOkLabel="关闭" noCancel="true" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<div class="flex"> <div class="flex">
<div>适用对象:{{ jdBillInfo.billMerchantName }}</div> <div>适用对象:{{ jdBillInfo.billMerchantName }}</div>
<div> <div v-if="pageType != 'detail'">
<el-button @click="handleAdd">新增详情</el-button> <el-button @click="handleAdd">新增详情</el-button>
<el-button @click="handlePushToJd">推送金蝶</el-button> <el-button @click="handlePushToJd">推送金蝶</el-button>
</div> </div>
...@@ -12,36 +12,22 @@ ...@@ -12,36 +12,22 @@
<div slot="edit" slot-scope="scope"> <div slot="edit" slot-scope="scope">
<div class="flex-center"> <div class="flex-center">
<div :class="[hasError(scope.scope, scope.prop) ? 'red-txt' : '']">{{ scope.scope[scope.prop] }}</div> <div :class="[hasError(scope.scope, scope.prop) ? 'red-txt' : '']">{{ scope.scope[scope.prop] }}</div>
<img src="@/assets/icon-edit.png" style="cursor: pointer;margin-left: 5px;width: 16px;height: 16px;" @click="handleEditTableItem(scope.index, scope.scope, scope.prop)" /> <img src="@/assets/icon-edit.png" style="cursor: pointer;margin-left: 5px;width: 16px;height: 16px;" v-if="pageType != 'detail'" @click="handleEditTableItem(scope.index, scope.scope, scope.prop)" />
</div> </div>
</div> </div>
</d2-table> </d2-table>
<!-- 手动添加 --> <!-- 手动添加 -->
<d2-table ref="userTable" :table-data="userTableList" :table-params="userTableParams" :hasNum="false" :hasPage="false"> <d2-table ref="userTable" :table-data="userTableList" :table-params="userTableParams" :hasNum="false" :hasPage="false">
<div slot="edit" slot-scope="scope">
{{ scope.scope[scope.prop] }}
</div>
<div slot="auth-button" slot-scope="scope">
<el-button type="text" v-if="pageType != 'detail'" @click="handleDelete(scope.scope)">删除</el-button>
</div>
</d2-table> </d2-table>
<!-- 操作日志 --> <!-- 操作日志 -->
<d2-table ref="logTable" :table-data="logTableList" :table-params="logTableParams" :hasNum="false" :hasPage="false"> <d2-table ref="logTable" :table-data="logTableList" :table-params="logTableParams" :hasNum="false" :hasPage="false">
</d2-table> </d2-table>
<!-- <el-table v-loading="loading" :data="tableList" style="width: 100%" ref="billMutiTable">
<el-table-column v-for="(item, idx) in tableHeader" :key="idx" :label="item.moduleName">
<div class="tb-header-cell" slot="header">
</div>
<div class="tb-cell" slot-scope="scope">
<div>
{{ scope.row }}
</div>
</div>
</el-table-column>
</el-table>
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page.pageNum" :page-size="page.pageSize" :total="page.total" :page-sizes="[10, 20, 30, 40]" layout="sizes,total,->,prev,pager,next,jumper">
</el-pagination> -->
<!-- <DynamicAddTable v-if="billTypeStr == 'traffic'" ref="dynamicReceiveAdd" :configObj="{ 'title': '应收' }" :adjustments="receivableAdjustments" @handleInputBlur="billCompute"></DynamicAddTable>
<DynamicAddTable ref="dynamicAdd" :adjustments="payableAdjustments" @handleInputBlur="billCompute"></DynamicAddTable> -->
<!-- <div class="total-box">
<div v-if="billTypeStr == 'traffic'">应收总额:{{ totalReceivable }}元</div>
<div>应付总额:{{ totalPayable }}元</div>
<div v-if="billTypeStr == 'traffic'">线下对账总额:{{ totalOfflineReconciliation }}元</div>
</div> -->
</d2-dialog> </d2-dialog>
<add-detail-dialog v-if="addVisible" :addVisible="addVisible" :info="info" @handleConfirm="handleAddConfirm" @dialogClose="handleAddVisible"></add-detail-dialog> <add-detail-dialog v-if="addVisible" :addVisible="addVisible" :info="info" @handleConfirm="handleAddConfirm" @dialogClose="handleAddVisible"></add-detail-dialog>
<!-- 批量輸入 --> <!-- 批量輸入 -->
...@@ -95,6 +81,8 @@ export default { ...@@ -95,6 +81,8 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
// 页面类型;edit: 编辑页面,edetail: 查看
pageType: 'edit',
billTypeStr: 'receive', billTypeStr: 'receive',
addVisible: false, addVisible: false,
info: {}, info: {},
...@@ -162,7 +150,7 @@ export default { ...@@ -162,7 +150,7 @@ export default {
}, { }, {
confId: '4', confId: '4',
confValue: '推送金蝶' confValue: '推送金蝶'
}], }]
}, },
defaultWidth: '180px' defaultWidth: '180px'
} }
...@@ -174,9 +162,11 @@ export default { ...@@ -174,9 +162,11 @@ export default {
initComponent() { initComponent() {
this.billTypeStr = this.jdBillInfo.billType == '3' ? 'receive' : 'pay' this.billTypeStr = this.jdBillInfo.billType == '3' ? 'receive' : 'pay'
console.log(this.jdBillInfo, 'this.jdBillInfo---') console.log(this.jdBillInfo, 'this.jdBillInfo---')
this.pageType = this.jdBillInfo.pushStatus == '1' ? 'detail' : 'edit'
this.tableParams.tableColumns = this.jdBillInfo.billType == '3' ? deepClone(receiveTableColumns) : deepClone(payTableColumns) this.tableParams.tableColumns = this.jdBillInfo.billType == '3' ? deepClone(receiveTableColumns) : deepClone(payTableColumns)
this.userTableParams.tableColumns = this.jdBillInfo.billType == '3' ? deepClone(receiveTableColumns) : deepClone(payTableColumns) this.userTableParams.tableColumns = this.jdBillInfo.billType == '3' ? deepClone(receiveTableColumns) : deepClone(payTableColumns)
this.getBillList() this.getBillList()
this.getUserTableList()
this.getJdBillLog() this.getJdBillLog()
// this.dateStr = Util.dateFormate(this.jdBillInfo.startDate, 'YYYY年MM月DD日') + '~' + Util.dateFormate(this.jdBillInfo.endDate, 'YYYY年MM月DD日') // this.dateStr = Util.dateFormate(this.jdBillInfo.startDate, 'YYYY年MM月DD日') + '~' + Util.dateFormate(this.jdBillInfo.endDate, 'YYYY年MM月DD日')
// this.tmplFieldsList = JSON.parse(this.jdBillInfo.fieldsJson) // this.tmplFieldsList = JSON.parse(this.jdBillInfo.fieldsJson)
...@@ -215,7 +205,24 @@ export default { ...@@ -215,7 +205,24 @@ export default {
this.getBillList() this.getBillList()
}, },
getUserTableList() {
const params = {
billId: this.jdBillInfo.id,
manual: true,
currentPage: 1,
pageSize: 999
}
this.loading = true
getJdDetailPage(params).then(res => {
console.log(res, 'getJdDetailPage res---')
this.userTableList = res.list || []
}).finally(() => {
this.loading = false
})
},
getBillList() { getBillList() {
this.tableList = []
const params = { const params = {
billId: this.jdBillInfo.id, billId: this.jdBillInfo.id,
manual: false, manual: false,
...@@ -226,21 +233,37 @@ export default { ...@@ -226,21 +233,37 @@ export default {
getJdDetailPage(params).then(res => { getJdDetailPage(params).then(res => {
console.log(res, 'getJdDetailPage res---') console.log(res, 'getJdDetailPage res---')
this.tableList = res.list || [] this.tableList = res.list || []
this.page.pageNum = res.orderPage?.pageNum || 1 this.page.pageNum = res.pageNum || 1
this.page.pageSize = res.orderPage?.pageSize || 10 this.page.pageSize = res.pageSize || 10
this.page.total = res.orderPage?.total || 0 this.page.total = res.total || 0
// this.dealTableData() // this.dealTableData()
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
}, },
// 处理客户/供应商,结算组织,付款组织的数据;若有值,新增详情则不能编辑
dealExistVal() {
if (this.tableList.length == 0) {
return
}
const dealExistList = ['customerName', 'supplierIdName', 'settlementOrg', 'rcvOrgName']
const target = this.tableList[0]
dealExistList.forEach(item => {
const idx = this.findIdx(item)
if (idx != -1 && target[this.tableParams.tableColumns[idx].labelName]) {
this.info[item] = target[item]
this.info[this.tableParams.tableColumns[idx].labelName] = target[this.tableParams.tableColumns[idx].labelName]
}
})
},
handleAdd() { handleAdd() {
console.log(this.jdBillInfo, 'this.jdBillInfo---') console.log(this.jdBillInfo, 'this.jdBillInfo---')
this.info = { this.info = {
billTypeStr: this.billTypeStr, billTypeStr: this.billTypeStr,
id: this.jdBillInfo.id billId: this.tableList[0].billId
} }
this.dealExistVal()
this.handleAddVisible() this.handleAddVisible()
}, },
...@@ -250,6 +273,28 @@ export default { ...@@ -250,6 +273,28 @@ export default {
handleAddConfirm() { handleAddConfirm() {
this.handleAddVisible() this.handleAddVisible()
this.getBillList()
this.getUserTableList()
this.getJdBillLog()
},
handlePushToJd() {
const params = {
id: this.jdBillInfo.id
}
this.loading = true
api.push2Jd(params).then(res => {
console.log(res, 'push2Jd res---')
res ? this.$message.success("推送金蝶成功") : this.$message.error("推送金蝶失败")
// this.getBillList()
// this.getUserTableList()
this.getJdBillLog()
if (res) {
this.pageType = 'detail'
}
}).finally(() => {
this.loading = false
})
}, },
findIdx(field) { findIdx(field) {
...@@ -284,7 +329,6 @@ export default { ...@@ -284,7 +329,6 @@ export default {
this.headObj.labelName = obj.prop this.headObj.labelName = obj.prop
this.$set(this.batchForm, obj.prop, row[obj.prop]) this.$set(this.batchForm, obj.prop, row[obj.prop])
} }
// handleBatchConfirm
console.log(this.batchForm, 'this.batchForm---') console.log(this.batchForm, 'this.batchForm---')
if (this.headObj.editType == 'select') { if (this.headObj.editType == 'select') {
this.getOpt(obj.apiName) this.getOpt(obj.apiName)
...@@ -307,6 +351,21 @@ export default { ...@@ -307,6 +351,21 @@ export default {
} }
}, },
handleDelete(row) {
console.log(row, 'row---')
const params = {
id: row.id
}
this.loading = true
api.deleteJdDetail(params).then(() => {
this.$message.success("删除成功")
this.getUserTableList()
this.getJdBillLog()
}).finally(() => {
this.loading = false
})
},
// getErrorMessage(rowIndex, source, field) { // getErrorMessage(rowIndex, source, field) {
// if (['coverReceiverType'].includes(field)) { // if (['coverReceiverType'].includes(field)) {
// return false // return false
...@@ -503,24 +562,7 @@ export default { ...@@ -503,24 +562,7 @@ export default {
// }, // },
handleConfirm() { handleConfirm() {
const validFlag = this.billTypeStr == 'receive' ? (this.$refs.dynamicReceiveAdd.validateForm() && this.$refs.dynamicAdd.validateForm()) : this.$refs.dynamicAdd.validateForm() this.$emit('handleClose')
if (this.validateForm() && validFlag) {
const dynamicForm = {
id: this.orderId,
updatedOrders: deepClone(this.tableModifyList),
excludeBillOrderCodes: deepClone(this.tableDeleteList),
receivableAdjustments: this.$refs.dynamicReceiveAdd.dynamicForm.tableData,
payableAdjustments: this.$refs.dynamicAdd.dynamicForm.tableData,
sceneType: this.sceneType
}
// console.log(dynamicForm, 'dynamicForm')
editBillPage({ json: JSON.stringify(dynamicForm) }).then(res => {
this.$message.success("操作成功")
this.$emit('handleConfirm')
})
} else {
this.$message.error('请检查表单中的报错项')
}
}, },
handleClose() { handleClose() {
...@@ -765,7 +807,10 @@ export default { ...@@ -765,7 +807,10 @@ export default {
this.loading = true this.loading = true
api.updateJdDetail(params).then(res => { api.updateJdDetail(params).then(res => {
console.log(res, 'updateJdDetail res---') console.log(res, 'updateJdDetail res---')
this.tableList[this.headObj.rowIndex] = res // this.tableList[this.headObj.rowIndex] = res
this.getBillList()
this.getUserTableList()
this.getJdBillLog()
// this.$message.success("操作成功") // this.$message.success("操作成功")
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
......
...@@ -64,14 +64,20 @@ export const receiveTableColumns = [ ...@@ -64,14 +64,20 @@ export const receiveTableColumns = [
}, },
{ {
label: "(明细)物料编码#名称", label: "(明细)物料编码#名称",
prop: "exchangeRateName", prop: "materialCodeName",
labelName: "materialCode", labelName: "materialCode",
addHtml: "edit", addHtml: "edit",
editType: "select" editType: "select",
optionList: [],
optionId: "number",
optionLabel: "name",
optionsName: "materialOpt",
apiName: "getJdMaterialPage",
isMarkRed: true
}, },
{ {
label: "(明细)物料名称", label: "(明细)物料名称",
prop: "materialCodeName" prop: "materialName"
}, },
{ {
label: "(明细)计价单位#名称", label: "(明细)计价单位#名称",
...@@ -100,8 +106,15 @@ export const receiveTableColumns = [ ...@@ -100,8 +106,15 @@ export const receiveTableColumns = [
{ {
label: "(明细)业务类型", label: "(明细)业务类型",
prop: "businessTypeName", prop: "businessTypeName",
labelName: "businessTypeCode",
addHtml: "edit", addHtml: "edit",
editType: "select" editType: "select",
optionList: [],
optionId: "number",
optionLabel: "name",
optionsName: "businessTypeOpt",
apiName: "getJdBusinessPage",
isMarkRed: true
}, },
{ {
label: "(明细)分摊期限", label: "(明细)分摊期限",
...@@ -110,8 +123,15 @@ export const receiveTableColumns = [ ...@@ -110,8 +123,15 @@ export const receiveTableColumns = [
{ {
label: "(明细)税率(%)", label: "(明细)税率(%)",
prop: "taxRate", prop: "taxRate",
labelName: "taxRate",
addHtml: "edit", addHtml: "edit",
editType: "select" editType: "select",
optionList: [],
optionId: "taxRate",
optionLabel: "taxRate",
optionsName: "taxRateOpt",
apiName: "getJdTaxratePage",
isMarkRed: true
}, },
{ {
label: "(明细)备注", label: "(明细)备注",
...@@ -149,7 +169,16 @@ export const payTableColumns = [ ...@@ -149,7 +169,16 @@ export const payTableColumns = [
}, },
{ {
label: "(单据头)供应商#名称", label: "(单据头)供应商#名称",
prop: "supplierIdName" prop: "supplierIdName",
labelName: "supplierId",
addHtml: "edit",
editType: "select",
optionList: [],
optionId: "number",
optionLabel: "name",
optionsName: "supplierOpt",
apiName: "getJdSupplierPage",
isMarkRed: true
}, },
{ {
label: "(单据头)币别#名称", label: "(单据头)币别#名称",
...@@ -157,15 +186,42 @@ export const payTableColumns = [ ...@@ -157,15 +186,42 @@ export const payTableColumns = [
}, },
{ {
label: "(单据头)结算组织#名称", label: "(单据头)结算组织#名称",
prop: "settlementOrg" prop: "settlementOrg",
labelName: "settlementOrgCode",
addHtml: "edit",
editType: "select",
optionList: [],
optionId: "number",
optionLabel: "name",
optionsName: "settlementOrgOpt",
apiName: "getJdOrgPage",
isMarkRed: true
}, },
{ {
label: "(单据头)付款组织#名称", label: "(单据头)付款组织#名称",
prop: "rcvOrgName" prop: "rcvOrgName",
labelName: "rcvOrgCode",
addHtml: "edit",
editType: "select",
optionList: [],
optionId: "number",
optionLabel: "name",
optionsName: "rcvOrgOpt",
apiName: "getJdOrgPage",
isMarkRed: true
}, },
{ {
label: "*(单据头)发票类型", label: "*(单据头)发票类型",
prop: "" prop: "invoiceTypeName",
labelName: "invoiceTypeNumber",
addHtml: "edit",
editType: "select",
optionList: [],
optionId: "number",
optionLabel: "name",
optionsName: "invoiceTypeOpt",
apiName: "getJdInvoiceTypePage"
// isMarkRed: true
}, },
{ {
label: "*(表头财务)到期日计算日期", label: "*(表头财务)到期日计算日期",
...@@ -177,11 +233,20 @@ export const payTableColumns = [ ...@@ -177,11 +233,20 @@ export const payTableColumns = [
}, },
{ {
label: "(明细)物料编码#名称", label: "(明细)物料编码#名称",
prop: "materialCode" prop: "materialCodeName",
labelName: "materialCode",
addHtml: "edit",
editType: "select",
optionList: [],
optionId: "number",
optionLabel: "name",
optionsName: "materialOpt",
apiName: "getJdMaterialPage",
isMarkRed: true
}, },
{ {
label: "(明细)物料名称", label: "(明细)物料名称",
prop: "materialCodeName" prop: "materialName"
}, },
{ {
label: "(明细)计价单位#名称", label: "(明细)计价单位#名称",
...@@ -189,11 +254,15 @@ export const payTableColumns = [ ...@@ -189,11 +254,15 @@ export const payTableColumns = [
}, },
{ {
label: "(明细)计价数量", label: "(明细)计价数量",
prop: "pricingNumber" prop: "pricingNumber",
addHtml: "edit",
editType: "input"
}, },
{ {
label: "(明细)价税合计本位币", label: "(明细)价税合计本位币",
prop: "priceTaxTotal" prop: "priceTaxTotal",
addHtml: "edit",
editType: "input"
}, },
{ {
label: "(明细)含税单价", label: "(明细)含税单价",
...@@ -205,7 +274,16 @@ export const payTableColumns = [ ...@@ -205,7 +274,16 @@ export const payTableColumns = [
}, },
{ {
label: "(明细)业务类型", label: "(明细)业务类型",
prop: "businessTypeName" prop: "businessTypeName",
labelName: "businessTypeCode",
addHtml: "edit",
editType: "select",
optionList: [],
optionId: "number",
optionLabel: "name",
optionsName: "businessTypeOpt",
apiName: "getJdBusinessPage",
isMarkRed: true
}, },
{ {
label: "(明细)分摊期限", label: "(明细)分摊期限",
...@@ -213,11 +291,22 @@ export const payTableColumns = [ ...@@ -213,11 +291,22 @@ export const payTableColumns = [
}, },
{ {
label: "(明细)税率(%)", label: "(明细)税率(%)",
prop: "taxRate" prop: "taxRate",
labelName: "taxRate",
addHtml: "edit",
editType: "select",
optionList: [],
optionId: "taxRate",
optionLabel: "taxRate",
optionsName: "taxRateOpt",
apiName: "getJdTaxratePage",
isMarkRed: true
}, },
{ {
label: "(明细)备注", label: "(明细)备注",
prop: "remark" prop: "remark",
addHtml: "edit",
editType: "input"
}, },
{ {
label: "(明细)不含税金额", label: "(明细)不含税金额",
...@@ -229,6 +318,8 @@ export const payTableColumns = [ ...@@ -229,6 +318,8 @@ export const payTableColumns = [
}, },
{ {
label: "(明细)4S门店", label: "(明细)4S门店",
prop: "shopMerchantName" prop: "shopMerchantName",
addHtml: "edit",
editType: "input"
} }
] ]
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!