From 8aea1374d9b92d08c308bc16c38e036a0fcc0155 Mon Sep 17 00:00:00 2001 From: "liulujia@meswork.com" Date: Fri, 7 Feb 2020 12:56:11 +0800 Subject: [PATCH] 20200207LLJV1 --- .../WorkshopProcurement/OfflineProcurement.js | 10 +- .../OutsourcingMaterialsSearch.js | 10 +- .../OfflineProcurement/index.vue | 88 ++++++++------- .../OutsourcingMaterialsSearch/index.vue | 104 +++++++++++++++--- .../RequestOutsourcingMaterials/index.vue | 4 +- 5 files changed, 150 insertions(+), 66 deletions(-) diff --git a/src/api/WorkshopProcurement/OfflineProcurement.js b/src/api/WorkshopProcurement/OfflineProcurement.js index 5ff7f799..8d17501e 100644 --- a/src/api/WorkshopProcurement/OfflineProcurement.js +++ b/src/api/WorkshopProcurement/OfflineProcurement.js @@ -49,15 +49,14 @@ export function deletePurchaseOrder(PurchaseOrderNameValue) { }) } // 查询采购单 -export function searchPurchaseOrder(pageCurrent, pageSize, check1, num, check3, name2) { +export function searchPurchaseOrder(check1, num, check3, name2) { return request({ url: '', method: 'post', data: { type: '1', name: '备料管理_离线采购计划_查询数据', - param: `离线采购计划编号_check=${check1}&离线采购计划编号=${num}&供应商流水号_check=${check3}&供应商流水号=${name2}`, - Pagination: pageCurrent + '&' + pageSize + param: `离线采购计划编号_check=${check1}&离线采购计划编号=${num}&供应商流水号_check=${check3}&供应商流水号=${name2}` } }) } @@ -109,15 +108,14 @@ export function getGroups(stepNumber) { }) } -export function getTable(checkbox_Machine, Machine, checkbox_Group, Group, checkbox_number, number, k, m, pageCurrent, pageSize, ordername, order) { +export function getTable(checkbox_Machine, Machine, checkbox_Group, Group, checkbox_number, number, k, m, ordername, order) { return request({ url: '', method: 'post', data: { type: '1', name: '车间生产管理工艺_零件工序_查询数据_已编制工序的全部零件及工序_横向赋值新建存储过程_新', - param: '项目流水号_check=0=string&机床流水号_check=' + checkbox_Machine + '=string&机床流水号=' + Machine + '=string&组件流水号_check=' + checkbox_Group + '=string&组件流水号=' + Group + '=string&零件图号_check=' + checkbox_number + '=string&零件图号=' + number + '=string&是否查询全部数据=1=string&单件是否外协=1=string&考核状态=6=int&开始时间_check=0&开始时间=' + k + '&结束时间_check=0&结束时间=' + m + '&排序名称=' + ordername + '&排序方式=' + order, - Pagination: pageCurrent + '&' + pageSize + param: '项目流水号_check=0=string&机床流水号_check=' + checkbox_Machine + '=string&机床流水号=' + Machine + '=string&组件流水号_check=' + checkbox_Group + '=string&组件流水号=' + Group + '=string&零件图号_check=' + checkbox_number + '=string&零件图号=' + number + '=string&是否查询全部数据=1=string&单件是否外协=1=string&考核状态=6=int&开始时间_check=0&开始时间=' + k + '&结束时间_check=0&结束时间=' + m + '&排序名称=' + ordername + '&排序方式=' + order } }) } diff --git a/src/api/WorkshopProcurement/OutsourcingMaterialsSearch.js b/src/api/WorkshopProcurement/OutsourcingMaterialsSearch.js index af080a0d..24fa5f45 100644 --- a/src/api/WorkshopProcurement/OutsourcingMaterialsSearch.js +++ b/src/api/WorkshopProcurement/OutsourcingMaterialsSearch.js @@ -13,27 +13,29 @@ export function searchSupplier(check1, value1, check2, value2, check3, value3, c }) } // 查询备料 -export function searchTable(check, supplierNameValue, check1, partNumber, check2, MaterialsValue, pageSize, pageCurrent) { +export function searchTable(check, supplierNameValue, check1, partNumber, check2, MaterialsValue, check3, starttime, endtime, ordername, order, pageSize, pageCurrent) { return request({ url: '', method: 'post', data: { type: '1', name: '备料管理_外购备料_综合查询数据', - param: '供应商流水号_check=' + check + '&供应商流水号=' + supplierNameValue + '&零件图号_check=' + check1 + '&零件图号=' + partNumber + '&备料状态_check=' + check2 + '&备料状态=' + MaterialsValue, + param: '供应商流水号_check=' + check + '&供应商流水号=' + supplierNameValue + '&零件图号_check=' + check1 + '&零件图号=' + partNumber + '&备料状态_check=' + check2 + '&备料状态=' + MaterialsValue + + '&下单时间_check=' + check3 + '&开始时间=' + starttime + '&结束时间=' + endtime + '&排序名称=' + ordername + '&排序方式=' + order, Pagination: pageCurrent + '&' + pageSize } }) } // 导出 -export function searchTablesheet(check, supplierNameValue, check1, partNumber, check2, MaterialsValue, pageSize, pageCurrent) { +export function searchTablesheet(check, supplierNameValue, check1, partNumber, check2, MaterialsValue, check3, starttime, endtime, ordername, order) { return request({ url: '', method: 'post', data: { type: '1', name: '备料管理_外购备料_综合查询数据', - param: '供应商流水号_check=' + check + '&供应商流水号=' + supplierNameValue + '&零件图号_check=' + check1 + '&零件图号=' + partNumber + '&备料状态_check=' + check2 + '&备料状态=' + MaterialsValue + param: '供应商流水号_check=' + check + '&供应商流水号=' + supplierNameValue + '&零件图号_check=' + check1 + '&零件图号=' + partNumber + '&备料状态_check=' + check2 + '&备料状态=' + MaterialsValue + + '&下单时间_check=' + check3 + '&开始时间=' + starttime + '&结束时间=' + endtime + '&排序名称=' + ordername + '&排序方式=' + order } }) } diff --git a/src/views/WorkshopProcurement/OfflineProcurement/index.vue b/src/views/WorkshopProcurement/OfflineProcurement/index.vue index c81b7196..a749ec80 100644 --- a/src/views/WorkshopProcurement/OfflineProcurement/index.vue +++ b/src/views/WorkshopProcurement/OfflineProcurement/index.vue @@ -58,30 +58,30 @@ -
- -
+ + + + + + + + + + + 离线备料单号: 供应商: - + - 查询 + 查询 创建采购计划单 @@ -137,17 +137,17 @@ -
- -
+ + + + + + + + + + +
@@ -402,7 +402,7 @@ export default { }) } }) - this.getTableData() + // this.getTableData() } }, // 获取组号 getGroup() { @@ -415,7 +415,7 @@ export default { value: response.data[i].组件流水号 }) } - this.Group = response.data[0].组件流水号 + // this.Group = response.data[0].组件流水号 }) this.getTableData() }, @@ -442,6 +442,10 @@ export default { // 按条件查询 getTableData() { this.tableData10 = [] + if (!this.Machine && !this.Group && !this.number) { + this.$message.error('请输入筛选条件!') + return + } if (this.Machine === '') { this.checkbox_Machine = 0 } else { @@ -457,21 +461,20 @@ export default { } else { this.checkbox_number = 1 } - getTable(this.checkbox_Machine, this.Machine, this.checkbox_Group, this.Group, this.checkbox_number, this.number, '', '', this.pageCurrent10, this.pageSize10, this.ordername, this.order).then(response => { - if (response.data.rows.length !== 0) { - for (let i = 0; i < response.data.rows.length; i++) { + getTable(this.checkbox_Machine, this.Machine, this.checkbox_Group, this.Group, this.checkbox_number, this.number, '', '', this.ordername, this.order).then(response => { + if (response.data.length !== 0) { + for (let i = 0; i < response.data.length; i++) { this.tableData10.push({ - 工艺计划流水号: response.data.rows[i].工艺计划流水号, - 机床图号: response.data.rows[i].机床图号, - 组号: response.data.rows[i].组号, - 零件图号: response.data.rows[i].零件图号, - 零件名称: response.data.rows[i].零件名称, - 批次数量: response.data.rows[i].批次数量, - 材料: response.data.rows[i].材料 + 工艺计划流水号: response.data[i].工艺计划流水号, + 机床图号: response.data[i].机床图号, + 组号: response.data[i].组号, + 零件图号: response.data[i].零件图号, + 零件名称: response.data[i].零件名称, + 批次数量: response.data[i].批次数量, + 材料: response.data[i].材料 }) } } - this.total10 = response.data.total this.loading = false }) }, @@ -492,11 +495,16 @@ export default { } }, searchTable() { + this.tableData = [] + if (!this.purchasingOrder && !this.supplierName) { + this.$message.error('请输入筛选条件!') + return + } this.purchasingOrder ? this.check3 = 1 : this.check3 = 0 this.supplierName ? this.check4 = 1 : this.check4 = 0 - searchPurchaseOrder(this.pageCurrent2, this.pageSize2, this.check3, this.purchasingOrder, this.check4, this.supplierName).then(response => { - this.tableData = response.data.rows - this.total2 = response.data.total + searchPurchaseOrder(this.check3, this.purchasingOrder, this.check4, this.supplierName).then(response => { + this.tableData = response.data + // this.total2 = response.data.total }) }, handleSizeChange2(val) { // 采购单列表分页 diff --git a/src/views/WorkshopProcurement/OutsourcingMaterialsSearch/index.vue b/src/views/WorkshopProcurement/OutsourcingMaterialsSearch/index.vue index ba585e0b..2d16abbb 100644 --- a/src/views/WorkshopProcurement/OutsourcingMaterialsSearch/index.vue +++ b/src/views/WorkshopProcurement/OutsourcingMaterialsSearch/index.vue @@ -1,6 +1,6 @@ - + @@ -122,6 +144,37 @@ export default { name: 'Index', data() { return { + ordername: '', + order: '', + dateRange: '', + expands: [], + pickerOptions: { + shortcuts: [{ + text: '上季度', + onClick(picker) { + const end = new Date() + const start = new Date() + start.setTime(end.getTime() - 3600 * 1000 * 24 * 30 * 3) + picker.$emit('pick', [start, end]) + } + }, { + text: '过去半年', + onClick(picker) { + const end = new Date() + const start = new Date() + start.setTime(end.getTime() - 3600 * 1000 * 24 * 366 / 2) + picker.$emit('pick', [start, end]) + } + }, { + text: '过去一年', + onClick(picker) { + const end = new Date() + const start = new Date() + start.setTime(end.getTime() - 3600 * 1000 * 24 * 365) + picker.$emit('pick', [start, end]) + } + }] + }, supplierNameValue: '', supplierNames: [], partNumber: '', @@ -145,7 +198,7 @@ export default { }, created() { this.fetchData() - this.getTableData() + // this.getTableData() }, methods: { formatJson(filterVal, jsonData) { @@ -154,7 +207,8 @@ export default { })) }, exportExcel() { - let check, check1, check2 + let check, check1, check2, check3 + this.dateRange ? check3 = 1 : (check3 = 0, this.dateRange = '') this.supplierNameValue ? check = 1 : check = 0 this.partNumber ? check1 = 1 : check1 = 0 if (this.MaterialsValue !== '' && this.MaterialsValue !== null) { @@ -162,11 +216,11 @@ export default { } else { check2 = 0 } - searchTablesheet(check, this.supplierNameValue, check1, this.partNumber, check2, this.MaterialsValue).then(res => { + searchTablesheet(check, this.supplierNameValue, check1, this.partNumber, check2, this.MaterialsValue, check3, this.dateRange[0], this.dateRange[1], this.ordername, this.order).then(res => { console.log(res.data, 11) import('@/vendor/Export2Excel').then(excel => { - const tHeader = ['备料状态', '供应商', '物料编码', '物料名称', '材料', '备件件数', '备料时间', '到货件数', '到货时间', '结算时间'] - const filterVal = ['是否到货', '供应商名称', '物料编码', '零件名称', '材料', '采购数量', '下单日期', '到货数量', '日期', '开票时间'] + const tHeader = ['备料状态', '供应商', '物料编码', '物料名称', '材料', '备料件数', '备料时间', '到货件数', '到货时间', '结算时间'] + const filterVal = ['备料状态', '供应商名称', '物料编码', '零件名称', '材料', '采购数量', '下单日期', '到货数量', '日期', '开票时间'] const list = res.data const data = this.formatJson(filterVal, list) excel.export_json_to_excel({ @@ -189,9 +243,31 @@ export default { } }) }, + // 按供应商名称,下单日期,零件名称,材料 + sortChange(column) { + console.log(column + '-' + column.prop + '-' + column.order, 11111) + if (column.prop === '供应商名称') { + this.ordername = 1 + } else if (column.prop === '零件名称') { + this.ordername = 2 + } else if (column.prop === '材料') { + this.ordername = 3 + } else if (column.prop === '下单日期') { + this.ordername = 4 + } else { + this.ordername = '' + } + if (column.order === 'ascending') { + this.order = 1 + } else if (column.order === 'descending') { this.order = 2 } else { + this.order = '' + } + this.getTableData() + }, getTableData() { this.loading = true - let check, check1, check2 + let check, check1, check2, check3 + this.dateRange ? check3 = 1 : (check3 = 0, this.dateRange = '') this.supplierNameValue ? check = 1 : check = 0 this.partNumber ? check1 = 1 : check1 = 0 if (this.MaterialsValue !== '' && this.MaterialsValue !== null) { @@ -199,8 +275,8 @@ export default { } else { check2 = 0 } - console.log(this.MaterialsValue, check2, 123) - searchTable(check, this.supplierNameValue, check1, this.partNumber, check2, this.MaterialsValue, this.pageSize, this.pageCurrent).then(response => { + searchTable(check, this.supplierNameValue, check1, this.partNumber, check2, this.MaterialsValue, check3, this.dateRange[0], this.dateRange[1], this.ordername, this.order, this.pageSize, this.pageCurrent).then(response => { + console.log(response) this.tableData = response.data.rows this.total = response.data.total this.loading = false diff --git a/src/views/WorkshopProcurement/RequestOutsourcingMaterials/index.vue b/src/views/WorkshopProcurement/RequestOutsourcingMaterials/index.vue index 0790b283..83587c30 100644 --- a/src/views/WorkshopProcurement/RequestOutsourcingMaterials/index.vue +++ b/src/views/WorkshopProcurement/RequestOutsourcingMaterials/index.vue @@ -300,7 +300,7 @@ export default { this.searchTable1() }, requestFund() { // 请款 - this.searchTable01() + // this.searchTable01() this.dialogVisible2 = true this.supplierValue = '' this.fetchData() // 重新获取供应商 @@ -333,7 +333,7 @@ export default { } else { this.$message.error('请款失败') } }) } else { - this.$message.error('请选择需要请款的合同') + this.$message.error('请选择供应商及对应请款合同') } }, searchTable02(row) { // 查看详情(请款信息包含的合同)