diff --git a/package.json b/package.json index 0d67aa4f..02b3cafd 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "html2canvas": "^1.0.0-alpha.12", "jquery": "^3.3.1", "js-cookie": "2.2.0", - "jspdf": "^1.4.1", + "jspdf": "^1.5.2", "node-sass": "^4.10.0", "normalize.css": "7.0.0", "nprogress": "0.2.0", diff --git a/src/api/Outsourcing/OutsourcingPaymentPlanManagement.js b/src/api/Outsourcing/OutsourcingPaymentPlanManagement.js index 4b1ef682..b3cbc855 100644 --- a/src/api/Outsourcing/OutsourcingPaymentPlanManagement.js +++ b/src/api/Outsourcing/OutsourcingPaymentPlanManagement.js @@ -74,38 +74,38 @@ export function getParts(Number, pageCurrent, pageSize) { }) } // 增加 -export function edittype(num1, num2, num3, num4, num5, num6, num7) { +export function edittype(num1, num2, num3, num4, num5, num6, num7, num8) { return request({ url: '', method: 'post', data: { type: '2', name: '车间生产管理工艺_外协发票管理_增加数据', - param: '外协加工任务单流水号=' + num1 + '&发票号=' + num2 + '&开户行=' + num3 + '&开票时间=' + num4 + '&开票金额=' + num5 + '&接收人=' + num6 + '&接收时间=' + num7 + param: '外协加工任务单流水号=' + num1 + '&发票号=' + num2 + '&开户行=' + num3 + '&开票时间=' + num4 + '&开票金额=' + num5 + '&接收人=' + num6 + '&接收时间=' + num7 + '&备注=' + num8 } }) } // 编辑 -export function handlechange(CoManufacturerFlowNumber, ManufacturerNumber, ManufacturerName, ManufacturerAbbreviation, address, roleName, phNumber, Fax, Remarks, category, attention, EquipmentCondition) { +export function handlechange(num, num2, num3, num4, num5, num6, num7, num8) { return request({ url: '', method: 'post', data: { type: '2', - name: '车间生产管理工艺_基础表_外协厂家_修改数据', - param: '外协厂家流水号=' + CoManufacturerFlowNumber + '&序号=' + ManufacturerNumber + '&外协厂家名称=' + ManufacturerName + '&外协厂家简称=' + ManufacturerAbbreviation + '&地址=' + address + '&联系人=' + roleName + '&电话=' + phNumber + '&传真=' + Fax + '&备注=' + Remarks + '&类别=' + category + '&关注=' + attention + '&设备情况=' + EquipmentCondition + name: '车间生产管理工艺_外协发票管理_编辑数据', + param: 'id=' + num + '&发票号=' + num2 + '&开户行=' + num3 + '&开票时间=' + num4 + '&开票金额=' + num5 + '&接收人=' + num6 + '&接收时间=' + num7 + '&备注=' + num8 } }) } // 删除 -export function handledelete(CoManufacturerFlowNumber) { +export function handledelete(num) { return request({ url: '', method: 'post', data: { type: '2', - name: '车间生产管理工艺_基础表_外协厂家_删除数据', - param: '外协厂家流水号=' + CoManufacturerFlowNumber + '=int' + name: '车间生产管理工艺_外协发票管理_删除数据', + param: 'id=' + num } }) } diff --git a/src/views/Outsourcing/OutsourcingPaymentPlanManagement/index.vue b/src/views/Outsourcing/OutsourcingPaymentPlanManagement/index.vue index 6f48a088..0f00e958 100644 --- a/src/views/Outsourcing/OutsourcingPaymentPlanManagement/index.vue +++ b/src/views/Outsourcing/OutsourcingPaymentPlanManagement/index.vue @@ -170,14 +170,20 @@ {{ scope.row.扣款说明 }} - + - + - + + + + + + +
- - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - + + + @@ -336,10 +374,21 @@ import { initOutHelp, searchtable, payTime, WithdrawingEdit, getParts, edittype, export default { data() { return { + fukuanshijian: '', title1: '', dialogFormVisible: false, + renwudan: '', count1: 0, - form: {}, + count2: 0, + form: { + 发票号: '', + 开户行: '', + 开票时间: '', + 开票金额: '', + 接收人: '', + 接收时间: '', + 备注: '' + }, 实际付款时间: '', loading: false, loading2: false, @@ -352,6 +401,8 @@ export default { 扣款说明: '' }, rules: { + 发票号: [{ required: true, message: '请输入发票号', trigger: 'blur' }], + 开票金额: [{ required: true, message: '请输入开票金额', trigger: 'blur' }], 扣款说明: [{ required: true, message: '请输入扣款说明', trigger: 'blur' }] }, date1: '', @@ -501,8 +552,26 @@ export default { this.loading2 = true this.tableData2 = [] this.zhongjianbianliang = row.外协加工任务单流水号 + this.fukuanshijian = row.实际付款时间 getParts(row.外协加工任务单流水号, this.pageCurrent2, this.pageSize2).then(response => { - console.log(response.data) + for (let i = 0; i < response.data.rows.length; i++) { + response.data.rows[i].开票时间 = response.data.rows[i].开票时间.substring(0, response.data.rows[i].开票时间.indexOf(' ')) + response.data.rows[i].接收时间 = response.data.rows[i].接收时间.substring(0, response.data.rows[i].接收时间.indexOf(' ')) + } + this.tableData2 = response.data.rows + this.total2 = response.data.total + }).then(() => { + this.loading2 = false + }) + }, + getParts2() { + this.loading2 = true + this.tableData2 = [] + getParts(this.zhongjianbianliang, this.pageCurrent2, this.pageSize2).then(response => { + for (let i = 0; i < response.data.rows.length; i++) { + response.data.rows[i].开票时间 = response.data.rows[i].开票时间.substring(0, response.data.rows[i].开票时间.indexOf(' ')) + response.data.rows[i].接收时间 = response.data.rows[i].接收时间.substring(0, response.data.rows[i].接收时间.indexOf(' ')) + } this.tableData2 = response.data.rows this.total2 = response.data.total }).then(() => { @@ -510,27 +579,32 @@ export default { }) }, // 点击增加 - editType1(formName) { + editType1(row, formName) { this.count1 = this.count1 + 1 if (this.count1 !== 1) { this.$refs[formName].resetFields() } this.title1 = '增加' - this.form.ManufacturerName = '' + this.renwudan = row.外协加工任务单流水号 + this.form.发票号 = '' + this.form.开户行 = '' + this.form.开票时间 = '' + this.form.开票金额 = '' + this.form.接收人 = '' + this.form.接收时间 = '' + this.form.备注 = '' this.dialogFormVisible = true }, // 增加确定 editType() { - edittype(this.form.ManufacturerNumber, this.form.ManufacturerName, this.form.ManufacturerAbbreviation, this.form.address, this.form.roleName, this.form.phNumber, this.form.Fax, this.form.Remarks, this.form.category, this.form.attention, this.form.EquipmentCondition).then(response => { + edittype(this.renwudan, this.form.发票号, this.form.开户行, this.form.开票时间, this.form.开票金额, this.form.接收人, this.form.接收时间, this.form.备注).then(response => { if (response.data[0].result === '1') { this.$notify({ title: '成功', message: '信息增加成功', type: 'success' }) - this.pageCurrent = 1 - this.pageSize = 10 - this.searchTable() + this.getParts2() } else { this.$message.error('信息增加失败') } @@ -543,31 +617,27 @@ export default { if (this.count2 !== 1) { this.$refs[formName].resetFields() } - this.form.ManufacturerNumber = row.序号 - this.form.ManufacturerName = row.外协厂家名称 - this.form.address = row.地址 - this.form.roleName = row.联系人 - this.form.phNumber = row.电话 - this.form.Fax = row.传真 - this.form.Remarks = row.备注 - this.form.category = row.类别 - this.form.EquipmentCondition = row.设备情况 - this.form.ManufacturerAbbreviation = row.外协厂家简称 - this.form.attention = row.关注 + this.form.发票号 = row.发票号 + this.form.开户行 = row.开户行 + this.form.开票时间 = row.开票时间 + this.form.开票金额 = row.开票金额 + this.form.接收人 = row.接收人 + this.form.接收时间 = row.接收时间 + this.form.备注 = row.备注 this.dialogFormVisible = true this.title1 = '编辑' - this.CoManufacturerFlowNumber1 = row.外协厂家流水号 + this.CoManufacturerFlowNumber1 = row.id }, // 编辑确定 handleChange() { - handlechange(this.CoManufacturerFlowNumber1, this.form.ManufacturerNumber, this.form.ManufacturerName, this.form.ManufacturerAbbreviation, this.form.address, this.form.roleName, this.form.phNumber, this.form.Fax, this.form.Remarks, this.form.category, this.form.attention, this.form.EquipmentCondition).then(response => { + handlechange(this.CoManufacturerFlowNumber1, this.form.发票号, this.form.开户行, this.form.开票时间, this.form.开票金额, this.form.接收人, this.form.接收时间, this.form.备注).then(response => { if (response.data[0].result === '1') { this.$notify({ title: '成功', message: '信息修改成功', type: 'success' }) - this.searchTable() + this.getParts2() } else { this.$message.error('信息修改失败') } @@ -600,14 +670,17 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { - handledelete(row.外协厂家流水号).then(response => { + handledelete(row.id).then(response => { + if (this.tableData2 && this.tableData2.length === 1 && this.pageCurrent2 > 1) { + this.pageCurrent2-- + } if (response.data[0].result === '1') { this.$notify({ title: '成功', message: '信息删除成功', type: 'success' }) - this.searchTable() + this.getParts2() } else { this.$message.error('信息删除失败') } @@ -632,19 +705,12 @@ export default { handleSizeChange2(val) { this.pageCurrent2 = 1 this.pageSize2 = val - this.tableData2 = [] - getParts(this.zhongjianbianliang, this.pageCurrent2, this.pageSize2).then(response => { - this.tableData2 = response.data.rows - this.total2 = response.data.total - }) + this.getParts2() }, handleCurrentChange2(val) { this.pageCurrent2 = val this.tableData2 = [] - getParts(this.zhongjianbianliang, this.pageCurrent2, this.pageSize2).then(response => { - this.tableData2 = response.data.rows - this.total2 = response.data.total - }) + this.getParts2() } } }