fixed bug
This commit is contained in:
@@ -1,5 +1,59 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询全部未询价的标准件和外购件
|
||||||
|
export function getExport1(num) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '3',
|
||||||
|
name: ` SELECT distinct
|
||||||
|
[项目名称]
|
||||||
|
,[机床图号]
|
||||||
|
,[组号]
|
||||||
|
,[姓名]
|
||||||
|
,[人员编号]
|
||||||
|
,[物料名称]
|
||||||
|
,[物料规格]
|
||||||
|
,[物料型号]
|
||||||
|
,[零件数量]
|
||||||
|
,[询价状态编号]
|
||||||
|
,[备注]
|
||||||
|
,[供货商]
|
||||||
|
,[使用滞货数量]
|
||||||
|
,[任务分配时间]
|
||||||
|
,[零件数量] - [使用滞货数量] as 待询价数量
|
||||||
|
FROM MRP_计划订单_组件零件清单_标准件和外购件_视图
|
||||||
|
where 询价状态编号 = 1 and 人员编号 = ${num}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询全部未询价的基本件
|
||||||
|
export function getExport2(num) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '3',
|
||||||
|
name: ` SELECT distinct [项目名称]
|
||||||
|
,[机床图号]
|
||||||
|
,[组号]
|
||||||
|
,[材料]
|
||||||
|
,[零件名称]
|
||||||
|
,[零件图号]
|
||||||
|
,[备注]
|
||||||
|
,[供货商]
|
||||||
|
,[规格]
|
||||||
|
,[零件数量] as 待询价数量
|
||||||
|
,[询价状态编号]
|
||||||
|
,[姓名]
|
||||||
|
,[人员编号]
|
||||||
|
,[任务分配时间]
|
||||||
|
FROM MRP_计划订单_组件零件清单_基本件_视图
|
||||||
|
where 询价状态编号 = 1 and 人员编号=${num}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
// 查询分配后的标准件和外购件
|
// 查询分配后的标准件和外购件
|
||||||
export function searchMaterial(pageCurrent, pageSize, num1, check1, val1, check2, val2, check3, val3, person, check4, val4, check5, val5, check6, val6) {
|
export function searchMaterial(pageCurrent, pageSize, num1, check1, val1, check2, val2, check3, val3, person, check4, val4, check5, val5, check6, val6) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -143,3 +143,27 @@ export function executeReturn2(...params) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 执行退回1标准件和外购件
|
||||||
|
export function retract1(num) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '采购部采购_撤回物料',
|
||||||
|
param: `标准件和外购件流水号=${num}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 执行退回1基本件
|
||||||
|
export function retract2(num) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '采购部采购_撤回物料_基本件',
|
||||||
|
param: `基本件流水号=${num}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
224
src/views/PurchasingCenter/CreateInquirySheet/Export2Excel.js
Normal file
224
src/views/PurchasingCenter/CreateInquirySheet/Export2Excel.js
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
require('script-loader!file-saver');
|
||||||
|
// import XLSX from 'xlsx'
|
||||||
|
import XLSX from 'xlsx-style'
|
||||||
|
function generateArray(table) {
|
||||||
|
var out = [];
|
||||||
|
var rows = table.querySelectorAll('tr');
|
||||||
|
var ranges = [];
|
||||||
|
for (var R = 0; R < rows.length; ++R) {
|
||||||
|
var outRow = [];
|
||||||
|
var row = rows[R];
|
||||||
|
var columns = row.querySelectorAll('td');
|
||||||
|
for (var C = 0; C < columns.length; ++C) {
|
||||||
|
var cell = columns[C];
|
||||||
|
var colspan = cell.getAttribute('colspan');
|
||||||
|
var rowspan = cell.getAttribute('rowspan');
|
||||||
|
var cellValue = cell.innerText;
|
||||||
|
if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
|
||||||
|
|
||||||
|
//Skip ranges
|
||||||
|
ranges.forEach(function (range) {
|
||||||
|
if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
|
||||||
|
for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//Handle Row Span
|
||||||
|
if (rowspan || colspan) {
|
||||||
|
rowspan = rowspan || 1;
|
||||||
|
colspan = colspan || 1;
|
||||||
|
ranges.push({
|
||||||
|
s: {
|
||||||
|
r: R,
|
||||||
|
c: outRow.length
|
||||||
|
},
|
||||||
|
e: {
|
||||||
|
r: R + rowspan - 1,
|
||||||
|
c: outRow.length + colspan - 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//Handle Value
|
||||||
|
outRow.push(cellValue !== "" ? cellValue : null);
|
||||||
|
|
||||||
|
//Handle Colspan
|
||||||
|
if (colspan)
|
||||||
|
for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
|
||||||
|
}
|
||||||
|
out.push(outRow);
|
||||||
|
}
|
||||||
|
return [out, ranges];
|
||||||
|
};
|
||||||
|
|
||||||
|
function datenum(v, date1904) {
|
||||||
|
if (date1904) v += 1462;
|
||||||
|
var epoch = Date.parse(v);
|
||||||
|
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sheet_from_array_of_arrays(data, opts) {
|
||||||
|
var ws = {};
|
||||||
|
var range = {
|
||||||
|
s: {
|
||||||
|
c: 10000000,
|
||||||
|
r: 10000000
|
||||||
|
},
|
||||||
|
e: {
|
||||||
|
c: 0,
|
||||||
|
r: 0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
for (var R = 0; R != data.length; ++R) {
|
||||||
|
for (var C = 0; C != data[R].length; ++C) {
|
||||||
|
if (range.s.r > R) range.s.r = R;
|
||||||
|
if (range.s.c > C) range.s.c = C;
|
||||||
|
if (range.e.r < R) range.e.r = R;
|
||||||
|
if (range.e.c < C) range.e.c = C;
|
||||||
|
var cell = {
|
||||||
|
v: data[R][C]
|
||||||
|
};
|
||||||
|
if (cell.v == null) continue;
|
||||||
|
var cell_ref = XLSX.utils.encode_cell({
|
||||||
|
c: C,
|
||||||
|
r: R
|
||||||
|
});
|
||||||
|
|
||||||
|
if (typeof cell.v === 'number') cell.t = 'n';
|
||||||
|
else if (typeof cell.v === 'boolean') cell.t = 'b';
|
||||||
|
else if (cell.v instanceof Date) {
|
||||||
|
cell.t = 'n';
|
||||||
|
cell.z = XLSX.SSF._table[14];
|
||||||
|
cell.v = datenum(cell.v);
|
||||||
|
} else cell.t = 's';
|
||||||
|
|
||||||
|
ws[cell_ref] = cell;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
|
||||||
|
return ws;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Workbook() {
|
||||||
|
if (!(this instanceof Workbook)) return new Workbook();
|
||||||
|
this.SheetNames = [];
|
||||||
|
this.Sheets = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
function s2ab(s) {
|
||||||
|
var buf = new ArrayBuffer(s.length);
|
||||||
|
var view = new Uint8Array(buf);
|
||||||
|
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function export_table_to_excel(id) {
|
||||||
|
var theTable = document.getElementById(id);
|
||||||
|
var oo = generateArray(theTable);
|
||||||
|
var ranges = oo[1];
|
||||||
|
|
||||||
|
/* original data */
|
||||||
|
var data = oo[0];
|
||||||
|
var ws_name = "SheetJS";
|
||||||
|
|
||||||
|
var wb = new Workbook(),
|
||||||
|
ws = sheet_from_array_of_arrays(data);
|
||||||
|
|
||||||
|
/* add ranges to worksheet */
|
||||||
|
// ws['!cols'] = ['apple', 'banan'];
|
||||||
|
ws['!merges'] = ranges;
|
||||||
|
|
||||||
|
/* add worksheet to workbook */
|
||||||
|
wb.SheetNames.push(ws_name);
|
||||||
|
wb.Sheets[ws_name] = ws;
|
||||||
|
|
||||||
|
var wbout = XLSX.write(wb, {
|
||||||
|
bookType: 'xlsx',
|
||||||
|
bookSST: false,
|
||||||
|
type: 'binary'
|
||||||
|
});
|
||||||
|
|
||||||
|
saveAs(new Blob([s2ab(wbout)], {
|
||||||
|
type: "application/octet-stream"
|
||||||
|
}), "test.xlsx")
|
||||||
|
}
|
||||||
|
|
||||||
|
export function export_json_to_excel({
|
||||||
|
headerGroup,
|
||||||
|
dataGroup,
|
||||||
|
sheetGroup,
|
||||||
|
filename,
|
||||||
|
autoWidth = true,
|
||||||
|
bookType= 'xlsx'
|
||||||
|
} = {}) {
|
||||||
|
var wb = new Workbook()
|
||||||
|
for (let i = 0; i < dataGroup.length; i++) {
|
||||||
|
/* original data */
|
||||||
|
let data = dataGroup[i]
|
||||||
|
filename = filename || 'excel-list'
|
||||||
|
data = [...data]
|
||||||
|
data.unshift(headerGroup[i]);
|
||||||
|
var ws_name = sheetGroup[i];
|
||||||
|
var ws = sheet_from_array_of_arrays(data);
|
||||||
|
|
||||||
|
if (autoWidth) {
|
||||||
|
/*设置worksheet每列的最大宽度*/
|
||||||
|
const colWidth = data.map(row => row.map(val => {
|
||||||
|
/*先判断是否为null/undefined*/
|
||||||
|
if (val == null) {
|
||||||
|
return {
|
||||||
|
'wch': 10
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/*再判断是否为中文*/
|
||||||
|
else if (val.toString().charCodeAt(0) > 255) {
|
||||||
|
return {
|
||||||
|
'wch': val.toString().length * 2
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
'wch': val.toString().length
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
/*以第一行为初始值*/
|
||||||
|
let result = colWidth[0];
|
||||||
|
for (let i = 1; i < colWidth.length; i++) {
|
||||||
|
for (let j = 0; j < colWidth[i].length; j++) {
|
||||||
|
if (result[j]['wch'] < colWidth[i][j]['wch']) {
|
||||||
|
result[j]['wch'] = colWidth[i][j]['wch'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ws['!cols'] = result;
|
||||||
|
}
|
||||||
|
let R = 0;
|
||||||
|
data.map(item => {
|
||||||
|
let C = 0;
|
||||||
|
item.map(itm => {
|
||||||
|
var cell_ref = XLSX.utils.encode_cell({c:C,r:R});
|
||||||
|
var cell = {v: itm }
|
||||||
|
cell.s= {
|
||||||
|
alignment: {
|
||||||
|
horizontal: "center"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ws[cell_ref] = cell;
|
||||||
|
C++;
|
||||||
|
})
|
||||||
|
R++;
|
||||||
|
})
|
||||||
|
/* add worksheet to workbook */
|
||||||
|
wb.SheetNames.push(ws_name);
|
||||||
|
wb.Sheets[ws_name] = ws;
|
||||||
|
}
|
||||||
|
var wbout = XLSX.write(wb, {
|
||||||
|
bookType: bookType,
|
||||||
|
bookSST: false,
|
||||||
|
type: 'binary'
|
||||||
|
});
|
||||||
|
saveAs(new Blob([s2ab(wbout)], {
|
||||||
|
type: "application/octet-stream"
|
||||||
|
}), `${filename}.${bookType}`);
|
||||||
|
}
|
||||||
@@ -1,311 +1,327 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-tabs type="border-card" @tab-click="searchTable11();searchTable12()">
|
<el-row>
|
||||||
<el-tab-pane label="标准件和外购件">
|
<el-col :span="24">
|
||||||
<el-row style="margin-bottom: 5px">
|
<el-tabs v-model="tabName" type="border-card" @tab-click="tabClick">
|
||||||
<span>项目名称:</span>
|
<el-tab-pane label="标准件和外购件" name="标准件和外购件">
|
||||||
<el-select v-model="projectValue" style="width:200px" placeholder="项目名称" size="small" filterable clearable @change="projectChange">
|
<el-row style="margin-bottom: 5px">
|
||||||
<el-option
|
<span>项目名称:</span>
|
||||||
v-for="item in project"
|
<el-select v-model="projectValue" style="width:200px" placeholder="项目名称" size="small" filterable clearable @change="projectChange">
|
||||||
:key="item.value"
|
<el-option
|
||||||
:label="item.label"
|
v-for="item in project"
|
||||||
:value="item.value"/>
|
:key="item.value"
|
||||||
</el-select>
|
:label="item.label"
|
||||||
<span>机床图号:</span>
|
:value="item.value"/>
|
||||||
<el-select v-model="machineValue" style="width:200px" placeholder="请选择" size="small" clearable filterable @change="machineChange">
|
</el-select>
|
||||||
<el-option
|
<span>机床图号:</span>
|
||||||
v-for="item in machine"
|
<el-select v-model="machineValue" style="width:200px" placeholder="请选择" size="small" clearable filterable @change="machineChange">
|
||||||
:key="item.value"
|
<el-option
|
||||||
:label="item.label"
|
v-for="item in machine"
|
||||||
:value="item.value"/>
|
:key="item.value"
|
||||||
</el-select>
|
:label="item.label"
|
||||||
<span>组号:</span>
|
:value="item.value"/>
|
||||||
<el-select v-model="groupValue" style="width:200px" placeholder="请选择" size="small" clearable filterable>
|
</el-select>
|
||||||
<el-option
|
<span>组号:</span>
|
||||||
v-for="item in group"
|
<el-select v-model="groupValue" style="width:200px" placeholder="请选择" size="small" clearable filterable>
|
||||||
:key="item.value"
|
<el-option
|
||||||
:label="item.label"
|
v-for="item in group"
|
||||||
:value="item.value"/>
|
:key="item.value"
|
||||||
</el-select>
|
:label="item.label"
|
||||||
</el-row>
|
:value="item.value"/>
|
||||||
<el-row style="margin-bottom: 5px">
|
</el-select>
|
||||||
<span style="margin-right: -10px">物料状态:</span>
|
</el-row>
|
||||||
<el-cascader :options="materialStatus" v-model="materialStatusValue" size="small" change-on-select/>
|
<el-row style="margin-bottom: 5px">
|
||||||
<span>物料名称:</span>
|
<span style="margin-right: -10px">物料状态:</span>
|
||||||
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
|
<el-cascader :options="materialStatus" v-model="materialStatusValue" size="small" change-on-select/>
|
||||||
</el-row>
|
<span>物料名称:</span>
|
||||||
<el-row style="margin-bottom: 10px">
|
<el-input v-model="materialName" placeholder="物料名称" size="small" clearable/>
|
||||||
<span>物料规格:</span>
|
</el-row>
|
||||||
<el-input v-model="materialSpec" placeholder="物料规格" size="small" clearable/>
|
<el-row style="margin-bottom: 10px">
|
||||||
<span>物料型号:</span>
|
<span>物料规格:</span>
|
||||||
<el-input v-model="materialModel" placeholder="物料型号" size="small" clearable/>
|
<el-input v-model="materialSpec" placeholder="物料规格" size="small" clearable/>
|
||||||
<el-button
|
<span>物料型号:</span>
|
||||||
type="success"
|
<el-input v-model="materialModel" placeholder="物料型号" size="small" clearable/>
|
||||||
size="small"
|
<el-button
|
||||||
icon="el-icon-search"
|
type="success"
|
||||||
style="margin-left: 10px"
|
size="small"
|
||||||
@click="pageCurrent11=1;pageSize11=10;total11=0;searchTable11()">查询</el-button>
|
icon="el-icon-search"
|
||||||
</el-row>
|
style="margin-left: 10px"
|
||||||
<el-row style="margin-bottom: 10px">
|
@click="pageCurrent11=1;pageSize11=10;total11=0;searchTable11()">查询</el-button>
|
||||||
<el-table
|
<el-button
|
||||||
v-loading=""
|
type="warning"
|
||||||
:data="tableData11"
|
size="small"
|
||||||
:row-class-name="tableRowClassName"
|
icon="el-icon-download"
|
||||||
border
|
style="margin-left: 10px"
|
||||||
style="width: 100%;max-height: 500px;"
|
@click="exportUninquirySheet">导出未询价物料清单</el-button>
|
||||||
height="500px"
|
</el-row>
|
||||||
size="mini"
|
<el-row style="margin-bottom: 10px">
|
||||||
@selection-change="handleSelectionChange1">
|
<el-table
|
||||||
<el-table-column :selectable="selectable" align="center" width="35" type="selection"/>
|
v-loading=""
|
||||||
<el-table-column label="操作" align="center" width="100" fixed="left">
|
:data="tableData11"
|
||||||
<template slot-scope="scope">
|
:row-class-name="tableRowClassName"
|
||||||
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="materialChange(scope.row)">物料变更</el-button>
|
border
|
||||||
</template>
|
style="width: 100%;max-height: 500px;"
|
||||||
</el-table-column>
|
height="500px"
|
||||||
<el-table-column label="物料状态" align="center" width="80">
|
size="mini"
|
||||||
<template slot-scope="scope">
|
@selection-change="handleSelectionChange1">
|
||||||
<el-tag v-if="parseInt(scope.row.询价状态编号)===1" type="warning" size="small">未询价</el-tag>
|
<el-table-column :selectable="selectable" align="center" width="35" type="selection"/>
|
||||||
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
|
<el-table-column label="操作" align="center" width="100" fixed="left">
|
||||||
<el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
|
<template slot-scope="scope">
|
||||||
</template>
|
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="materialChange(scope.row)">物料变更</el-button>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column label="任务分配时间" align="center" min-width="100">
|
</el-table-column>
|
||||||
<template slot-scope="scope">
|
<el-table-column label="物料状态" align="center" width="80">
|
||||||
{{ scope.row.任务分配时间.split(' ')[0] }}
|
<template slot-scope="scope">
|
||||||
</template>
|
<el-tag v-if="parseInt(scope.row.询价状态编号)===1" type="warning" size="small">未询价</el-tag>
|
||||||
</el-table-column>
|
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
|
||||||
<!--<el-table-column label="项目名称" align="center" min-width="100">-->
|
<el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
|
||||||
<!--<template slot-scope="scope">-->
|
</template>
|
||||||
<!--{{ scope.row.项目名称 }}-->
|
</el-table-column>
|
||||||
<!--</template>-->
|
<el-table-column label="任务分配时间" align="center" min-width="100">
|
||||||
<!--</el-table-column>-->
|
<template slot-scope="scope">
|
||||||
<el-table-column label="机床图号" align="center" min-width="100">
|
{{ scope.row.任务分配时间.split(' ')[0] }}
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
{{ scope.row.机床图号 }}
|
</el-table-column>
|
||||||
</template>
|
<!--<el-table-column label="项目名称" align="center" min-width="100">-->
|
||||||
</el-table-column>
|
<!--<template slot-scope="scope">-->
|
||||||
<el-table-column label="组号" align="center" min-width="80">
|
<!--{{ scope.row.项目名称 }}-->
|
||||||
<template slot-scope="scope">
|
<!--</template>-->
|
||||||
{{ scope.row.组号 }}
|
<!--</el-table-column>-->
|
||||||
</template>
|
<el-table-column label="机床图号" align="center" min-width="100">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<!--<el-table-column label="物料类别" align="center" min-width="100">-->
|
{{ scope.row.机床图号 }}
|
||||||
<!--<template slot-scope="scope">-->
|
</template>
|
||||||
<!--{{ scope.row.物料类别 }}-->
|
</el-table-column>
|
||||||
<!--</template>-->
|
<el-table-column label="组号" align="center" min-width="80">
|
||||||
<!--</el-table-column>-->
|
<template slot-scope="scope">
|
||||||
<!--<el-table-column label="物料品种" align="center" min-width="100">-->
|
{{ scope.row.组号 }}
|
||||||
<!--<template slot-scope="scope">-->
|
</template>
|
||||||
<!--{{ scope.row.物料品种 }}-->
|
</el-table-column>
|
||||||
<!--</template>-->
|
<!--<el-table-column label="物料类别" align="center" min-width="100">-->
|
||||||
<!--</el-table-column>-->
|
<!--<template slot-scope="scope">-->
|
||||||
<el-table-column label="名称" align="center" min-width="100">
|
<!--{{ scope.row.物料类别 }}-->
|
||||||
<template slot-scope="scope">
|
<!--</template>-->
|
||||||
{{ scope.row.物料名称 }}
|
<!--</el-table-column>-->
|
||||||
</template>
|
<!--<el-table-column label="物料品种" align="center" min-width="100">-->
|
||||||
</el-table-column>
|
<!--<template slot-scope="scope">-->
|
||||||
<el-table-column label="图号或型号" align="center" min-width="100">
|
<!--{{ scope.row.物料品种 }}-->
|
||||||
<template slot-scope="scope">
|
<!--</template>-->
|
||||||
{{ scope.row.物料型号 }}
|
<!--</el-table-column>-->
|
||||||
</template>
|
<el-table-column label="名称" align="center" min-width="100">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column label="规格" align="center" min-width="200">
|
{{ scope.row.物料名称 }}
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
{{ scope.row.物料规格 }}
|
</el-table-column>
|
||||||
</template>
|
<el-table-column label="图号或型号" align="center" min-width="100">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column label="分配数量" align="center" min-width="80">
|
{{ scope.row.物料型号 }}
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
{{ scope.row.零件数量 }}
|
</el-table-column>
|
||||||
</template>
|
<el-table-column label="规格" align="center" min-width="200">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column label="待询价数量" align="center" min-width="90">
|
{{ scope.row.物料规格 }}
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
{{ scope.row.待询价数量 = Number(scope.row.零件数量) - Number(scope.row.使用滞货数量) }}
|
</el-table-column>
|
||||||
</template>
|
<el-table-column label="分配数量" align="center" min-width="80">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column label="使用滞货数量" align="center" min-width="100">
|
{{ scope.row.零件数量 }}
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
{{ Number(scope.row.使用滞货数量) }}
|
</el-table-column>
|
||||||
</template>
|
<el-table-column label="待询价数量" align="center" min-width="90">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column label="使用滞货" align="center" min-width="70">
|
{{ scope.row.待询价数量 = Number(scope.row.零件数量) - Number(scope.row.使用滞货数量) }}
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
<!--<el-tooltip class="item" effect="dark" content="使用滞货" placement="top-start">-->
|
</el-table-column>
|
||||||
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1||Number(scope.row.滞货数量)===0" icon="el-icon-goods" plain type="primary" size="mini" @click="useInventory(scope.row)"/>
|
<el-table-column label="使用滞货数量" align="center" min-width="100">
|
||||||
<!--</el-tooltip>-->
|
<template slot-scope="scope">
|
||||||
<!--<el-tooltip class="item" effect="dark" content="取消使用滞货" placement="top-start">-->
|
{{ Number(scope.row.使用滞货数量) }}
|
||||||
<!--<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1||Number(scope.row.使用滞货数量)===0" icon="el-icon-sold-out" plain type="danger" size="mini" @click="cancelUseInventory(scope.row)"/>-->
|
</template>
|
||||||
<!--</el-tooltip>-->
|
</el-table-column>
|
||||||
</template>
|
<el-table-column label="使用滞货" align="center" min-width="70">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column label="可用滞货数量" align="center" min-width="100">
|
<!--<el-tooltip class="item" effect="dark" content="使用滞货" placement="top-start">-->
|
||||||
<template slot-scope="scope">
|
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1||Number(scope.row.滞货数量)===0" icon="el-icon-goods" plain type="primary" size="mini" @click="useInventory(scope.row)"/>
|
||||||
{{ Number(scope.row.滞货数量) }}
|
<!--</el-tooltip>-->
|
||||||
</template>
|
<!--<el-tooltip class="item" effect="dark" content="取消使用滞货" placement="top-start">-->
|
||||||
</el-table-column>
|
<!--<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1||Number(scope.row.使用滞货数量)===0" icon="el-icon-sold-out" plain type="danger" size="mini" @click="cancelUseInventory(scope.row)"/>-->
|
||||||
<el-table-column :filters="remarkFilters" :filter-method="filterHandler0" label="备注" align="center" min-width="100" prop="备注">
|
<!--</el-tooltip>-->
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
{{ scope.row.备注 }}
|
</el-table-column>
|
||||||
</template>
|
<el-table-column label="可用滞货数量" align="center" min-width="100">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="供货商">
|
{{ Number(scope.row.滞货数量) }}
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
{{ scope.row.供货商 }}
|
</el-table-column>
|
||||||
</template>
|
<el-table-column :filters="remarkFilters" :filter-method="filterHandler0" label="备注" align="center" min-width="100" prop="备注">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
</el-table>
|
{{ scope.row.备注 }}
|
||||||
</el-row>
|
</template>
|
||||||
<div class="block">
|
</el-table-column>
|
||||||
<el-pagination
|
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="供货商">
|
||||||
:current-page="pageCurrent11"
|
<template slot-scope="scope">
|
||||||
:page-sizes="[10, 50, 100, 150]"
|
{{ scope.row.供货商 }}
|
||||||
:page-size="pageSize11"
|
</template>
|
||||||
:total="total11"
|
</el-table-column>
|
||||||
style="display:inline-block;width:50%"
|
</el-table>
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
</el-row>
|
||||||
@size-change="handleSizeChange11"
|
<div class="block">
|
||||||
@current-change="handleCurrentChange11"/>
|
<el-pagination
|
||||||
</div>
|
:current-page="pageCurrent11"
|
||||||
</el-tab-pane>
|
:page-sizes="[10, 50, 100, 150]"
|
||||||
<el-tab-pane label="基本件">
|
:page-size="pageSize11"
|
||||||
<el-row style="margin-bottom: 5px">
|
:total="total11"
|
||||||
<span>项目名称:</span>
|
style="display:inline-block;width:50%"
|
||||||
<el-select v-model="projectValue" style="width:200px" placeholder="项目名称" size="small" filterable clearable @change="projectChange">
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
<el-option
|
@size-change="handleSizeChange11"
|
||||||
v-for="item in project"
|
@current-change="handleCurrentChange11"/>
|
||||||
:key="item.value"
|
</div>
|
||||||
:label="item.label"
|
</el-tab-pane>
|
||||||
:value="item.value"/>
|
<el-tab-pane label="基本件" name="基本件">
|
||||||
</el-select>
|
<el-row style="margin-bottom: 5px">
|
||||||
<span>机床图号:</span>
|
<span>项目名称:</span>
|
||||||
<el-select v-model="machineValue" style="width:200px" placeholder="请选择" size="small" clearable filterable @change="machineChange">
|
<el-select v-model="projectValue" style="width:200px" placeholder="项目名称" size="small" filterable clearable @change="projectChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in machine"
|
v-for="item in project"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"/>
|
:value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<span>组号:</span>
|
<span>机床图号:</span>
|
||||||
<el-select v-model="groupValue" style="width:200px" placeholder="请选择" size="small" clearable filterable>
|
<el-select v-model="machineValue" style="width:200px" placeholder="请选择" size="small" clearable filterable @change="machineChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in group"
|
v-for="item in machine"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"/>
|
:value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-row>
|
<span>组号:</span>
|
||||||
<el-row style="margin-bottom: 5px">
|
<el-select v-model="groupValue" style="width:200px" placeholder="请选择" size="small" clearable filterable>
|
||||||
<span style="margin-right: -10px">物料状态:</span>
|
<el-option
|
||||||
<el-cascader :options="materialStatus" v-model="materialStatusValue" size="small" change-on-select/>
|
v-for="item in group"
|
||||||
<span>零件图号:</span>
|
:key="item.value"
|
||||||
<el-input v-model="partNum" placeholder="零件图号" size="small" clearable/>
|
:label="item.label"
|
||||||
</el-row>
|
:value="item.value"/>
|
||||||
<el-row style="margin-bottom: 10px">
|
</el-select>
|
||||||
<span>零件名称:</span>
|
</el-row>
|
||||||
<el-input v-model="partName" placeholder="零件名称" size="small" clearable/>
|
<el-row style="margin-bottom: 5px">
|
||||||
<span>零件规格:</span>
|
<span style="margin-right: -10px">物料状态:</span>
|
||||||
<el-input v-model="partSpec" placeholder="零件规格" size="small" clearable/>
|
<el-cascader :options="materialStatus" v-model="materialStatusValue" size="small" change-on-select/>
|
||||||
<el-button
|
<span>零件图号:</span>
|
||||||
type="success"
|
<el-input v-model="partNum" placeholder="零件图号" size="small" clearable/>
|
||||||
size="small"
|
</el-row>
|
||||||
icon="el-icon-search"
|
<el-row style="margin-bottom: 10px">
|
||||||
style="margin-left: 10px"
|
<span>零件名称:</span>
|
||||||
@click="pageCurrent12=1;pageSize12=10;total12=0;searchTable12()">查询</el-button>
|
<el-input v-model="partName" placeholder="零件名称" size="small" clearable/>
|
||||||
</el-row>
|
<span>零件规格:</span>
|
||||||
<el-row style="margin-bottom: 10px">
|
<el-input v-model="partSpec" placeholder="零件规格" size="small" clearable/>
|
||||||
<el-table
|
<el-button
|
||||||
v-loading=""
|
type="success"
|
||||||
:data="tableData12"
|
size="small"
|
||||||
:row-class-name="tableRowClassName"
|
icon="el-icon-search"
|
||||||
border
|
style="margin-left: 10px"
|
||||||
style="width: 100%;max-height: 500px;"
|
@click="pageCurrent12=1;pageSize12=10;total12=0;searchTable12()">查询</el-button>
|
||||||
height="500px"
|
<el-button
|
||||||
size="mini"
|
type="warning"
|
||||||
@selection-change="handleSelectionChange2">
|
size="small"
|
||||||
<el-table-column :selectable="selectable" align="center" width="35" type="selection"/>
|
icon="el-icon-download"
|
||||||
<el-table-column label="操作" align="center" width="100" fixed="left">
|
style="margin-left: 10px"
|
||||||
<template slot-scope="scope">
|
@click="exportUninquirySheet">导出未询价物料清单</el-button>
|
||||||
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="partChange(scope.row)">零件变更</el-button>
|
</el-row>
|
||||||
</template>
|
<el-row style="margin-bottom: 10px">
|
||||||
</el-table-column>
|
<el-table
|
||||||
<el-table-column label="零件状态" align="center" width="100">
|
v-loading=""
|
||||||
<template slot-scope="scope">
|
:data="tableData12"
|
||||||
<el-tag v-if="parseInt(scope.row.询价状态编号)===1" type="warning" size="small">未询价</el-tag>
|
:row-class-name="tableRowClassName"
|
||||||
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
|
border
|
||||||
<el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
|
style="width: 100%;max-height: 500px;"
|
||||||
</template>
|
height="500px"
|
||||||
</el-table-column>
|
size="mini"
|
||||||
<el-table-column label="任务分配时间" align="center" min-width="100">
|
@selection-change="handleSelectionChange2">
|
||||||
<template slot-scope="scope">
|
<el-table-column :selectable="selectable" align="center" width="35" type="selection"/>
|
||||||
{{ scope.row.任务分配时间.split(' ')[0] }}
|
<el-table-column label="操作" align="center" width="100" fixed="left">
|
||||||
</template>
|
<template slot-scope="scope">
|
||||||
</el-table-column>
|
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="partChange(scope.row)">零件变更</el-button>
|
||||||
<el-table-column label="项目名称" align="center" min-width="100">
|
</template>
|
||||||
<template slot-scope="scope">
|
</el-table-column>
|
||||||
{{ scope.row.项目名称 }}
|
<el-table-column label="零件状态" align="center" width="100">
|
||||||
</template>
|
<template slot-scope="scope">
|
||||||
</el-table-column>
|
<el-tag v-if="parseInt(scope.row.询价状态编号)===1" type="warning" size="small">未询价</el-tag>
|
||||||
<el-table-column label="机床图号" align="center" min-width="100">
|
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
|
||||||
<template slot-scope="scope">
|
<el-tag v-if="parseInt(scope.row.询价状态编号)!==1&&parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
|
||||||
{{ scope.row.机床图号 }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="任务分配时间" align="center" min-width="100">
|
||||||
<el-table-column label="组号" align="center" min-width="80">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
{{ scope.row.任务分配时间.split(' ')[0] }}
|
||||||
{{ scope.row.组号 }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="项目名称" align="center" min-width="100">
|
||||||
<el-table-column label="图号" align="center" min-width="100">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
{{ scope.row.项目名称 }}
|
||||||
{{ scope.row.零件图号 }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="机床图号" align="center" min-width="100">
|
||||||
<el-table-column label="名称" align="center" min-width="100">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
{{ scope.row.机床图号 }}
|
||||||
{{ scope.row.零件名称 }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="组号" align="center" min-width="80">
|
||||||
<el-table-column label="规格" align="center" min-width="100">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
{{ scope.row.组号 }}
|
||||||
{{ scope.row.规格 }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="图号" align="center" min-width="100">
|
||||||
<el-table-column label="材料" align="center" min-width="100">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
{{ scope.row.零件图号 }}
|
||||||
{{ scope.row.材料 }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="名称" align="center" min-width="100">
|
||||||
<el-table-column label="数量" align="center" min-width="80">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
{{ scope.row.零件名称 }}
|
||||||
{{ scope.row.零件数量 }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="规格" align="center" min-width="100">
|
||||||
<el-table-column :filters="remarkFilters" :filter-method="filterHandler0" label="备注" align="center" min-width="100" prop="备注">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
{{ scope.row.规格 }}
|
||||||
{{ scope.row.备注 }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="材料" align="center" min-width="100">
|
||||||
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="供货商">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
{{ scope.row.材料 }}
|
||||||
{{ scope.row.供货商 }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="数量" align="center" min-width="80">
|
||||||
</el-table>
|
<template slot-scope="scope">
|
||||||
</el-row>
|
{{ scope.row.零件数量 }}
|
||||||
<div class="block">
|
</template>
|
||||||
<el-pagination
|
</el-table-column>
|
||||||
:current-page="pageCurrent12"
|
<el-table-column :filters="remarkFilters" :filter-method="filterHandler0" label="备注" align="center" min-width="100" prop="备注">
|
||||||
:page-sizes="[10, 50, 100, 150]"
|
<template slot-scope="scope">
|
||||||
:page-size="pageSize12"
|
{{ scope.row.备注 }}
|
||||||
:total="total12"
|
</template>
|
||||||
style="display:inline-block;width:50%"
|
</el-table-column>
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="供货商">
|
||||||
@size-change="handleSizeChange12"
|
<template slot-scope="scope">
|
||||||
@current-change="handleCurrentChange12"/>
|
{{ scope.row.供货商 }}
|
||||||
</div>
|
</template>
|
||||||
</el-tab-pane>
|
</el-table-column>
|
||||||
</el-tabs>
|
</el-table>
|
||||||
|
</el-row>
|
||||||
|
<div class="block">
|
||||||
|
<el-pagination
|
||||||
|
:current-page="pageCurrent12"
|
||||||
|
:page-sizes="[10, 50, 100, 150]"
|
||||||
|
:page-size="pageSize12"
|
||||||
|
:total="total12"
|
||||||
|
style="display:inline-block;width:50%"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleSizeChange12"
|
||||||
|
@current-change="handleCurrentChange12"/>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-card style="margin-top: 15px">
|
<el-card style="margin-top: 15px">
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
@@ -769,7 +785,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
|
import { searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
|
||||||
createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange, saveOrder,
|
createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange, saveOrder,
|
||||||
submitUseInventory, initProject, searchMachine, searchGroup, searchBaseInfo, editBaseInfo } from '@/api/PurchasingCenter/CreateInquirySheet'
|
submitUseInventory, initProject, searchMachine, searchGroup, searchBaseInfo, editBaseInfo, getExport1, getExport2 } from '@/api/PurchasingCenter/CreateInquirySheet'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { exportExcelMethod } from './exportExcel'
|
import { exportExcelMethod } from './exportExcel'
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
@@ -778,6 +794,7 @@ export default {
|
|||||||
name: '', // 创建询价单
|
name: '', // 创建询价单
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
tabName: '标准件和外购件',
|
||||||
baseInfoLoading: false,
|
baseInfoLoading: false,
|
||||||
dialogVisible5: false,
|
dialogVisible5: false,
|
||||||
form3: { // 询价单基础信息表单
|
form3: { // 询价单基础信息表单
|
||||||
@@ -931,6 +948,50 @@ export default {
|
|||||||
this.searchTable2() // 查表2
|
this.searchTable2() // 查表2
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
tabClick(tab) {
|
||||||
|
tab.name === '基本件' ? this.searchTable12() : this.searchTable11()
|
||||||
|
},
|
||||||
|
formatJson(filterVal, jsonData) {
|
||||||
|
return jsonData.map(v => filterVal.map(j => {
|
||||||
|
return v[j]
|
||||||
|
}))
|
||||||
|
},
|
||||||
|
// 导出未询价外购件和标准件/基本件清单
|
||||||
|
exportUninquirySheet() {
|
||||||
|
getExport1(this.id).then(res1 => { // 标准件和外购件
|
||||||
|
getExport2(this.id).then(res2 => { // 基本件
|
||||||
|
res1.data.map(v => {
|
||||||
|
v.任务分配时间 = v.任务分配时间.split(' ')[0]
|
||||||
|
v.供货商 = v.供货商 ? v.供货商 : ''
|
||||||
|
v.备注 = v.备注 ? v.备注 : ''
|
||||||
|
})
|
||||||
|
res2.data.map(v => {
|
||||||
|
v.任务分配时间 = v.任务分配时间.split(' ')[0]
|
||||||
|
v.供货商 = v.供货商 ? v.供货商 : ''
|
||||||
|
v.备注 = v.备注 ? v.备注 : ''
|
||||||
|
})
|
||||||
|
import('./Export2Excel').then(excel => {
|
||||||
|
const dataGroup = []
|
||||||
|
const filterVal1 = ['任务分配时间', '项目名称', '机床图号', '组号', '物料名称', '物料型号', '物料规格', '待询价数量', '备注', '供货商'] // tableData1里的属性名
|
||||||
|
const filterVal2 = ['任务分配时间', '项目名称', '机床图号', '组号', '零件名称', '零件图号', '规格', '材料', '待询价数量', '备注', '供货商'] // tableData2里的属性名
|
||||||
|
const data1 = res1.data.map(v => filterVal1.map(j => v[j]))
|
||||||
|
dataGroup.push(data1)
|
||||||
|
const data2 = res2.data.map(v => filterVal2.map(j => v[j]))
|
||||||
|
dataGroup.push(data2)
|
||||||
|
const headerGroup = [['任务分配时间', '项目名称', '机床图号', '组号', '名称', '图号或型号', '规格', '待询价数量', '备注', '供货商'], ['任务分配时间', '项目名称', '机床图号', '组号', '名称', '图号或型号', '规格', '材料', '待询价数量', '备注', '供货商']]
|
||||||
|
const sheetGroup = ['标准件和外购件(未询价)', '基本件(未询价)']
|
||||||
|
excel.export_json_to_excel({
|
||||||
|
headerGroup: headerGroup,
|
||||||
|
dataGroup: dataGroup,
|
||||||
|
sheetGroup: sheetGroup,
|
||||||
|
filename: '未询价采购件明细',
|
||||||
|
autoWidth: true,
|
||||||
|
bookType: 'xlsx'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
// 询价单基础信息维护
|
// 询价单基础信息维护
|
||||||
inquirySheetBaseInfoMaintain() {
|
inquirySheetBaseInfoMaintain() {
|
||||||
this.baseInfoLoading = true
|
this.baseInfoLoading = true
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ export default {
|
|||||||
phone2: '',
|
phone2: '',
|
||||||
fax2: '',
|
fax2: '',
|
||||||
postCode2: '',
|
postCode2: '',
|
||||||
hasTax: '未税',
|
hasTax: '含税',
|
||||||
taxRate: 0.16,
|
taxRate: 0.16,
|
||||||
preview: false, // 预览
|
preview: false, // 预览
|
||||||
demoRadio: '', // 模板radio
|
demoRadio: '', // 模板radio
|
||||||
|
|||||||
@@ -99,6 +99,21 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="供应商" align="center" min-width="220">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.供应商名称 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="采购合同名称" align="center" min-width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.采购合同名称 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="采购合同号" align="center" min-width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.采购合同编号 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="审核情况" align="center" min-width="80">
|
<el-table-column label="审核情况" align="center" min-width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.审核情况内容==='未审核'" type="primary" size="small">未审核</el-tag>
|
<el-tag v-if="scope.row.审核情况内容==='未审核'" type="primary" size="small">未审核</el-tag>
|
||||||
@@ -106,16 +121,6 @@
|
|||||||
<el-tag v-if="scope.row.审核情况内容==='未通过审核'" type="danger" size="small">未通过</el-tag>
|
<el-tag v-if="scope.row.审核情况内容==='未通过审核'" type="danger" size="small">未通过</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="未通过审核原因" align="center" min-width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.未通过审核原因 ? scope.row.未通过审核原因 : '—' }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="审核时间" align="center" min-width="140">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.审核时间 ? scope.row.审核时间 : '—' }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="审批情况" align="center" min-width="80">
|
<el-table-column label="审批情况" align="center" min-width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.审批情况内容==='未审批'" type="primary" size="small">未审批</el-tag>
|
<el-tag v-if="scope.row.审批情况内容==='未审批'" type="primary" size="small">未审批</el-tag>
|
||||||
@@ -123,31 +128,26 @@
|
|||||||
<el-tag v-if="scope.row.审批情况内容==='不通过审批'" type="danger" size="small">未通过</el-tag>
|
<el-tag v-if="scope.row.审批情况内容==='不通过审批'" type="danger" size="small">未通过</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="未通过审核原因" align="center" min-width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.未通过审核原因 ? scope.row.未通过审核原因 : '—' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="未通过审批原因" align="center" min-width="150">
|
<el-table-column label="未通过审批原因" align="center" min-width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.未通过原因 ? scope.row.未通过原因 : '—' }}
|
{{ scope.row.未通过原因 ? scope.row.未通过原因 : '—' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="审核时间" align="center" min-width="140">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.审核时间 ? scope.row.审核时间 : '—' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="审批时间" align="center" min-width="140">
|
<el-table-column label="审批时间" align="center" min-width="140">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.审批时间 ? scope.row.审核时间 : '—' }}
|
{{ scope.row.审批时间 ? scope.row.审核时间 : '—' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="采购合同号" align="center" min-width="160">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.采购合同编号 }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="采购合同名称" align="center" min-width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.采购合同名称 }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="供应商" align="center" min-width="220">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.供应商名称 }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="采购员" align="center" min-width="60">
|
<el-table-column label="采购员" align="center" min-width="60">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.姓名 }}
|
{{ scope.row.姓名 }}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-tabs type="border-card" @tab-click="searchTable1();searchTable2()">
|
<el-tabs v-model="tabName" type="border-card" @tab-click="searchTable1();searchTable2()">
|
||||||
<el-tab-pane label="标准件和外购件">
|
<el-tab-pane label="标准件和外购件" name="标准件和外购件">
|
||||||
<el-row style="margin-bottom: 5px">
|
<el-row style="margin-bottom: 5px">
|
||||||
<span style="margin-left: 0">项目名称:</span>
|
<span style="margin-left: 0">项目名称:</span>
|
||||||
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable @change="projectChange">
|
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable @change="projectChange">
|
||||||
@@ -101,18 +101,17 @@
|
|||||||
<el-input v-model="materialModel" placeholder="物料型号" size="small" clearable/>
|
<el-input v-model="materialModel" placeholder="物料型号" size="small" clearable/>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row style="margin-bottom: 10px">
|
<el-row style="margin-bottom: 10px">
|
||||||
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 600px" height="600px" border stripe @selection-change="handleSelectionChange1">
|
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 600px" height="500px" border stripe @selection-change="handleSelectionChange1">
|
||||||
<el-table-column :selectable="selectable" align="center" type="selection"/>
|
<el-table-column :selectable="selectable" align="center" type="selection"/>
|
||||||
<el-table-column align="center" label="采购情况" min-width="80px">
|
<el-table-column align="center" label="采购情况" min-width="80px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.是否未通过" type="info" size="small">已作废</el-tag>
|
<el-tag v-if="scope.row.人员编号===''" type="primary" size="small">未分配</el-tag>
|
||||||
<el-tag v-else-if="scope.row.人员编号===''" type="primary" size="small">未分配</el-tag>
|
<el-tag v-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">未询价</el-tag>
|
||||||
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">未询价</el-tag>
|
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
|
||||||
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
|
<el-tag v-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
|
||||||
<el-tag v-else-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="项目名称" min-width="150px">
|
<el-table-column align="center" label="项目名称" min-width="100px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.项目名称 }}
|
{{ scope.row.项目名称 }}
|
||||||
</template>
|
</template>
|
||||||
@@ -187,6 +186,16 @@
|
|||||||
{{ scope.row.任务分配时间 ? scope.row.任务分配时间.split(' ')[0] : '—' }}
|
{{ scope.row.任务分配时间 ? scope.row.任务分配时间.split(' ')[0] : '—' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="撤回分配" min-width="100px" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
:disabled="!(parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='')"
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-back"
|
||||||
|
@click="retract(scope.row)">撤回</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
@@ -201,7 +210,7 @@
|
|||||||
@current-change="handleCurrentChange1"/>
|
@current-change="handleCurrentChange1"/>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="基本件">
|
<el-tab-pane label="基本件" name="基本件">
|
||||||
<el-row style="margin-bottom: 5px">
|
<el-row style="margin-bottom: 5px">
|
||||||
<span style="margin-left: 0">项目名称:</span>
|
<span style="margin-left: 0">项目名称:</span>
|
||||||
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable @change="projectChange">
|
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable @change="projectChange">
|
||||||
@@ -278,18 +287,17 @@
|
|||||||
<el-input v-model="partMaterial" placeholder="零件材料" size="small" clearable/>
|
<el-input v-model="partMaterial" placeholder="零件材料" size="small" clearable/>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row style="margin-bottom: 10px">
|
<el-row style="margin-bottom: 10px">
|
||||||
<el-table v-loading="" :data="tableData2" size="mini" style="max-height: 600px" height="600px" border stripe @selection-change="handleSelectionChange2">
|
<el-table v-loading="" :data="tableData2" size="mini" style="max-height: 600px" height="500px" border stripe @selection-change="handleSelectionChange2">
|
||||||
<el-table-column :selectable="selectable" align="center" type="selection"/>
|
<el-table-column :selectable="selectable" align="center" type="selection"/>
|
||||||
<el-table-column align="center" label="采购情况" min-width="80px">
|
<el-table-column align="center" label="采购情况" min-width="80px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.是否未通过" type="info" size="small">已作废</el-tag>
|
<el-tag v-if="scope.row.人员编号===''" type="primary" size="small">未分配</el-tag>
|
||||||
<el-tag v-else-if="scope.row.人员编号===''" type="primary" size="small">未分配</el-tag>
|
<el-tag v-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">未询价</el-tag>
|
||||||
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">未询价</el-tag>
|
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
|
||||||
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">已询价</el-tag>
|
<el-tag v-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
|
||||||
<el-tag v-else-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="项目名称" min-width="150px">
|
<el-table-column align="center" label="项目名称" min-width="100px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.项目名称 }}
|
{{ scope.row.项目名称 }}
|
||||||
</template>
|
</template>
|
||||||
@@ -359,6 +367,16 @@
|
|||||||
{{ scope.row.任务分配时间 ? scope.row.任务分配时间.split(' ')[0] : '—' }}
|
{{ scope.row.任务分配时间 ? scope.row.任务分配时间.split(' ')[0] : '—' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="撤回分配" min-width="100px" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
:disabled="!(parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='')"
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-back"
|
||||||
|
@click="retract(scope.row)">撤回</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
@@ -378,13 +396,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { initMaterialCategory, initMaterialVariety, initProject, initBuyer, searchMachine, searchGroup, searchTable1, searchTable2, allocateTask1, allocateTask2, executeReturn1, executeReturn2 } from '@/api/PurchasingCenter/PurchaseTaskAllocate'
|
import { initMaterialCategory, initMaterialVariety, initProject, initBuyer, searchMachine, searchGroup, searchTable1, searchTable2, allocateTask1,
|
||||||
|
allocateTask2, executeReturn1, executeReturn2, retract1, retract2 } from '@/api/PurchasingCenter/PurchaseTaskAllocate'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: '', // 采购任务分配
|
name: '', // 采购任务分配
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
tabName: '标准件和外购件',
|
||||||
partNum: '',
|
partNum: '',
|
||||||
partName: '',
|
partName: '',
|
||||||
partSpec: '',
|
partSpec: '',
|
||||||
@@ -462,6 +482,39 @@ export default {
|
|||||||
this.fetchData() // 初始化数据
|
this.fetchData() // 初始化数据
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 撤回
|
||||||
|
retract(row) {
|
||||||
|
this.$confirm('是否撤回重新分配?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
if (this.tabName === '基本件') {
|
||||||
|
retract2(row.基本件流水号).then(res => {
|
||||||
|
if (Number(res.data[0].result) === 1) {
|
||||||
|
this.$message.success('撤回成功')
|
||||||
|
this.searchTable2()
|
||||||
|
} else {
|
||||||
|
this.$message.error('撤回失败')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
retract1(row.标准件和外购件流水号).then(res => {
|
||||||
|
if (Number(res.data[0].result) === 1) {
|
||||||
|
this.$message.success('撤回成功')
|
||||||
|
this.searchTable1()
|
||||||
|
} else {
|
||||||
|
this.$message.error('撤回失败')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消操作'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
fetchData() { // 初始化
|
fetchData() { // 初始化
|
||||||
initProject().then(response => {
|
initProject().then(response => {
|
||||||
for (let i = 0; i < response.data.length; i++) {
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
@@ -540,7 +593,6 @@ export default {
|
|||||||
this.groupValue ? check6 = 1 : check6 = 0
|
this.groupValue ? check6 = 1 : check6 = 0
|
||||||
searchTable2(this.pageCurrent2, this.pageSize2, this.check3, this.projectValue, check5, this.machineValue, check6, this.groupValue, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.partNum, check2, this.partName, check3, this.partSpec, check4, this.partMaterial).then(response => {
|
searchTable2(this.pageCurrent2, this.pageSize2, this.check3, this.projectValue, check5, this.machineValue, check6, this.groupValue, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.partNum, check2, this.partName, check3, this.partSpec, check4, this.partMaterial).then(response => {
|
||||||
this.tableData2 = response.data.rows
|
this.tableData2 = response.data.rows
|
||||||
console.log(response.data.rows)
|
|
||||||
this.total2 = response.data.total
|
this.total2 = response.data.total
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user