diff --git a/yxt-as-ui/src/api/operation/repairbill.js b/yxt-as-ui/src/api/operation/repairbill.js index 0dc7329b17..b65a68f9d0 100644 --- a/yxt-as-ui/src/api/operation/repairbill.js +++ b/yxt-as-ui/src/api/operation/repairbill.js @@ -75,11 +75,12 @@ export default { }) }, // 打印结算单 - printSettle: function(data) { + printSettlement: function(data) { return request({ - url: '/as/v1/AsBusrepairBill/printSettle', + url: '/as/v1/AsBusrepairBill/printSettlement', method: 'post', - params: data + data: data, + headers: { 'Content-Type': 'application/json' } }) }, // 确认工时费比例初始化 @@ -99,5 +100,13 @@ export default { data: data, headers: { 'Content-Type': 'application/json' } }) + }, + // 根据客户sid获取对应的对接人信息 + getListByCustomerSid: function(data) { + return request({ + url: '/crm/v1/crmdockingpeople/getListByCustomerSid', + method: 'get', + params: data + }) } } diff --git a/yxt-as-ui/src/router/index.js b/yxt-as-ui/src/router/index.js index f4bca1f898..6a12c1ba59 100644 --- a/yxt-as-ui/src/router/index.js +++ b/yxt-as-ui/src/router/index.js @@ -435,7 +435,7 @@ export const constantRoutes = [{ path: '/filing/maintenanceEnterprise', component: () => import('@/views/client/filing/maintenanceEnterprise.vue'), name: 'MaintenanceEnterprise', - meta: { title: '定点企业备案', noCache: true } + meta: { title: '欠款月结客户备案', noCache: true } }, { path: '/customerunit/customerunit', diff --git a/yxt-as-ui/src/views/operation/repairbill/repairbill.vue b/yxt-as-ui/src/views/operation/repairbill/repairbill.vue index 90556ca2c2..630726562c 100644 --- a/yxt-as-ui/src/views/operation/repairbill/repairbill.vue +++ b/yxt-as-ui/src/views/operation/repairbill/repairbill.vue @@ -26,7 +26,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -102,7 +102,7 @@ - + diff --git a/yxt-as-ui/src/views/operation/repairbill/repairbillAdd.vue b/yxt-as-ui/src/views/operation/repairbill/repairbillAdd.vue index b9f4c07ab7..55c3779399 100644 --- a/yxt-as-ui/src/views/operation/repairbill/repairbillAdd.vue +++ b/yxt-as-ui/src/views/operation/repairbill/repairbillAdd.vue @@ -4,12 +4,11 @@
{{ viewTitle }}
- 选择客户 保存 提交 - 退回 + 退回 确认材料费 - 打印结算单 + 打印结算单 结算 关闭
@@ -32,9 +31,9 @@ -
*工单类型
+
*维修单类型
- + @@ -42,7 +41,7 @@
*科目
- + @@ -50,7 +49,7 @@
索赔厂家
- + @@ -60,26 +59,26 @@
*是否外出
- + - +
进厂时间
- +
*预计完工
- +
*服务顾问
- + @@ -87,7 +86,7 @@
班组
- + @@ -95,7 +94,7 @@
主修人
- + @@ -104,16 +103,16 @@
备注(打印)
- +
备注
- +
*特殊标志
- + @@ -125,7 +124,14 @@
*客户
- {{ formobj.customerName }} + +
+
+ {{ formobj.customerName }} +
+ 选择 +
+
联系电话
@@ -153,15 +159,15 @@
行驶里程(Km)
- +
油量(L)
- +
当前里程(Km)
- +
@@ -169,20 +175,28 @@
对接人姓名
- {{ formobj.dockingPeople }} + + + + + +
对接人电话
- {{ formobj.dockingPhone }} + + {{ formobj.dockingPhone }} + +
- +
责任划分
- + @@ -190,7 +204,7 @@
责任比例
- + @@ -198,7 +212,7 @@
是否存在人伤
- + @@ -207,7 +221,7 @@
-
+
- + -
商品(竣工岗位职责:核对出库商品及数量是否与服务项目相符)
+
维修用料(竣工岗位职责:核对出库商品及数量是否与维修项目相符)
前台登记时对商品要求备注
@@ -346,62 +377,87 @@
+ - + - + + + + + +
附加项目
- +
外出费(元)
- + +
+ + 开票金额:{{ formobj.outKPAmount }} +
+
- +
备注
- +
- +
厂家补助(元)
- + +
+ + 开票金额:{{ formobj.subsidyKPAmount }} +
+
- +
备注
- +
- +
施救费(元)
- + +
+ + 开票金额:{{ formobj.rescueKPAmount }} +
+
备注
- +
- +
-
- - - - - - - -
- + + + + + + +
应收合计:
- {{ ysTotal }} = 工时费:{{ gsfTotal }} + 材料费:{{ clfTotal }} + 附加费:{{ fjfTotal }} + 税额:0 + {{ ysTotal }} = 工时费:{{ gsfTotal }} + 材料费:{{ clfTotal }} + 附加费:{{ fjfTotal }}
@@ -538,6 +591,25 @@ 取 消
+ + + + + + + + 财务打印 + 客户打印 + + + + + +
+ 确 定 + 取 消 +
+
@@ -558,6 +630,14 @@ export default { viewTitle: '', viewState: 1, submitdisabled: false, + dialogVisible: false, // 打印结算单 + temp: { + sid: '', + type: '', + createOrgSid: '', + useOrgSid: '', + userSid: '' + }, updateAction: process.env.VUE_APP_BASE_API + '/portal/file/upload', fileList: [], headers: { @@ -568,6 +648,7 @@ export default { claimManufacturer_list: [], // 索赔厂家 group_list: [], // 班组 mainRepairersChange_list: [], // 主修人 + people_list: [], // 对接人 settleVisible: false, // 结算弹框 billType_list: [], // 单据类型 responsibility_list: [], // 责任划分 @@ -664,7 +745,9 @@ export default { invoiceType: '', invoiceTypeKey: '', invoiceCompanySid: '', - invoiceCompany: '' + invoiceCompany: '', + taxRate: '', + taxItems: [] }, insuranceVo: { responsibility: '', @@ -700,8 +783,11 @@ export default { addAmount: '', taxAmount: '', outAmount: '', + outKPAmount: '', subsidyAmount: '', + subsidyKPAmount: '', rescueAmount: '', + rescueKPAmount: '', actualAmount: '', receivableAmount: '', subsidyRemarks: '', @@ -713,7 +799,7 @@ export default { createOrgSid: '' }, rules: { - billType: [{ required: true, message: '工单类型不能为空', trigger: 'change' }], + billType: [{ required: true, message: '维修单类型不能为空', trigger: 'change' }], isGoOut: [{ required: true, message: '是否外出不能为空', trigger: 'change' }], subject: [{ required: true, message: '科目不能为空', trigger: 'change' }], estimatedFinishTime: [{ required: true, message: '预计完工不能为空', trigger: 'change' }], @@ -728,7 +814,7 @@ export default { } }, computed: { - // 计算工时费 = 服务项目列表中所有销售价之和 + // 计算工时费 = 维修项目列表中所有销售价之和 gsfTotal() { let gsf = '0' if (this.formobj.sitemVos.length > 0) { @@ -740,7 +826,7 @@ export default { } return gsf }, - // 计算材料费 = 商品列表中所有销售价 * 数量的和 + // 计算材料费 = 维修用料列表中所有销售价 * 数量的和 clfTotal() { let clf = '0' if (this.formobj.goodsDetailsVos.length > 0) { @@ -771,7 +857,7 @@ export default { ys = Math.round((parseFloat(ys) + parseFloat(this.gsfTotal) + parseFloat(this.clfTotal) + parseFloat(this.fjfTotal)) * 100) / 100 return ys }, - // 优惠 = 服务项目列表中的所有优惠之和 + 商品列表中所有优惠之和 + // 优惠 = 维修项目列表中的所有优惠之和 + 维修用料列表中所有优惠之和 yhTotal() { let yh = '0' if (this.formobj.sitemVos.length > 0) { @@ -907,9 +993,10 @@ export default { day: nowDate.getDate() } this.formobj.createDate = date.year + '-' + (date.month >= 10 ? date.month : '0' + date.month) + '-' + (date.day >= 10 ? date.day : '0' + date.day) - this.formobj.isGoOut = '0' + this.formobj.isGoOut = '2' this.formobj.nodeCode = '1' this.formobj.nodeName = '登记' + this.formobj.invoiceVo.isInvoicing = '0' }, showEdit(sid) { this.viewTitle = '【编辑】维修单' @@ -926,9 +1013,13 @@ export default { } }) }, - selectCustomer() { - this.viewState = 2 - this.$refs['divCus'].showData(this.formobj.deptSid, this.formobj.billType) + chooseCustomer() { + if (this.formobj.billType !== '') { + this.viewState = 2 + this.$refs['divCus'].showData(this.formobj.deptSid, this.formobj.billType) + } else { + this.$message({ showClose: true, type: 'error', message: '请先选择维修单类型' }) + } }, backData(value) { this.viewState = 1 @@ -940,6 +1031,14 @@ export default { this.formobj.vinNo = value.vinNo this.formobj.vehModel = value.vehModel this.formobj.customerSource = value.source + // 单据类型为欠款月结时,对接人信息需要从欠款月结客户中获取对应的对接人信息 + if (this.formobj.billTypeKey === '2') { + req.getListByCustomerSid({ customerSid: this.formobj.customerSid }).then((res) => { + if (res.success) { + this.people_list = res.data + } + }) + } }, billTypeChange(value) { const choose = this.billType_list.filter((item) => item.dictValue === value) @@ -984,6 +1083,16 @@ export default { this.formobj.mainRepairers = '' } }, + dockingPeopleChange(value) { + const choose = this.people_list.filter((item) => item.sid === value) + if (choose.length > 0 && choose !== null) { + this.formobj.dockingPeople = choose[0].name + this.formobj.dockingPhone = choose[0].mobile + } else { + this.formobj.dockingPeople = '' + this.formobj.dockingPhone = '' + } + }, responsibilityChange(value) { const choose = this.responsibility_list.filter((item) => item.dictValue === value) if (choose.length > 0 && choose !== null) { @@ -1040,6 +1149,14 @@ export default { insuranceDelete(index) { this.formobj.insuranceVo.insuranceList.splice(index, 1) }, + isInvoicingChange() { + if (this.formobj.invoiceVo.isInvoicing === '1') { + this.formobj.invoiceVo.taxItems = ['维修项目', '维修用料', '附加项目', '其它附加项目'] + } else { + this.formobj.invoiceVo.taxItems = [] + } + this.countChange() + }, invoiceTypeChange(value) { const choose = this.invoiceType_list.filter((item) => item.dictValue === value) if (choose.length > 0 && choose !== null) { @@ -1048,6 +1165,80 @@ export default { this.formobj.invoiceVo.invoiceTypeKey = '' } }, + // 发票信息中的税率或加税点项目发生变化时需要重新计算相关内容 + countChange() { + // 维修项目不为空时 + if (this.formobj.sitemVos.length > 0) { + // 加税点项目是否包含维修项目 + if (this.formobj.invoiceVo.taxItems.includes('维修项目')) { + this.formobj.sitemVos.forEach((e) => { + // 是,销售价 = 原销售价 + 原销售价 * (1 + 税率) + e.price = Math.round((parseFloat(e.sitemPrice) + parseFloat(e.sitemPrice) * (parseFloat(1) + parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 + this.computeYHAndXSJE(e) + }) + } else { + this.formobj.sitemVos.forEach((k) => { + // 否,销售价 = 原销售价 + k.price = k.sitemPrice + this.computeYHAndXSJE(k) + }) + } + } + // 维修用料不为空时 + if (this.formobj.goodsDetailsVos.length > 0) { + // 加税点项目是否包含维修用料 + if (this.formobj.invoiceVo.taxItems.includes('维修用料')) { + this.formobj.goodsDetailsVos.forEach((e) => { + // 是 + if (e.isTaxRate) { + // 商品进货价含税则销售价 = 原销售价 + e.price = e.goodsDetailsPrice + this.computeYHAndJE(e) + } else { + // 商品进货价不含税则销售价 = 原销售价 + 原销售价 * (1 + 税率) + e.price = Math.round((parseFloat(e.goodsDetailsPrice) + parseFloat(e.goodsDetailsPrice) * (parseFloat(1) + parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 + this.computeYHAndJE(e) + } + }) + } else { + this.formobj.goodsDetailsVos.forEach((k) => { + // 否,销售价 = 原销售价 + k.price = k.goodsDetailsPrice + this.computeYHAndJE(k) + }) + } + } + // 其它附加项目不为空时 + if (this.formobj.aitemVos.length > 0) { + // 加税点项目是否包含其它附加项目 + if (this.formobj.invoiceVo.taxItems.includes('其它附加项目')) { + this.formobj.aitemVos.forEach((e) => { + // 是,销售价 = 原销售价 + 原销售价 * (1 + 税率) + e.price = Math.round((parseFloat(e.aitemPrice) + parseFloat(e.aitemPrice) * (parseFloat(1) + parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 + }) + } else { + this.formobj.aitemVos.forEach((k) => { + // 否,销售价 = 原销售价 + k.price = k.aitemPrice + }) + } + } + // 附加项目,加税点项目是否包含附加项目 + if (this.formobj.invoiceVo.taxItems.includes('附加项目')) { + // 是 + // 外出费开票金额 = 原外出费 + 原外出费 * (1 + 税率) + this.formobj.outKPAmount = Math.round((parseFloat(this.formobj.outAmount !== '' ? this.formobj.outAmount : '0') + parseFloat(this.formobj.outAmount !== '' ? this.formobj.outAmount : '0') * (parseFloat(1) + parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 + // 厂家补助开票金额 = 原厂家补助 + 原厂家补助 * (1 + 税率) + this.formobj.subsidyKPAmount = Math.round((parseFloat(this.formobj.subsidyAmount !== '' ? this.formobj.subsidyAmount : '0') + parseFloat(this.formobj.subsidyAmount !== '' ? this.formobj.subsidyAmount : '0') * (parseFloat(1) + parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 + // 施救费开票金额 = 原施救费 + 原施救费 * (1 + 税率) + this.formobj.rescueKPAmount = Math.round((parseFloat(this.formobj.rescueAmount !== '' ? this.formobj.rescueAmount : '0') + parseFloat(this.formobj.rescueAmount !== '' ? this.formobj.rescueAmount : '0') * (parseFloat(1) + parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 + } else { + // 否 + this.formobj.outKPAmount = '' + this.formobj.subsidyKPAmount = '' + this.formobj.rescueKPAmount = '' + } + }, serviceAdd() { this.formobj.sitemVos.push({ serviceItemSid: '', @@ -1060,6 +1251,7 @@ export default { hourPrice: '', hours: '', price: '', + sitemPrice: '', // 原销售价 discount: '', discountAmount: '', amount: '', @@ -1097,7 +1289,13 @@ export default { row.examineHourPrice = value.examineHourPrice row.hourPrice = value.hourPrice row.hours = value.hours - row.price = value.price + row.sitemPrice = value.price + if (this.formobj.invoiceVo.isInvoicing === '1' && this.formobj.invoiceVo.taxItems.length > 0 && this.formobj.invoiceVo.taxItems.includes('维修项目')) { + // 是否开发票为是且选择加税点的项目中包含维修项目,则销售价 = 原销售价 + 原销售价 * ( 1 + 税率 ) + row.price = Math.round((parseFloat(row.sitemPrice) + parseFloat(row.sitemPrice) * (parseFloat(1) + parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 + } else { + row.price = row.sitemPrice + } row.discount = '10' row.discountAmount = '0' row.amount = row.price @@ -1120,7 +1318,18 @@ export default { }) row.staffNameList = aa }, - // 计算优惠、销售金额 -- 服务项目列表 + partsSellerChange(row, list) { + const aa = [] + list.forEach((e) => { + this.user_list.forEach((k) => { + if (e === k.sid) { + aa.push(k.name) + } + }) + }) + row.partsSellers = aa + }, + // 计算优惠、销售金额 -- 维修项目列表 computeYHAndXSJE(row) { // 计算优惠(销售价 * (1 - (折扣 * 0.1))) row.discountAmount = Math.round((parseFloat(row.price === '' ? '0' : row.price) * Math.round((parseFloat(1) - parseFloat(row.discount === '' ? '0' : row.discount) * parseFloat(0.1)) * 100) / 100) * 100) / 100 @@ -1131,7 +1340,7 @@ export default { row.amount = Math.round((parseFloat(row.price === '' ? '0' : row.price) - parseFloat(row.discountAmount === '' ? '0' : row.discountAmount)) * 100) / 100 } }, - // 计算优惠、销售金额 -- 上你列表 + // 计算优惠、销售金额 -- 维修用料列表 computeYHAndJE(row) { // 计算优惠(销售价 * 数量 * (1 - (折扣 * 0.1))) row.discountAmount = Math.round((parseFloat(row.price === '' ? '0' : row.price) * parseFloat(row.count !== '' ? row.count : '0') * Math.round((parseFloat(1) - parseFloat(row.discount === '' ? '0' : row.discount) * parseFloat(0.1)) * 100) / 100) * 100) / 100 @@ -1142,11 +1351,48 @@ export default { row.amount = Math.round((parseFloat(row.price === '' ? '0' : row.price) * parseFloat(row.count !== '' ? row.count : '0') - parseFloat(row.discountAmount === '' ? '0' : row.discountAmount)) * 100) / 100 } }, + // 计算外出费开票金额 -- 附加项目 + outKPAountInput() { + // 附加项目,加税点项目是否包含附加项目 + if (this.formobj.invoiceVo.taxItems.includes('附加项目')) { + // 是 + // 外出费开票金额 = 原外出费 + 原外出费 * (1 + 税率) + this.formobj.outKPAmount = Math.round((parseFloat(this.formobj.outAmount !== '' ? this.formobj.outAmount : '0') + parseFloat(this.formobj.outAmount !== '' ? this.formobj.outAmount : '0') * (parseFloat(1) + parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 + } else { + // 否 + this.formobj.outKPAmount = '' + } + }, + // 计算厂家补助开票金额 -- 附加项目 + subsidyKPAountInput() { + // 附加项目,加税点项目是否包含附加项目 + if (this.formobj.invoiceVo.taxItems.includes('附加项目')) { + // 是 + // 厂家补助开票金额 = 原厂家补助 + 原厂家补助 * (1 + 税率) + this.formobj.subsidyKPAmount = Math.round((parseFloat(this.formobj.subsidyAmount !== '' ? this.formobj.subsidyAmount : '0') + parseFloat(this.formobj.subsidyAmount !== '' ? this.formobj.subsidyAmount : '0') * (parseFloat(1) + parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 + } else { + // 否 + this.formobj.subsidyKPAmount = '' + } + }, + // 计算施救费开票金额 -- 附加项目 + rescueKPAountInput() { + // 附加项目,加税点项目是否包含附加项目 + if (this.formobj.invoiceVo.taxItems.includes('附加项目')) { + // 是 + // 施救费开票金额 = 原施救费 + 原施救费 * (1 + 税率) + this.formobj.rescueKPAmount = Math.round((parseFloat(this.formobj.rescueAmount !== '' ? this.formobj.rescueAmount : '0') + parseFloat(this.formobj.rescueAmount !== '' ? this.formobj.rescueAmount : '0') * (parseFloat(1) + parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 + } else { + // 否 + this.formobj.rescueKPAmount = '' + } + }, subjoinAdd() { this.formobj.aitemVos.push({ aitemSid: '', aitemName: '', - price: '' + price: '', + aitemPrice: '' // 原销售价 }) }, subjoinInput(value) { @@ -1171,7 +1417,13 @@ export default { subjoinCurrentChange(value, row) { row.aitemSid = value.sid row.aitemName = value.aitemName - row.price = value.price + row.aitemPrice = value.price + if (this.formobj.invoiceVo.isInvoicing === '1' && this.formobj.invoiceVo.taxItems.length > 0 && this.formobj.invoiceVo.taxItems.includes('其它附加项目')) { + // 是否开发票为是且选择加税点的项目中包含其它附加项目,则销售价 = 原销售价 + 原销售价 * ( 1 + 税率 ) + row.price = Math.round((parseFloat(row.aitemPrice) + parseFloat(row.aitemPrice) * (parseFloat(1) + parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 + } else { + row.price = row.aitemPrice + } document.body.click() }, handleSuccess(resp, file, fileList) { @@ -1196,8 +1448,22 @@ export default { this.formobj.operatorSid = window.sessionStorage.getItem('userSid') this.$refs['form_obj'].validate((valid) => { if (valid) { + if (this.formobj.billTypeKey === '2' && this.formobj.dockingPeople === '') { + this.$message({ showClose: true, type: 'error', message: '维修单类类型为欠款月结,对接人信息不能为空' }) + return + } + if (this.formobj.subject === '保外' && this.formobj.invoiceVo.isInvoicing === '1') { + if (this.formobj.invoiceVo.invoiceType === '') { + this.$message({ showClose: true, type: 'error', message: '发票信息中是否开发票为是,开票类型不能为空' }) + return + } + if (this.formobj.invoiceVo.taxRate === '') { + this.$message({ showClose: true, type: 'error', message: '发票信息中是否开发票为是,税率不能为空' }) + return + } + } if (this.formobj.sitemVos.length === 0) { - this.$message({ showClose: true, type: 'error', message: '服务项目列表不能为空' }) + this.$message({ showClose: true, type: 'error', message: '维修项目列表不能为空' }) return } this.formobj.hourAmount = this.gsfTotal // 工时费 @@ -1226,8 +1492,22 @@ export default { this.formobj.operatorSid = window.sessionStorage.getItem('userSid') this.$refs['form_obj'].validate((valid) => { if (valid) { + if (this.formobj.billTypeKey === '2' && this.formobj.dockingPeople === '') { + this.$message({ showClose: true, type: 'error', message: '维修单类类型为欠款月结,对接人信息不能为空' }) + return + } + if (this.formobj.subject === '保外' && this.formobj.invoiceVo.isInvoicing === '1') { + if (this.formobj.invoiceVo.invoiceType === '') { + this.$message({ showClose: true, type: 'error', message: '发票信息中是否开发票为是,开票类型不能为空' }) + return + } + if (this.formobj.invoiceVo.taxRate === '') { + this.$message({ showClose: true, type: 'error', message: '发票信息中是否开发票为是,税率不能为空' }) + return + } + } if (this.formobj.sitemVos.length === 0) { - this.$message({ showClose: true, type: 'error', message: '服务项目列表不能为空' }) + this.$message({ showClose: true, type: 'error', message: '维修项目列表不能为空' }) return } this.submitdisabled = true @@ -1250,7 +1530,7 @@ export default { this.$refs['form_obj'].validate((valid) => { if (valid) { if (this.formobj.sitemVos.length === 0) { - this.$message({ showClose: true, type: 'error', message: '服务项目列表不能为空' }) + this.$message({ showClose: true, type: 'error', message: '维修项目列表不能为空' }) return } this.submitdisabled = true @@ -1321,7 +1601,18 @@ export default { }) }, toPrintSettle() { - req.printSettle({ sid: this.formobj.sid }).then((res) => { + if (this.formobj.subject === '保内') { + this.dialogVisible = true + } else { + this.printSettle() + } + }, + printSettle() { + this.temp.sid = this.formobj.sid + this.temp.createOrgSid = this.formobj.createOrgSid + this.temp.useOrgSid = this.formobj.deptSid + this.temp.userSid = this.formobj.createBySid + req.printSettlement(this.temp).then((res) => { if (res.success) { var xhr = new XMLHttpRequest() xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + res.data + '&outFileName=' + '结算单', true) @@ -1346,6 +1637,14 @@ export default { } }) }, + handleConfirm() { + if (this.temp.type !== '') { + this.dialogVisible = false + this.printSettle() + } else { + this.$message({ showClose: true, type: 'error', message: '打印类型不能为空' }) + } + }, resetState() { this.viewState = 1 }, @@ -1405,7 +1704,9 @@ export default { invoiceType: '', invoiceTypeKey: '', invoiceCompanySid: '', - invoiceCompany: '' + invoiceCompany: '', + taxRate: '', + taxItems: [] }, insuranceVo: { responsibility: '', @@ -1441,8 +1742,11 @@ export default { addAmount: '', taxAmount: '', outAmount: '', + outKPAmount: '', subsidyAmount: '', + subsidyKPAmount: '', rescueAmount: '', + rescueKPAmount: '', actualAmount: '', receivableAmount: '', subsidyRemarks: '', diff --git a/yxt-as-ui/src/views/operation/repairbill/repairbillBYLeaveFactory.vue b/yxt-as-ui/src/views/operation/repairbill/repairbillBYLeaveFactory.vue index 40abe7d9f0..22f665cb1a 100644 --- a/yxt-as-ui/src/views/operation/repairbill/repairbillBYLeaveFactory.vue +++ b/yxt-as-ui/src/views/operation/repairbill/repairbillBYLeaveFactory.vue @@ -2,7 +2,7 @@
- +
@@ -26,7 +26,7 @@ - + @@ -97,7 +97,7 @@ {{ scope.row.outDoorState == '1' ? '是' : scope.row.outDoorState == '0' ? '否' :'' }} - + @@ -107,7 +107,7 @@ - + diff --git a/yxt-as-ui/src/views/operation/repairbill/repairbillByBeCompleted.vue b/yxt-as-ui/src/views/operation/repairbill/repairbillByBeCompleted.vue index 1e5c7b70f1..150f91e8b4 100644 --- a/yxt-as-ui/src/views/operation/repairbill/repairbillByBeCompleted.vue +++ b/yxt-as-ui/src/views/operation/repairbill/repairbillByBeCompleted.vue @@ -2,7 +2,7 @@
- +
@@ -26,7 +26,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -211,13 +211,6 @@ export default { btnKey: 'toEdit', btnLabel: '编辑' }, - { - type: 'danger', - size: 'small', - icon: 'del', - btnKey: 'doDel', - btnLabel: '删除' - }, { type: 'info', size: 'small', @@ -314,9 +307,6 @@ export default { case 'toEdit': this.toEdit() break - case 'doDel': - this.doDel() - break case 'doClose': this.doClose() break @@ -435,36 +425,6 @@ export default { this.viewState = 4 this.$refs['divInfo'].showInfo(row) }, - // 删除 - doDel() { - if (this.sids.length === 0) { - this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' }) - return - } - const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' - this.$confirm(tip, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - const loading = this.$loading({ - lock: true, - text: 'Loading', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }) - req.deleteBySids(this.sids).then(resp => { - if (resp.success) { - this.$message({ type: 'success', message: resp.msg, showClose: true }) - } - this.getList() - loading.close() - }).catch(e => { - loading.close() - }) - }).catch(() => { - }) - }, // 修改、编辑、详情返回列表页面 resetState() { this.viewState = 1 diff --git a/yxt-as-ui/src/views/operation/repairbill/repairbillByMaintain.vue b/yxt-as-ui/src/views/operation/repairbill/repairbillByMaintain.vue index ff645f93bf..6efb266870 100644 --- a/yxt-as-ui/src/views/operation/repairbill/repairbillByMaintain.vue +++ b/yxt-as-ui/src/views/operation/repairbill/repairbillByMaintain.vue @@ -2,7 +2,7 @@
- +
@@ -26,7 +26,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -168,13 +168,6 @@ export default { btnKey: 'toEdit', btnLabel: '编辑' }, - { - type: 'danger', - size: 'small', - icon: 'del', - btnKey: 'doDel', - btnLabel: '删除' - }, { type: 'info', size: 'small', @@ -268,9 +261,6 @@ export default { case 'toEdit': this.toEdit() break - case 'doDel': - this.doDel() - break case 'doClose': this.doClose() break @@ -363,36 +353,6 @@ export default { this.viewState = 4 this.$refs['divInfo'].showInfo(row) }, - // 删除 - doDel() { - if (this.sids.length === 0) { - this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' }) - return - } - const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' - this.$confirm(tip, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - const loading = this.$loading({ - lock: true, - text: 'Loading', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }) - req.deleteBySids(this.sids).then(resp => { - if (resp.success) { - this.$message({ type: 'success', message: resp.msg, showClose: true }) - } - this.getList() - loading.close() - }).catch(e => { - loading.close() - }) - }).catch(() => { - }) - }, // 修改、编辑、详情返回列表页面 resetState() { this.viewState = 1 diff --git a/yxt-as-ui/src/views/operation/repairbill/repairbillBySendWork.vue b/yxt-as-ui/src/views/operation/repairbill/repairbillBySendWork.vue index 82f9708151..c3f06af214 100644 --- a/yxt-as-ui/src/views/operation/repairbill/repairbillBySendWork.vue +++ b/yxt-as-ui/src/views/operation/repairbill/repairbillBySendWork.vue @@ -2,7 +2,7 @@
- +
@@ -26,7 +26,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -168,13 +168,6 @@ export default { btnKey: 'toEdit', btnLabel: '编辑' }, - { - type: 'danger', - size: 'small', - icon: 'del', - btnKey: 'doDel', - btnLabel: '删除' - }, { type: 'info', size: 'small', @@ -268,9 +261,6 @@ export default { case 'toEdit': this.toEdit() break - case 'doDel': - this.doDel() - break case 'doClose': this.doClose() break @@ -363,36 +353,6 @@ export default { this.viewState = 4 this.$refs['divInfo'].showInfo(row) }, - // 删除 - doDel() { - if (this.sids.length === 0) { - this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' }) - return - } - const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' - this.$confirm(tip, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - const loading = this.$loading({ - lock: true, - text: 'Loading', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }) - req.deleteBySids(this.sids).then(resp => { - if (resp.success) { - this.$message({ type: 'success', message: resp.msg, showClose: true }) - } - this.getList() - loading.close() - }).catch(e => { - loading.close() - }) - }).catch(() => { - }) - }, // 修改、编辑、详情返回列表页面 resetState() { this.viewState = 1 diff --git a/yxt-as-ui/src/views/operation/repairbill/repairbillBySettleAccounts.vue b/yxt-as-ui/src/views/operation/repairbill/repairbillBySettleAccounts.vue index 99f9d4d3a3..e09b6a41d3 100644 --- a/yxt-as-ui/src/views/operation/repairbill/repairbillBySettleAccounts.vue +++ b/yxt-as-ui/src/views/operation/repairbill/repairbillBySettleAccounts.vue @@ -2,7 +2,7 @@
- +
@@ -26,7 +26,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -169,13 +169,6 @@ export default { btnKey: 'toEdit', btnLabel: '编辑' }, - { - type: 'danger', - size: 'small', - icon: 'del', - btnKey: 'doDel', - btnLabel: '删除' - }, { type: 'info', size: 'small', @@ -269,9 +262,6 @@ export default { case 'toEdit': this.toEdit() break - case 'doDel': - this.doDel() - break case 'doClose': this.doClose() break @@ -364,36 +354,6 @@ export default { this.viewState = 4 this.$refs['divInfo'].showInfo(row) }, - // 删除 - doDel() { - if (this.sids.length === 0) { - this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' }) - return - } - const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' - this.$confirm(tip, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - const loading = this.$loading({ - lock: true, - text: 'Loading', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }) - req.deleteBySids(this.sids).then(resp => { - if (resp.success) { - this.$message({ type: 'success', message: resp.msg, showClose: true }) - } - this.getList() - loading.close() - }).catch(e => { - loading.close() - }) - }).catch(() => { - }) - }, // 修改、编辑、详情返回列表页面 resetState() { this.viewState = 1 diff --git a/yxt-as-ui/src/views/operation/repairbill/repairbillInfo.vue b/yxt-as-ui/src/views/operation/repairbill/repairbillInfo.vue index ecc8d7e751..fe36bfc680 100644 --- a/yxt-as-ui/src/views/operation/repairbill/repairbillInfo.vue +++ b/yxt-as-ui/src/views/operation/repairbill/repairbillInfo.vue @@ -26,7 +26,7 @@ -
工单类型
+
维修单类型
{{ formobj.billType }}
@@ -137,7 +137,7 @@
- +
责任划分
@@ -162,7 +162,7 @@
- +
是否开发票
@@ -172,17 +172,34 @@
发票类型
{{ formobj.invoiceVo.invoiceType }}
+ +
税率
+ {{ formobj.invoiceVo.taxRate }} +
+
+
开票单位
{{ formobj.invoiceVo.invoiceCompany }}
+ +
加税点的项目
+ + + + + + + + +
-
服务项目
+
维修项目
- + @@ -194,7 +211,7 @@ -
商品
+
维修用料
前台登记时对商品要求备注
@@ -203,24 +220,33 @@
+ - + - + + + +
附加项目
外出费(元)
- {{ formobj.outAmount }} + +
+ {{ formobj.outAmount }} + 开票金额:{{ formobj.outKPAmount }} +
+
备注
@@ -230,7 +256,12 @@
厂家补助(元)
- {{ formobj.subsidyAmount }} + +
+ {{ formobj.subsidyAmount }} + 开票金额:{{ formobj.subsidyKPAmount }} +
+
备注
@@ -240,7 +271,12 @@
施救费(元)
- {{ formobj.rescueAmount }} + +
+ {{ formobj.rescueAmount }} + 开票金额:{{ formobj.rescueKPAmount }} +
+
备注
@@ -263,7 +299,7 @@
应收合计:
- {{ ysTotal }} = 工时费:{{ gsfTotal }} + 材料费:{{ clfTotal }} + 附加费:{{ fjfTotal }} + 税额:0 + {{ ysTotal }} = 工时费:{{ gsfTotal }} + 材料费:{{ clfTotal }} + 附加费:{{ fjfTotal }}
@@ -355,7 +391,9 @@ export default { invoiceType: '', invoiceTypeKey: '', invoiceCompanySid: '', - invoiceCompany: '' + invoiceCompany: '', + taxRate: '', + taxItems: [] }, insuranceVo: { responsibility: '', @@ -391,8 +429,11 @@ export default { addAmount: '', taxAmount: '', outAmount: '', + outKPAmount: '', subsidyAmount: '', + subsidyKPAmount: '', rescueAmount: '', + rescueKPAmount: '', actualAmount: '', receivableAmount: '', subsidyRemarks: '', @@ -407,7 +448,7 @@ export default { } }, computed: { - // 计算工时费 = 服务项目列表中所有销售价之和 + // 计算工时费 = 维修项目列表中所有销售价之和 gsfTotal() { let gsf = '0' if (this.formobj.sitemVos.length > 0) { @@ -450,7 +491,7 @@ export default { ys = Math.round((parseFloat(ys) + parseFloat(this.gsfTotal) + parseFloat(this.clfTotal) + parseFloat(this.fjfTotal)) * 100) / 100 return ys }, - // 优惠 = 服务项目列表中的所有优惠之和 + 商品列表中所有优惠之和 + // 优惠 = 维修项目列表中的所有优惠之和 + 商品列表中所有优惠之和 yhTotal() { let yh = '0' if (this.formobj.sitemVos.length > 0) { @@ -492,6 +533,13 @@ export default { } }) } + if (this.formobj.goodsDetailsVos.length > 0) { + this.formobj.goodsDetailsVos.forEach((e) => { + if (e.partsSellers.length > 0) { + e.partsSellers = e.partsSellers.join(',') + } + }) + } } }) }, @@ -560,7 +608,9 @@ export default { invoiceType: '', invoiceTypeKey: '', invoiceCompanySid: '', - invoiceCompany: '' + invoiceCompany: '', + taxRate: '', + taxItems: [] }, insuranceVo: { responsibility: '', @@ -596,8 +646,11 @@ export default { addAmount: '', taxAmount: '', outAmount: '', + outKPAmount: '', subsidyAmount: '', + subsidyKPAmount: '', rescueAmount: '', + rescueKPAmount: '', actualAmount: '', receivableAmount: '', subsidyRemarks: '',