Commit acae3d48 authored by 位宇华's avatar 位宇华

ui 代码提交

parent 3b91e088
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
"description": "开滦集团报送系统", "description": "开滦集团报送系统",
"author": "若依", "author": "若依",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build", "build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging", "build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview", "preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src" "lint": "eslint --ext .js,.vue src"
}, },
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "lint-staged" "pre-commit": "lint-staged"
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",
"lint-staged": "10.5.3", "lint-staged": "10.5.3",
"luckyexcel": "^1.0.1", "luckyexcel": "^1.0.1",
"moment": "^2.30.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"quill": "1.3.7", "quill": "1.3.7",
"runjs": "4.4.2", "runjs": "4.4.2",
......
...@@ -4,364 +4,364 @@ import Excel from 'exceljs'; ...@@ -4,364 +4,364 @@ import Excel from 'exceljs';
import FileSaver from 'file-saver'; import FileSaver from 'file-saver';
const exportExcel = function (luckysheet, value, contrast, id) { const exportExcel = function (luckysheet, value, contrast, id) {
// 函数体 // 函数体
// 参数为luckysheet.getluckysheetfile()获取的对象 // 参数为luckysheet.getluckysheetfile()获取的对象
// 1.创建工作簿,可以为工作簿添加属性 // 1.创建工作簿,可以为工作簿添加属性
const workbook = new Excel.Workbook(); const workbook = new Excel.Workbook();
// 2.创建表格,第二个参数可以配置创建什么样的工作表 // 2.创建表格,第二个参数可以配置创建什么样的工作表
if (Object.prototype.toString.call(luckysheet) === '[object Object]') { if (Object.prototype.toString.call(luckysheet) === '[object Object]') {
luckysheet = [luckysheet]; luckysheet = [luckysheet];
} }
luckysheet.forEach(function (table) { luckysheet.forEach(function (table) {
if (table.data.length === 0) { return true; } if (table.data.length === 0) { return true; }
// ws.getCell('B2').fill = fills. // ws.getCell('B2').fill = fills.
const worksheet = workbook.addWorksheet(table.name); const worksheet = workbook.addWorksheet(table.name);
const merge = (table.config && table.config.merge) || {}; const merge = (table.config && table.config.merge) || {};
const borderInfo = (table.config && table.config.borderInfo) || {}; const borderInfo = (table.config && table.config.borderInfo) || {};
// 3.设置单元格合并,设置单元格边框,设置单元格样式,设置值 // 3.设置单元格合并,设置单元格边框,设置单元格样式,设置值
setStyleAndValue(table.data, worksheet, contrast); setStyleAndValue(table.data, worksheet, contrast);
setMerge(merge, worksheet); setMerge(merge, worksheet);
setBorder(borderInfo, worksheet); setBorder(borderInfo, worksheet);
if (id === 1248) { if (id === 1248) {
worksheet.getRow(2).hidden = true; worksheet.getRow(2).hidden = true;
worksheet.getRow(3).hidden = true; worksheet.getRow(3).hidden = true;
worksheet.getRow(4).hidden = true; worksheet.getRow(4).hidden = true;
worksheet.getRow(5).hidden = true; worksheet.getRow(5).hidden = true;
} }
return true; return true;
}); });
// return // return
// 4.写入 buffer // 4.写入 buffer
const buffer = workbook.xlsx.writeBuffer().then(data => { const buffer = workbook.xlsx.writeBuffer().then(data => {
// console.log('data', data) // console.log('data', data)
const blob = new Blob([data], { const blob = new Blob([data], {
type: 'application/vnd.ms-excel;charset=utf-8' type: 'application/vnd.ms-excel;charset=utf-8'
});
console.log('导出成功!');
FileSaver.saveAs(blob, `${value}.xlsx`);
}); });
return buffer; console.log('导出成功!');
FileSaver.saveAs(blob, `${value}.xlsx`);
});
return buffer;
}; };
var setMerge = function (luckyMerge = {}, worksheet) { var setMerge = function (luckyMerge = {}, worksheet) {
const mergearr = Object.values(luckyMerge); const mergearr = Object.values(luckyMerge);
mergearr.forEach(function (elem) { mergearr.forEach(function (elem) {
// elem格式:{r: 0, c: 0, rs: 1, cs: 2} // elem格式:{r: 0, c: 0, rs: 1, cs: 2}
// 按开始行,开始列,结束行,结束列合并(相当于 K10:M12) // 按开始行,开始列,结束行,结束列合并(相当于 K10:M12)
worksheet.mergeCells( worksheet.mergeCells(
elem.r + 1, elem.r + 1,
elem.c + 1, elem.c + 1,
elem.r + elem.rs, elem.r + elem.rs,
elem.c + elem.cs elem.c + elem.cs
); );
}); });
}; };
var setBorder = function (luckyBorderInfo, worksheet) { var setBorder = function (luckyBorderInfo, worksheet) {
if (!Array.isArray(luckyBorderInfo)) { return; } if (!Array.isArray(luckyBorderInfo)) { return; }
// console.log('luckyBorderInfo', luckyBorderInfo) // console.log('luckyBorderInfo', luckyBorderInfo)
luckyBorderInfo.forEach(function (elem) { luckyBorderInfo.forEach(function (elem) {
// 现在只兼容到borderType 为range的情况 // 现在只兼容到borderType 为range的情况
// console.log('ele', elem) // console.log('ele', elem)
if (elem.rangeType === 'range') { if (elem.rangeType === 'range') {
let border = borderConvert(elem.borderType, elem.style, elem.color); let border = borderConvert(elem.borderType, elem.style, elem.color);
let rang = elem.range[0]; let rang = elem.range[0];
// console.log('range', rang) // console.log('range', rang)
let row = rang.row; let row = rang.row;
let column = rang.column; let column = rang.column;
for (let i = row[0] + 1; i < row[1] + 2; i++) { for (let i = row[0] + 1; i < row[1] + 2; i++) {
for (let y = column[0] + 1; y < column[1] + 2; y++) { for (let y = column[0] + 1; y < column[1] + 2; y++) {
worksheet.getCell(i, y).border = border; worksheet.getCell(i, y).border = border;
}
}
}
if (elem.rangeType === 'cell') {
// col_index: 2
// row_index: 1
// b: {
// color: '#d0d4e3'
// style: 1
// }
const { col_index, row_index } = elem.value;
const borderData = Object.assign({}, elem.value);
delete borderData.col_index;
delete borderData.row_index;
let border = addborderToCell(borderData, row_index, col_index);
// console.log('bordre', border, borderData)
worksheet.getCell(row_index + 1, col_index + 1).border = border;
} }
// console.log(rang.column_focus + 1, rang.row_focus + 1) }
// worksheet.getCell(rang.row_focus + 1, rang.column_focus + 1).border = border }
}); if (elem.rangeType === 'cell') {
// col_index: 2
// row_index: 1
// b: {
// color: '#d0d4e3'
// style: 1
// }
const { col_index, row_index } = elem.value;
const borderData = Object.assign({}, elem.value);
delete borderData.col_index;
delete borderData.row_index;
let border = addborderToCell(borderData, row_index, col_index);
// console.log('bordre', border, borderData)
worksheet.getCell(row_index + 1, col_index + 1).border = border;
}
// console.log(rang.column_focus + 1, rang.row_focus + 1)
// worksheet.getCell(rang.row_focus + 1, rang.column_focus + 1).border = border
});
}; };
var setStyleAndValue = function (cellArr, worksheet, contrast) { var setStyleAndValue = function (cellArr, worksheet, contrast) {
if (!Array.isArray(cellArr)) { return; } if (!Array.isArray(cellArr)) { return; }
cellArr.forEach(function (row, rowid) { cellArr.forEach(function (row, rowid) {
row.every(function (cell, columnid) { row.every(function (cell, columnid) {
if (!cell) { return true; } if (!cell) { return true; }
let fill = fillConvert(cell.bg); let fill = fillConvert(cell.bg);
let font = fontConvert( let font = fontConvert(
cell.ff, cell.ff,
cell.fc, cell.fc,
cell.bl, cell.bl,
cell.it, cell.it,
cell.fs, cell.fs,
cell.cl, cell.cl,
cell.ul, cell.ul,
cell.ps cell.ps
); );
let alignment = alignmentConvert(cell.vt, cell.ht, cell.tb, cell.tr); let alignment = alignmentConvert(cell.vt, cell.ht, cell.tb, cell.tr);
let value = ''; let value = '';
if (cell.f) { if (cell.f) {
value = { formula: cell.f, result: cell.v }; value = { formula: cell.f, result: cell.v };
} else if (!cell.v && cell.ct && cell.ct.s) { } else if (!cell.v && cell.ct && cell.ct.s) {
// xls转为xlsx之后,内部存在不同的格式,都会进到富文本里,即值不存在与cell.v,而是存在于cell.ct.s之后 // xls转为xlsx之后,内部存在不同的格式,都会进到富文本里,即值不存在与cell.v,而是存在于cell.ct.s之后
// value = cell.ct.s[0].v // value = cell.ct.s[0].v
cell.ct.s.forEach(arr => { cell.ct.s.forEach(arr => {
value += arr.v; value += arr.v;
}); });
} else { } else {
value = cell.v; value = cell.v;
} }
// style 填入到_value中可以实现填充色 // style 填入到_value中可以实现填充色
let letter = createCellPos(columnid); let letter = createCellPos(columnid);
let target = worksheet.getCell(letter + (rowid + 1)); let target = worksheet.getCell(letter + (rowid + 1));
if (contrast) { if (contrast) {
const column = worksheet.getColumn(1); const column = worksheet.getColumn(1);
const column2 = worksheet.getColumn(2); const column2 = worksheet.getColumn(2);
column.hidden = true; column.hidden = true;
column2.hidden = true; column2.hidden = true;
} }
// console.log('1233', letter + (rowid + 1)) // console.log('1233', letter + (rowid + 1))
for (const key in fill) { for (const key in fill) {
target.fill = fill; target.fill = fill;
break; break;
} }
target.font = font; target.font = font;
target.alignment = alignment; target.alignment = alignment;
target.value = value; target.value = value;
return true; return true;
});
}); });
});
}; };
var fillConvert = function (bg) { var fillConvert = function (bg) {
if (!bg) { if (!bg) {
return {}; return {};
} }
// const bgc = bg.replace('#', '') // const bgc = bg.replace('#', '')
let fill = { let fill = {
type: 'pattern', type: 'pattern',
pattern: 'solid', pattern: 'solid',
fgColor: { argb: bg.replace('#', '') } fgColor: { argb: bg.replace('#', '') }
}; };
return fill; return fill;
}; };
var fontConvert = function ( var fontConvert = function (
ff = 0, ff = 0,
fc = '#000000', fc = '#000000',
bl = 0, bl = 0,
it = 0, it = 0,
fs = 10, fs = 10,
cl = 0, cl = 0,
ul = 0, ul = 0,
) { ) {
// luckysheet:ff(样式), fc(颜色), bl(粗体), it(斜体), fs(大小), cl(删除线), ul(下划线) // luckysheet:ff(样式), fc(颜色), bl(粗体), it(斜体), fs(大小), cl(删除线), ul(下划线)
const luckyToExcel = { const luckyToExcel = {
0: '微软雅黑', 0: '微软雅黑',
1: '宋体(Song)', 1: '宋体(Song)',
2: '黑体(ST Heiti)', 2: '黑体(ST Heiti)',
3: '楷体(ST Kaiti)', 3: '楷体(ST Kaiti)',
4: '仿宋(ST FangSong)', 4: '仿宋(ST FangSong)',
5: '新宋体(ST Song)', 5: '新宋体(ST Song)',
6: '华文新魏', 6: '华文新魏',
7: '华文行楷', 7: '华文行楷',
8: '华文隶书', 8: '华文隶书',
9: 'Arial', 9: 'Arial',
10: 'Times New Roman ', 10: 'Times New Roman ',
11: 'Tahoma ', 11: 'Tahoma ',
12: 'Verdana', 12: 'Verdana',
num2bl: function (num) { num2bl: function (num) {
return num === 0 ? false : true; return num === 0 ? false : true;
} }
}; };
// 出现Bug,导入的时候ff为luckyToExcel的val // 出现Bug,导入的时候ff为luckyToExcel的val
let font = { let font = {
name: typeof ff === 'number' ? luckyToExcel[ff] : ff, name: typeof ff === 'number' ? luckyToExcel[ff] : ff,
family: 1, family: 1,
size: fs, size: fs,
color: { argb: fc.replace('#', '') }, color: { argb: fc.replace('#', '') },
bold: luckyToExcel.num2bl(bl), bold: luckyToExcel.num2bl(bl),
italic: luckyToExcel.num2bl(it), italic: luckyToExcel.num2bl(it),
underline: luckyToExcel.num2bl(ul), underline: luckyToExcel.num2bl(ul),
strike: luckyToExcel.num2bl(cl), strike: luckyToExcel.num2bl(cl),
}; };
return font; return font;
}; };
var alignmentConvert = function ( var alignmentConvert = function (
vt = 'default', vt = 'default',
ht = 'default', ht = 'default',
tb = 'default', tb = 'default',
tr = 'default', tr = 'default',
) { ) {
// luckysheet:vt(垂直), ht(水平), tb(换行), tr(旋转) // luckysheet:vt(垂直), ht(水平), tb(换行), tr(旋转)
const luckyToExcel = { const luckyToExcel = {
vertical: { vertical: {
0: 'middle', 0: 'middle',
1: 'top', 1: 'top',
2: 'bottom', 2: 'bottom',
default: 'top' default: 'top'
}, },
horizontal: { horizontal: {
0: 'center', 0: 'center',
1: 'left', 1: 'left',
2: 'right', 2: 'right',
default: 'left' default: 'left'
}, },
wrapText: { wrapText: {
0: false, 0: false,
1: false, 1: false,
2: true, 2: true,
default: false default: false
}, },
textRotation: { textRotation: {
0: 0, 0: 0,
1: 45, 1: 45,
2: -45, 2: -45,
3: 'vertical', 3: 'vertical',
4: 90, 4: 90,
5: -90, 5: -90,
default: 0 default: 0
} }
}; };
let alignment = { let alignment = {
vertical: luckyToExcel.vertical[vt], vertical: luckyToExcel.vertical[vt],
horizontal: luckyToExcel.horizontal[ht], horizontal: luckyToExcel.horizontal[ht],
wrapText: luckyToExcel.wrapText[tb], wrapText: luckyToExcel.wrapText[tb],
textRotation: luckyToExcel.textRotation[tr], textRotation: luckyToExcel.textRotation[tr],
}; };
return alignment; return alignment;
}; };
var borderConvert = function (borderType, style = 1, color = '#000') { var borderConvert = function (borderType, style = 1, color = '#000') {
// 对应luckysheet的config中borderinfo的的参数 // 对应luckysheet的config中borderinfo的的参数
if (!borderType) { if (!borderType) {
return {}; return {};
} }
const luckyToExcel = { const luckyToExcel = {
type: { type: {
'border-all': 'all', 'border-all': 'all',
'border-top': 'top', 'border-top': 'top',
'border-right': 'right', 'border-right': 'right',
'border-bottom': 'bottom', 'border-bottom': 'bottom',
'border-left': 'left' 'border-left': 'left'
}, },
style: { style: {
0: 'none', 0: 'none',
1: 'thin', 1: 'thin',
2: 'hair', 2: 'hair',
3: 'dotted', 3: 'dotted',
4: 'dashDot', // 'Dashed', 4: 'dashDot', // 'Dashed',
5: 'dashDot', 5: 'dashDot',
6: 'dashDotDot', 6: 'dashDotDot',
7: 'double', 7: 'double',
8: 'medium', 8: 'medium',
9: 'mediumDashed', 9: 'mediumDashed',
10: 'mediumDashDot', 10: 'mediumDashDot',
11: 'mediumDashDotDot', 11: 'mediumDashDotDot',
12: 'slantDashDot', 12: 'slantDashDot',
13: 'thick' 13: 'thick'
}
};
let template = {
style: luckyToExcel.style[style],
color: { argb: color.replace('#', '') }
};
let border = {};
if (luckyToExcel.type[borderType] === 'all') {
border['top'] = template;
border['right'] = template;
border['bottom'] = template;
border['left'] = template;
} else {
border[luckyToExcel.type[borderType]] = template;
} }
// console.log('border', border) };
return border; let template = {
style: luckyToExcel.style[style],
color: { argb: color.replace('#', '') }
};
let border = {};
if (luckyToExcel.type[borderType] === 'all') {
border['top'] = template;
border['right'] = template;
border['bottom'] = template;
border['left'] = template;
} else {
border[luckyToExcel.type[borderType]] = template;
}
// console.log('border', border)
return border;
}; };
function addborderToCell(borders, row_index, col_index) { function addborderToCell(borders, row_index, col_index) {
let border = {}; let border = {};
const luckyExcel = { const luckyExcel = {
type: { type: {
l: 'left', l: 'left',
r: 'right', r: 'right',
b: 'bottom', b: 'bottom',
t: 'top' t: 'top'
}, },
style: { style: {
0: 'none', 0: 'none',
1: 'thin', 1: 'thin',
2: 'hair', 2: 'hair',
3: 'dotted', 3: 'dotted',
4: 'dashDot', // 'Dashed', 4: 'dashDot', // 'Dashed',
5: 'dashDot', 5: 'dashDot',
6: 'dashDotDot', 6: 'dashDotDot',
7: 'double', 7: 'double',
8: 'medium', 8: 'medium',
9: 'mediumDashed', 9: 'mediumDashed',
10: 'mediumDashDot', 10: 'mediumDashDot',
11: 'mediumDashDotDot', 11: 'mediumDashDotDot',
12: 'slantDashDot', 12: 'slantDashDot',
13: 'thick' 13: 'thick'
}
};
// console.log('borders', borders)
for (const bor in borders) {
// console.log(bor)
if (borders[bor].color.indexOf('rgb') === -1) {
border[luckyExcel.type[bor]] = {
style: luckyExcel.style[borders[bor].style],
color: { argb: borders[bor].color.replace('#', '') }
};
} else {
border[luckyExcel.type[bor]] = {
style: luckyExcel.style[borders[bor].style],
color: { argb: borders[bor].color }
};
}
} }
};
// console.log('borders', borders)
for (const bor in borders) {
// console.log(bor)
if (borders[bor].color.indexOf('rgb') === -1) {
border[luckyExcel.type[bor]] = {
style: luckyExcel.style[borders[bor].style],
color: { argb: borders[bor].color.replace('#', '') }
};
} else {
border[luckyExcel.type[bor]] = {
style: luckyExcel.style[borders[bor].style],
color: { argb: borders[bor].color }
};
}
}
return border; return border;
} }
function createCellPos(n) { function createCellPos(n) {
let ordA = 'A'.charCodeAt(0); let ordA = 'A'.charCodeAt(0);
let ordZ = 'Z'.charCodeAt(0); let ordZ = 'Z'.charCodeAt(0);
let len = ordZ - ordA + 1; let len = ordZ - ordA + 1;
let s = ''; let s = '';
while (n >= 0) { while (n >= 0) {
s = String.fromCharCode((n % len) + ordA) + s; s = String.fromCharCode((n % len) + ordA) + s;
n = Math.floor(n / len) - 1; n = Math.floor(n / len) - 1;
} }
return s; return s;
} }
export { export {
exportExcel exportExcel
}; };
...@@ -17,13 +17,6 @@ ...@@ -17,13 +17,6 @@
<script src="/expendPlugins/chart/chartmix.umd.min.js"></script> <script src="/expendPlugins/chart/chartmix.umd.min.js"></script>
<!--<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/plugins/css/pluginsCss.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/plugins/plugins.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/css/luckysheet.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/assets/iconfont/iconfont.css' />
<script src="./luckysheet/plugins/js/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/plugins/js/plugin.js"></script>
<script src="https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/luckysheet.umd.js"></script>-->
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
<style> <style>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -8,14 +8,13 @@ export function selectActSuppliesHistorydata(tylkStatus) { ...@@ -8,14 +8,13 @@ export function selectActSuppliesHistorydata(tylkStatus) {
}) })
} }
//查询通用凭证单表数据
// 查询通用凭证单表数据
export function selectActSuppliesHistorydataAcc(tylkStatus) { export function selectActSuppliesHistorydataAcc(tylkStatus) {
return request({ return request({
url: '/system/cleaningrule/queryAllAcc/'+tylkStatus, url: '/system/cleaningrule/queryAllAcc/'+tylkStatus,
method: 'get' method: 'get'
}) })
} }
...@@ -50,6 +49,8 @@ export function selectActSuppliesHistorydataAcc(tylkStatus) { ...@@ -50,6 +49,8 @@ export function selectActSuppliesHistorydataAcc(tylkStatus) {
......
...@@ -2,27 +2,27 @@ import request from '@/utils/request' ...@@ -2,27 +2,27 @@ import request from '@/utils/request'
import LuckyExcel from "luckyexcel"; import LuckyExcel from "luckyexcel";
//查询6矿物聊 //查询6矿物聊
export function materialListPZ() { export function materialListPZ() {
return request({ return request({
url: '/ActSuppliesDetails/ActSuppliesDetails/materialListPZ' , url: '/ActSuppliesDetails/ActSuppliesDetails/materialListPZ' ,
method: 'get' method: 'get'
}) })
} }
//小物料转大物料 //小物料转大物料
export function materialConvert(data) { export function materialConvert(data) {
return request({ return request({
url: '/ActSuppliesConvert/ActSuppliesConvert/converSupplies', url: '/ActSuppliesConvert/ActSuppliesConvert/converSupplies',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 查询Excel模板列表 // 查询Excel模板列表
export function listSuppliesTemplate(query) { export function listSuppliesTemplate(query) {
return request({ return request({
url: '/SuppliesTemplate/SuppliesTemplate/list', url: '/SuppliesTemplate/SuppliesTemplate/list',
method: 'get', method: 'get',
params: query params: query
}) })
} }
// 查询导入规则列表 // 查询导入规则列表
...@@ -44,32 +44,32 @@ export function getSuppliesrole(id) { ...@@ -44,32 +44,32 @@ export function getSuppliesrole(id) {
export function department(sskId){ export function department(sskId){
return request({ return request({
url: `/ActClassification/ActClassification/SunDy/${sskId}`, url: `/ActClassification/ActClassification/SunDy/${sskId}`,
method: 'get' method: 'get'
}) })
} }
//获取到会计科目编码 //获取到会计科目编码
export function accountingcode(newData){ export function accountingcode(newData){
return request({ return request({
url: `/ActSuppliesAccount/ActSuppliesAccount/options`, url: `/ActSuppliesAccount/ActSuppliesAccount/options`,
method: 'post', method: 'post',
data: newData data: newData
}) })
} }
//展示excel模板 //展示excel模板
export function listSuppliesTemplateId(id) { export function listSuppliesTemplateId(id) {
return request({ return request({
url: '/SuppliesTemplate/SuppliesTemplate/listId/' + id, url: '/SuppliesTemplate/SuppliesTemplate/listId/' + id,
method: 'get' method: 'get'
}) })
} }
// 查询Excel模板详细 // 查询Excel模板详细
export function getSuppliesTemplate(id) { export function getSuppliesTemplate(id) {
return request({ return request({
url: '/SuppliesTemplate/SuppliesTemplate/' + id, url: '/SuppliesTemplate/SuppliesTemplate/' + id,
method: 'get' method: 'get'
}) })
} }
// 修改导入规则 // 修改导入规则
...@@ -83,23 +83,23 @@ export function updateSuppliesrole(id) { ...@@ -83,23 +83,23 @@ export function updateSuppliesrole(id) {
// 新增Excel模板 // 新增Excel模板
export function addSuppliesTemplate(data) { export function addSuppliesTemplate(data) {
return request({ return request({
url: '/SuppliesTemplate/SuppliesTemplate', url: '/SuppliesTemplate/SuppliesTemplate',
headers:{ headers:{
repeatSubmit:false repeatSubmit:false
}, },
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 修改Excel模板 // 修改Excel模板
export function updateSuppliesTemplate(data) { export function updateSuppliesTemplate(data) {
return request({ return request({
url: '/SuppliesTemplate/SuppliesTemplate', url: '/SuppliesTemplate/SuppliesTemplate',
method: 'put', method: 'put',
data: data data: data
}) })
} }
export function releaseTemplateStatus(id){ export function releaseTemplateStatus(id){
...@@ -125,123 +125,123 @@ export function CopyTemplate(id){ ...@@ -125,123 +125,123 @@ export function CopyTemplate(id){
// 删除Excel模板 // 删除Excel模板
export function delSuppliesTemplate(id) { export function delSuppliesTemplate(id) {
return request({ return request({
url: '/SuppliesTemplate/SuppliesTemplate/' + id, url: '/SuppliesTemplate/SuppliesTemplate/' + id,
method: 'delete' method: 'delete'
}) })
} }
// 展示Excel模板 // 展示Excel模板
export function delSuppliesSave(id) { export function delSuppliesSave(id) {
return request({ return request({
url: '/SuppliesTemplate/SuppliesTemplate/save/' + id, url: '/SuppliesTemplate/SuppliesTemplate/save/' + id,
method: 'get' method: 'get'
}) })
} }
//启用 //启用
export function toggleEnable(id) { export function toggleEnable(id) {
return request({ return request({
url: '/SuppliesTemplate/SuppliesTemplate/enable/' +id, url: '/SuppliesTemplate/SuppliesTemplate/enable/' +id,
method: 'get', method: 'get',
}) })
} }
//禁用 //禁用
export function toggleDisable(id) { export function toggleDisable(id) {
return request({ return request({
url: '/SuppliesTemplate/SuppliesTemplate/disable/' + id, url: '/SuppliesTemplate/SuppliesTemplate/disable/' + id,
method: 'get', method: 'get',
}) })
} }
export function findName(name) { export function findName(name) {
return request({ return request({
url: '/SuppliesTemplate/SuppliesTemplate/ifName/' + name, url: '/SuppliesTemplate/SuppliesTemplate/ifName/' + name,
method: 'get' method: 'get'
}) })
} }
// 模板转换页面查询规则对应用友物料名称 // 模板转换页面查询规则对应用友物料名称
export function getSuppliesName(name) { export function getSuppliesName(name) {
return request({ return request({
url: '/ActSuppliesConvert/ActSuppliesConvert/saveSuppliesname/' + name, url: '/ActSuppliesConvert/ActSuppliesConvert/saveSuppliesname/' + name,
method: 'get' method: 'get'
}) })
} }
// 模板转换页面查询Excel模板列表 // 模板转换页面查询Excel模板列表
export function templateList(query) { export function templateList(query) {
return request({ return request({
url: '/ActSuppliesConvert/ActSuppliesConvert/list', url: '/ActSuppliesConvert/ActSuppliesConvert/list',
method: 'get', method: 'get',
params: query params: query
}) })
} }
// 模板转换页面查询Excel模板内容列表 // 模板转换页面查询Excel模板内容列表
export function templateListid(id) { export function templateListid(id) {
return request({ return request({
url: '/ActSuppliesConvert/ActSuppliesConvert/listid/' + id, url: '/ActSuppliesConvert/ActSuppliesConvert/listid/' + id,
method: 'get' method: 'get'
}) })
} }
// 模板转换页面查询规则列表 // 模板转换页面查询规则列表
export function roleList(id) { export function roleList(id) {
return request({ return request({
url: '/ActSuppliesConvert/ActSuppliesConvert/rolelist/' + id, url: '/ActSuppliesConvert/ActSuppliesConvert/rolelist/' + id,
method: 'get' method: 'get'
}) })
} }
// 模板转换页面查询规则详情列表 // 模板转换页面查询规则详情列表
export function roleListid(id) { export function roleListid(id) {
return request({ return request({
url: '/ActSuppliesConvert/ActSuppliesConvert/rolelistid/' + id, url: '/ActSuppliesConvert/ActSuppliesConvert/rolelistid/' + id,
method: 'get' method: 'get'
}) })
} }
// 查询规则列表 // 查询规则列表
export function listRule(query) { export function listRule(query) {
return request({ return request({
url: '/system/ruleManagement/list', url: '/system/ruleManagement/list',
method: 'get', method: 'get',
params: query params: query
}) })
} }
// 查询规则详情详细 // 查询规则详情详细
export function getRule(id) { export function getRule(id) {
return request({ return request({
url: '/system/ruleManagement/' + id, url: '/system/ruleManagement/' + id,
method: 'get' method: 'get'
}) })
} }
// 新增规则详情 // 新增规则详情
export function addRuleManagement(data) { export function addRuleManagement(data) {
return request({ return request({
url: '/system/ruleManagement/add', url: '/system/ruleManagement/add',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 修改规则详情 // 修改规则详情
export function updateRuleManagement(data) { export function updateRuleManagement(data) {
return request({ return request({
url: '/system/ruleManagement/edit', url: '/system/ruleManagement/edit',
method: 'put', method: 'put',
data: data data: data
}) })
} }
// 删除规则详情 // 删除规则详情
export function delRuleManagement(id) { export function delRuleManagement(id) {
return request({ return request({
url: '/system/ruleManagement/' + id, url: '/system/ruleManagement/' + id,
method: 'delete' method: 'delete'
}) })
} }
//查询六矿物料 //查询六矿物料
......
...@@ -55,66 +55,63 @@ export function exportHistorydata(query) { ...@@ -55,66 +55,63 @@ export function exportHistorydata(query) {
// 新增 历史数据 // 新增 历史数据
export function addInsert(data) { export function addInsert(data) {
return request({ return request({
url: '/system/historydata/addInsert', url: '/system/historydata/addInsertAccount',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 数据清洗 历史数据 // 数据清洗 历史数据
export function addInsert1(data) { export function addInsert1(data) {
return request({ return request({
url: '/system/historydata/addInsert1', url: '/system/historydata/addInsert1',
method: 'post', method: 'post',
data: data data: data
}) })
}
//清洗通用凭证单
export function addInsertAccount1(data) {
return request({
url: '/system/historydata/addInsertAccount1',
method: 'post',
data: data
})
}
//清洗通用凭证单
export function addInsertAccount2(data) {
console.log(data,'我发送的数据')
return request({
url: '/system/historydata/addInsertAccount2',
method: 'post',
data: data
})
} }
// 数据清洗 历史数据 // 数据清洗 历史数据
export function addInsert2(data) { export function addInsert2(data) {
return request({ return request({
url: '/system/historydata/addInsert2', url: '/system/historydata/addInsert2',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 数据清洗 历史数据 // 数据清洗 历史数据
export function addInsertConvert1(data) { export function addInsertConvert1(data) {
return request({ return request({
url: '/system/historydata/addInsertConvert1', url: '/system/historydata/addInsertConvert1',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 数据清洗 历史数据 // 数据清洗 历史数据
export function addInsertConvert2(data) { export function addInsertConvert2(data) {
return request({ return request({
url: '/system/historydata/addInsertConvert2', url: '/system/historydata/addInsertConvert2',
method: 'post', method: 'post',
data: data data: data
}) })
}
//清洗通用凭证单
export function addInsertAccount1(data) {
return request({
url: '/system/historydata/addInsertAccount1',
method: 'post',
data: data
})
}
//清洗通用凭证单
export function addInsertAccount2(data) {
return request({
url: '/system/historydata/addInsertAccount2',
method: 'post',
data: data
})
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<slot /> <slot />
</div> </div>
</div> </div>
<!-- eslint-disable-next-line --> eslint-disable-next-line -->
<div :style="{backgroundImage: `url(${image})`}" class="pan-thumb"></div> <div :style="{backgroundImage: `url(${image})`}" class="pan-thumb"></div>
</div> </div>
</template> </template>
......
...@@ -6,6 +6,7 @@ import tagsView from './modules/tagsView' ...@@ -6,6 +6,7 @@ import tagsView from './modules/tagsView'
import permission from './modules/permission' import permission from './modules/permission'
import settings from './modules/settings' import settings from './modules/settings'
import getters from './getters' import getters from './getters'
import userInfo from './modules/userInfo'
Vue.use(Vuex) Vue.use(Vuex)
...@@ -15,7 +16,8 @@ const store = new Vuex.Store({ ...@@ -15,7 +16,8 @@ const store = new Vuex.Store({
user, user,
tagsView, tagsView,
permission, permission,
settings settings,
userInfo
}, },
getters getters
}) })
......
const state = {
nickName: null
}
const mutations = {
SET_NICKNAME(state, nickname) {
state.nickName = nickname
}
}
const actions = {
setNickName({ commit }, nickname) {
commit('SET_NICKNAME', nickname)
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
\ No newline at end of file
...@@ -10,7 +10,7 @@ const service = axios.create({ ...@@ -10,7 +10,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分 // axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: process.env.VUE_APP_BASE_API, baseURL: process.env.VUE_APP_BASE_API,
// 超时 // 超时
timeout: 1000000000 timeout: 10000000000000
}) })
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
......
...@@ -111,30 +111,6 @@ ...@@ -111,30 +111,6 @@
@pagination="getList" @pagination="getList"
/> />
<!-- &lt;!&ndash; 添加或修改通用规则对话框 &ndash;&gt;-->
<!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
<!-- <el-form-item label="模板id" prop="tempId">-->
<!-- <el-input v-model="form.tempId" placeholder="请输入模板id" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="规则名称" prop="name">-->
<!-- <el-input v-model="form.name" placeholder="请输入规则名称" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="规则内容">-->
<!-- <editor v-model="form.content" :min-height="192"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="状态">-->
<!-- <el-radio-group v-model="form.status">-->
<!-- <el-radio label="1">请选择字典生成</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="submitForm">确 定</el-button>-->
<!-- <el-button @click="cancel">取 消</el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
<el-dialog :title="title" :visible.sync="open" width="1300px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1300px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="所属模板" prop="roleId"> <el-form-item label="所属模板" prop="roleId">
...@@ -159,10 +135,9 @@ ...@@ -159,10 +135,9 @@
</el-col> </el-col>
</el-row> </el-row>
<!-- 生成输入框 --> <!-- 生成输入框 -->
<div v-for="index in instea" :key="index" v-if=""> <div v-for="index in instea" :key="index">
<el-form-item label="导入表行/列/单元格选择" prop="detailMH" class="form-item-inline"> <el-form-item label="导入表行/列/单元格选择" prop="detailMH" class="form-item-inline">
<!-- <el-input-number size="medium" v-model="ZE[index-1]" :min="1" :step="1">1</el-input-number>-->
<el-select v-model="ZE[index-1]" filterable placeholder="请选择运算方法" > <el-select v-model="ZE[index-1]" filterable placeholder="请选择运算方法" >
<el-option <el-option
v-for="option in optionsOne" v-for="option in optionsOne"
...@@ -183,7 +158,6 @@ ...@@ -183,7 +158,6 @@
</el-form-item> </el-form-item>
<el-form-item label="模板表行/列/单元格选择" prop="detailMH" class="form-item-inline"> <el-form-item label="模板表行/列/单元格选择" prop="detailMH" class="form-item-inline">
<!-- <el-input-number size="medium" v-model="ZT[index-1]" :min="1" :step="1">1</el-input-number>-->
<el-select v-model="ZT[index-1]" filterable placeholder="请选择运算方法" > <el-select v-model="ZT[index-1]" filterable placeholder="请选择运算方法" >
<el-option <el-option
v-for="option in optionsOne" v-for="option in optionsOne"
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<el-form-item label="模板" prop="name"> <el-form-item label="模板" prop="name">
<el-select v-model="selectedOption" ref="mySelect" size="mini" @change="handleOptionChange" filterable <el-select v-model="selectedOption" ref="mySelect" size="mini" @change="handleOptionChange" filterable
placeholder="请选择您要查看的模板"> placeholder="请选择您要查看的模板">
<!-- <el-option label="自设的模板名" value="使用空白模板"></el-option>-->
<el-option <el-option
v-for="item in depss" :key="item.id" :label="item.templateName" :value="item.id"> v-for="item in depss" :key="item.id" :label="item.templateName" :value="item.id">
</el-option> </el-option>
......
...@@ -59,23 +59,6 @@ ...@@ -59,23 +59,6 @@
<el-table-column label="流程描述" align="center" prop="description" width="150" /> <el-table-column label="流程描述" align="center" prop="description" width="150" />
<el-table-column label="所属分类" align="center" prop="category" width="120" /> <el-table-column label="所属分类" align="center" prop="category" width="120" />
<el-table-column label="部署时间" align="center" prop="deploymentTime" width="100" /> <el-table-column label="部署时间" align="center" prop="deploymentTime" width="100" />
<!--<el-table-column label="流程定义" align="center" prop="resourceName" width="120">
<template slot-scope="scope">
<a
:href="baseURL + '/activiti/definition/readResource?pdid=' + scope.row.id + '&resourceName=' + scope.row.resourceName "
target="_blank"
style="color: #409EFF;"
>{{ scope.row.resourceName.substring(scope.row.resourceName.lastIndexOf('/') + 1) }}</a>
</template>
</el-table-column>
<el-table-column label="流程图" align="center" prop="diagramResourceName" width="120">
<template slot-scope="scope">
<img
style="width: 100px;"
:src="baseURL + '/activiti/definition/readResource?pdid=' + scope.row.id + '&resourceName=' + scope.row.diagramResourceName"
/>
</template>
</el-table-column>-->
<el-table-column label="状态" align="center" prop="suspendStateName" width="90" /> <el-table-column label="状态" align="center" prop="suspendStateName" width="90" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
:readonly="taskName!=='调整申请'"> :readonly="taskName!=='调整申请'">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<!--<el-form-item label="流程实例ID" prop="instanceId">
<el-input v-model="form.instanceId" readonly /> <el-input v-model="form.instanceId" readonly />
</el-form-item>--> </el-form-item>-->
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
</template> </template>
<script> <script>
import { getInfo } from "@/api/login";
...@@ -28,14 +29,18 @@ export default { ...@@ -28,14 +29,18 @@ export default {
return { return {
} }
},
mounted() {
}, },
methods: { methods: {
} }
} }
</script> </script>
<style scoped> <style scoped>
.container{ .container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: calc(100vh - 84px); height: calc(100vh - 84px);
...@@ -44,7 +49,7 @@ export default { ...@@ -44,7 +49,7 @@ export default {
background-size: cover; background-size: cover;
} }
.main-footer{ .main-footer {
position: absolute; position: absolute;
left: 0; left: 0;
bottom: 0; bottom: 0;
...@@ -58,78 +63,10 @@ export default { ...@@ -58,78 +63,10 @@ export default {
padding: 15px; padding: 15px;
} }
.main-footer .split{ .main-footer .split {
padding: 0 10px; padding: 0 10px;
font-size: 12px; font-size: 12px;
} }
</style> </style>
<!--<template>-->
<!-- <div class="container">-->
<!-- <div class="index">-->
<!-- </div>-->
<!-- <div class="input" style="position: absolute; bottom: 0;">-->
<!-- 开发中心-->
<!-- </div>-->
<!-- </div>-->
<!--&lt;!&ndash; 开滦(集团)财务共享中心&河北天翼科贸发展有限公司&ndash;&gt;-->
<!--</template>-->
<!--<script>-->
<!--export default {-->
<!-- name: 'Index',-->
<!-- components: {-->
<!-- },-->
<!-- data() {-->
<!-- return {-->
<!-- }-->
<!-- },-->
<!-- methods: {-->
<!-- }-->
<!--}-->
<!--</script>-->
<!--<style rel="stylesheet/scss" lang="scss">-->
<!-- .index {-->
<!-- display: flex;-->
<!-- justify-content: center;-->
<!-- align-items: center;-->
<!-- flex: 9;-->
<!-- height: 90vh;-->
<!-- background-image: url("../assets/images/login-background2.jpg");-->
<!-- background-position: center;-->
<!-- background-size: cover;-->
<!-- }-->
<!-- .title {-->
<!-- margin: 0px auto 30px auto;-->
<!-- text-align: center;-->
<!-- color: #707070;-->
<!-- }-->
<!-- .input{-->
<!-- flex: 1;-->
<!-- font-size: 30px;-->
<!-- color: #1b1b19;-->
<!-- }-->
<!-- .container {-->
<!-- display: flex;-->
<!-- flex-direction: column;-->
<!-- height: 100vh;-->
<!-- }-->
<!--</style>-->
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">开滦采集转换系统</h3> <h3 class="title">开滦采集转换系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号"> <el-input v-model="loginForm.username" type="btext" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" /> <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input> </el-input>
</el-form-item> </el-form-item>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</template> </template>
<script> <script>
import { getCodeImg } from "@/api/login"; import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt' import { encrypt, decrypt } from '@/utils/jsencrypt'
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable size="small" <el-input v-model="queryParams.name" placeholder="请输入名称" clearable size="small"
@keyup.enter.native="handleQuery" maxlength="36" /> @keyup.enter.native="handleQuery" maxlength="36" />
</el-form-item> </el-form-item>
<el-form-item label="上级分类" prop="id"> <el-form-item label="上级分类" prop="id">
<el-select v-model="queryParams.id" filterable clearable placeholder="请选择上级分类"> <el-select v-model="queryParams.id" filterable clearable placeholder="请选择上级分类">
...@@ -27,19 +27,19 @@ ...@@ -27,19 +27,19 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['ActClassification:ActClassification:add']">新增</el-button> v-hasPermi="['ActClassification:ActClassification:add']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
v-hasPermi="['ActClassification:ActClassification:edit']">修改</el-button> v-hasPermi="['ActClassification:ActClassification:edit']">修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['ActClassification:ActClassification:remove']">删除</el-button> v-hasPermi="['ActClassification:ActClassification:remove']">删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['ActClassification:ActClassification:export']">导出</el-button> v-hasPermi="['ActClassification:ActClassification:export']">导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<el-switch @change="toggleEnable(scope.row)" v-model="scope.row.status" :active-value="0" <el-switch @change="toggleEnable(scope.row)" v-model="scope.row.status" :active-value="0"
:inactive-value="1" active-color="#13ce66" inactive-color="#cccccc"> :inactive-value="1" active-color="#13ce66" inactive-color="#cccccc">
</el-switch> </el-switch>
</div> </div>
</template> </template>
...@@ -73,24 +73,25 @@ ...@@ -73,24 +73,25 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ActClassification:ActClassification:edit']">修改</el-button> v-hasPermi="['ActClassification:ActClassification:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ActClassification:ActClassification:remove']">删除</el-button> v-hasPermi="['ActClassification:ActClassification:remove']">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
<!-- 添加或修改分配信息对话框 --> <!-- 添加或修改分配信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="所属矿" prop="belongs"> <el-form-item label="所属矿" prop="belongs">
<el-select v-model="form.sskId" filterable placeholder="请输入所属矿" style="width:380px" @change="fetchOptions"> <el-select v-model="form.sskId" filterable placeholder="请输入所属矿" style="width:380px"
@change="fetchOptions">
<el-option v-for="option in miningValue" :key="option.name" :label="option.name" <el-option v-for="option in miningValue" :key="option.name" :label="option.name"
:value="option.id"></el-option> :value="option.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -100,7 +101,7 @@ ...@@ -100,7 +101,7 @@
<el-option v-for="items in types" :key="items.id" :label="items.name" :value="items.id"></el-option> <el-option v-for="items in types" :key="items.id" :label="items.name" :value="items.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="pid" > <el-form-item label="名称" prop="pid">
<el-input v-model="form.name" placeholder="请输入名称" maxlength="36" /> <el-input v-model="form.name" placeholder="请输入名称" maxlength="36" />
</el-form-item> </el-form-item>
<el-form-item label="所属费用来源" prop="source" v-if="typeid === 1"> <el-form-item label="所属费用来源" prop="source" v-if="typeid === 1">
...@@ -127,259 +128,247 @@ ...@@ -127,259 +128,247 @@
</template> </template>
<script> <script>
import { listActClassification, savePid, toggleEnable, toggleDisable, getActClassification, delActClassification, addActClassification, updateActClassification, exportActClassification } from "@/api/ActClassification/ActClassification"; import { listActClassification, savePid, toggleEnable, toggleDisable, getActClassification, delActClassification, addActClassification, updateActClassification, exportActClassification } from "@/api/ActClassification/ActClassification";
export default { export default {
name: "ActClassification", name: "ActClassification",
components: { components: {
}, },
data() { data() {
return { return {
miningValue: [ miningValue: [
{ {
name: '东欢坨矿', name: '东欢坨矿',
id: 1 id: '010102'
}, },
{ {
name: '范矿', name: '范矿',
id: 2 id: 2
}, },
{ {
name: '林西矿', name: '林西矿',
id: 3 id: '011704'
}, },
{ {
name: '吕矿', name: '吕矿',
id: 4 id: 4
}, },
{ {
name: '钱家营矿', name: '唐山矿',
id: 5 id: '010101'
}, },
{ {
name: '唐山矿', name: '单侯煤矿',
id: 6 id: '011204'
}, },
{ ],
name: '宏丰公司矿业', types: [
id: 7 {
}, id: 1,
{ name: '部门'
name: '云飞公司矿业',
id: 8
},
{
name: '单侯煤矿',
id: 9
},
],
types: [
{
id: 1,
name: '部门'
},
{
id: 2,
name: '费用来源'
}
],
typeid: '',
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 分配信息表格数据
ActClassificationList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
options: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
pid: null,
status: 0,
}, },
// 表单参数 {
form: {}, id: 2,
// 表单校验 name: '费用来源'
rules: {
} }
}; ],
}, typeid: '',
created() { // 遮罩层
this.getList(); loading: true,
}, // 选中数组
mounted() { ids: [],
}, // 非单个禁用
methods: { single: true,
typeValue(value) { // 非多个禁用
this.form.pid = '' multiple: true,
this.form.source = '' // 显示搜索条件
this.form.status = '' showSearch: true,
this.typeid = value // 总条数
total: 0,
// 分配信息表格数据
ActClassificationList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
options: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
pid: null,
status: 0,
}, },
/**启用 */ // 表单参数
toggleEnable(ActClassification) { form: {},
console.log('你点击了【' + ActClassification.name + '】的开关控件,当前开关值:' + ActClassification.status); // 表单校验
let enableText = ['启用', '禁用']; rules: {
if (ActClassification.status === 0) { }
toggleEnable(ActClassification.id).then((response) => { };
},
created() {
this.getList();
},
mounted() {
},
methods: {
typeValue(value) {
this.form.pid = ''
this.form.source = ''
this.form.status = ''
this.typeid = value
if (response.code === 200) { },
/**启用 */
toggleEnable(ActClassification) {
console.log('你点击了【' + ActClassification.name + '】的开关控件,当前开关值:' + ActClassification.status);
let enableText = ['启用', '禁用'];
if (ActClassification.status === 0) {
toggleEnable(ActClassification.id).then((response) => {
let message = '操作成功,已经将【' + ActClassification.name + '】的状态改为【' + enableText[ActClassification.status] + '】 !'; if (response.code === 200) {
this.$message({
message: message,
type: 'success'
});
} else {
this.$message.error(response.message);
}
});
} else {
toggleDisable(ActClassification.id).then((response) => {
if (response.code === 200) {
let message = '操作成功,已经将【' + ActClassification.name + '】的状态改为【' + enableText[ActClassification.status] + '】 !';
this.$message({
message: message,
type: 'error'
});
} else {
this.getList();
this.$message.error(response.message);
}
});
}
},
/** 查询上级关联关系*/ let message = '操作成功,已经将【' + ActClassification.name + '】的状态改为【' + enableText[ActClassification.status] + '】 !';
fetchOptions() { this.$message({
savePid(this.form.sskId).then(response => { message: message,
this.options = response.rows; type: 'success'
}); });
}, } else {
/** 查询分配信息列表 */ this.$message.error(response.message);
getList() { }
this.loading = true;
listActClassification(this.queryParams).then(response => {
this.ActClassificationList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
pid: null,
status: "0",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
type: null,
sskId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加分配信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getActClassification(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改分配信息";
}); });
}, } else {
/** 提交按钮 */ toggleDisable(ActClassification.id).then((response) => {
submitForm() { if (response.code === 200) {
console.log(this.form) let message = '操作成功,已经将【' + ActClassification.name + '】的状态改为【' + enableText[ActClassification.status] + '】 !';
this.$refs["form"].validate(valid => { this.$message({
if (valid) { message: message,
if (this.form.id != null) { type: 'error'
updateActClassification(this.form).then(response => { });
this.msgSuccess("修改成功"); } else {
this.open = false; this.getList();
this.getList(); this.$message.error(response.message);
});
} else {
addActClassification(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
} }
}); });
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除分配信息编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delActClassification(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有分配信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportActClassification(queryParams);
}).then(response => {
this.download(response.msg);
})
} }
},
/** 查询上级关联关系*/
fetchOptions(value) {
savePid(this.form.sskId).then(response => {
this.options = response.rows;
});
},
/** 查询分配信息列表 */
getList() {
this.loading = true;
listActClassification(this.queryParams).then(response => {
this.ActClassificationList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
pid: null,
status: "0",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
type: null,
sskId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加分配信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getActClassification(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改分配信息";
});
},
/** 提交按钮 */
submitForm() {
console.log(this.form)
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateActClassification(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addActClassification(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除分配信息编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delActClassification(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有分配信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportActClassification(queryParams);
}).then(response => {
this.download(response.msg);
})
} }
}; }
};
</script> </script>
...@@ -493,7 +493,7 @@ export default { ...@@ -493,7 +493,7 @@ export default {
this.fetchOptions(); this.fetchOptions();
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "新增物料分类"; this.title = "新增物料";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
......
...@@ -492,7 +492,7 @@ export default { ...@@ -492,7 +492,7 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "新增物料分类"; this.title = "新增二级分类";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
async handleUpdate(row) { async handleUpdate(row) {
......
...@@ -80,13 +80,13 @@ ...@@ -80,13 +80,13 @@
@click="handleDetails(scope.row)" @click="handleDetails(scope.row)"
v-hasPermi="['system:historydata']" v-hasPermi="['system:historydata']"
>详情</el-button> >详情</el-button>
<!-- <el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:historydata:remove']" v-hasPermi="['system:historydata:remove']"
>删除</el-button>--> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -166,13 +166,11 @@ export default { ...@@ -166,13 +166,11 @@ export default {
roleId: null, roleId: null,
historyName: null, historyName: null,
historyContent: null, historyContent: null,
historyRole:null,
identifyingCode: null, identifyingCode: null,
status: null, status: null,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
formContent:{},
}; };
}, },
...@@ -210,8 +208,7 @@ export default { ...@@ -210,8 +208,7 @@ export default {
exportUuid: null, exportUuid: null,
roleId: null, roleId: null,
historyName: null, historyName: null,
historyRole: null, historyContent: null,
historyContent: null,
identifyingCode: null, identifyingCode: null,
status: 0, status: 0,
createBy: null, createBy: null,
...@@ -273,27 +270,22 @@ export default { ...@@ -273,27 +270,22 @@ export default {
}, },
handleDetails(row) { handleDetails(row) {
getHistorydata(row.id).then(response => { this.positionValue = 'absolute';
this.formContent = response.data; luckysheet.destroy();
this.positionValue = 'absolute'; luckysheet.create({
luckysheet.destroy(); container: "luckysheet", // Luckysheet 的容器元素 ID
luckysheet.create({ title: row.historyName, // Excel 文件名
container: "luckysheet", // Luckysheet 的容器元素 ID data: JSON.parse(row.historyContent), // Excel 数据
title: this.formContent.historyName, // Excel 文件名 showtoolbar: false, //是否第二列显示工具栏
data: JSON.parse(this.formContent.historyContent), // Excel 数据 showinfobar: true, //是否显示顶部名称栏
showtoolbar: false, //是否第二列显示工具栏 showsheetbar: false, //是否显示底部表格名称区域
showinfobar: true, //是否显示顶部名称栏 pointEdit: false, //是否是编辑器插入表格模式
showsheetbar: false, //是否显示底部表格名称区域 pointEditUpdate: null, //编辑器表格更新函数
pointEdit: false, //是否是编辑器插入表格模式 allowEdit: false,//作用:是否允许前台编辑
pointEditUpdate: null, //编辑器表格更新函数 functionButton: '<button id="exportButton" class="btn btn-primary" style=" padding:3px 6px; font-size: 16px;width: 100px;height: 27px; margin-right: 85px;" onclick="handleReturnButtonClick()">返回</button>',
allowEdit: false,//作用:是否允许前台编辑
functionButton: '<button id="exportButton" class="btn btn-primary" style=" padding:3px 6px; font-size: 16px;width: 100px;height: 27px; margin-right: 85px;" onclick="handleReturnButtonClick()">返回</button>',
});
}); });
}, },
/**详情返回按钮 */ /**详情返回按钮 */
handleReturnButtonClick() { handleReturnButtonClick() {
...@@ -301,7 +293,7 @@ export default { ...@@ -301,7 +293,7 @@ export default {
luckysheet.destroy(); luckysheet.destroy();
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
/* handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$confirm('是否确认删除 历史数据编号为"' + ids + '"的数据项?', "警告", { this.$confirm('是否确认删除 历史数据编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
...@@ -313,7 +305,7 @@ export default { ...@@ -313,7 +305,7 @@ export default {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}) })
},*/ },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -330,6 +330,7 @@ export default { ...@@ -330,6 +330,7 @@ export default {
name: "SuppliesTemplate", name: "SuppliesTemplate",
data() { data() {
return { return {
uploading:'',
selectedOption:'', selectedOption:'',
positionValue: 'static', positionValue: 'static',
fileList: [{ fileList: [{
...@@ -444,9 +445,9 @@ export default { ...@@ -444,9 +445,9 @@ export default {
/**上传事件 */ /**上传事件 */
async beforeUpload(file) { async beforeUpload(file) {
console.log(file)
//存在重复 //存在重复
findName(file.name).then(result => { findName(file.name).then(result => {
console.log(result.data)
if (result.data === "存在重复") { if (result.data === "存在重复") {
this.fileListName = []; this.fileListName = [];
...@@ -462,6 +463,7 @@ export default { ...@@ -462,6 +463,7 @@ export default {
} }
this.uploading = true; this.uploading = true;
await LuckyExcel.transformExcelToLucky(file, (exportJson, lucksheetfile) => { await LuckyExcel.transformExcelToLucky(file, (exportJson, lucksheetfile) => {
console.log(exportJson, lucksheetfile)
this.form.templateName = file.name; this.form.templateName = file.name;
this.form.templateContent = JSON.stringify(exportJson.sheets); this.form.templateContent = JSON.stringify(exportJson.sheets);
}); });
...@@ -555,7 +557,7 @@ export default { ...@@ -555,7 +557,7 @@ export default {
if (row.status===1) { if (row.status===1) {
this.title = "修改导入规则"; this.title = "修改导入规则";
this.selectedOption = ''; this.selectedOption = '';
this.forms = ''; this.forms = {};
this.instea = ''; this.instea = '';
const id = row.id || this.ids const id = row.id || this.ids
listSuppliesrole(id).then(response => { listSuppliesrole(id).then(response => {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -230,6 +230,7 @@ export default { ...@@ -230,6 +230,7 @@ export default {
data: exportJson.sheets, data: exportJson.sheets,
userInfo: exportJson.info.name.creator userInfo: exportJson.info.name.creator
}) })
console.log(exportJson.sheets,'2222222222222')
data1=exportJson.sheets[0]; data1=exportJson.sheets[0];
name1=exportJson.sheets[0].name; name1=exportJson.sheets[0].name;
let suffixArr = exportJson.info.name.split('.'); let suffixArr = exportJson.info.name.split('.');
......
<template>
<div class="container">
<div class="left-table">
<h2>左边表格</h2>
<input type="file" @change="uploadFile(1)" />
<table>
<thead>
<tr>
<th>序号</th>
<th>文件名</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr
v-for="(file, index) in leftTableData"
:class="{ dragged: index === draggedIndex }"
:key="index"
draggable
@dragstart="dragStart(index)"
@dragover="dragOver(index)"
@drop="drop(index)"
@dragend="dragEnd"
>
<td>{{ index + 1 }}</td>
<td>{{ file.name }}</td>
<td>
<button @click="moveUp(index)">上移</button>
<button @click="moveDown(index)">下移</button>
<button @click="duplicate(index)">复制</button>
<button @click="deleteItem(index)">删除</button>
</td>
</tr>
</tbody>
</table>
<div v-if="draggedIndex !== -1" class="drag-overlay"></div>
</div>
<div class="comparison">
<button @click="compareFiles">比较</button>
<h2>比较结果:</h2>
<ul>
<li v-for="(result, index) in comparedFiles" :key="index">
{{ result === "" ? "" : "" }}
</li>
</ul>
<div v-if="showAnimation" class="line"></div>
</div>
<div class="right-table">
<h2>右边表格</h2>
<input type="file" @change="uploadFile(2)" />
<table>
<thead>
<tr>
<th>序号</th>
<th>文件名</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr
v-for="(file, index) in rightTableData"
:key="index"
:class="{ dragged2: index === draggedIndex }"
draggable
@dragstart="dragStart2(index)"
@dragover="dragOver2(index)"
@drop="drop2(index)"
@dragend="dragEnd2"
>
<td>{{ index + 1 }}</td>
<td>{{ file.name }}</td>
<td>
<button @click="moveUp2(index)">上移</button>
<button @click="moveDown2(index)">下移</button>
<button @click="duplicate2(index)">复制</button>
<button @click="deleteItem2(index)">删除</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
<script>
export default {
name: "viewuploads",
data() {
return {
leftTableData: [],
rightTableData: [],
comparedFiles: [],
draggedIndex: null,
draggedIndex2: null,
showAnimation: false,
draggedIndex3: -1,
draggedIndex6: -1,
};
},
methods: {
dragStart(index) {
this.draggedIndex3 = index;
},
dragEnd() {
this.draggedIndex = -1;
},
dragStart2(index) {
this.draggedIndex6 = index;
},
dragEnd2() {
this.draggedIndex = -1;
},
compareFiles() {},
// 调用dragstart事件并触发
dragStart(index) {
this.draggedIndex = index;
},
// 调用dragOver事件并触发
dragOver(index) {
event.preventDefault();
},
// 调用drop事件并触发
drop(index) {
const draggedItem = this.leftTableData[this.draggedIndex];
if (index === this.draggedIndex) {
return;
}
this.leftTableData.splice(this.draggedIndex, 1);
this.leftTableData.splice(index, 0, draggedItem);
},
// 上移
moveUp(index) {
if (index > 0) {
const temp = this.leftTableData[index];
this.leftTableData.splice(index, 1);
this.leftTableData.splice(index - 1, 0, temp);
}
},
// 下移
moveDown(index) {
if (index < this.leftTableData.length - 1) {
const temp = this.leftTableData[index];
this.leftTableData.splice(index, 1);
this.leftTableData.splice(index + 1, 0, temp);
}
},
// 复制
duplicate(index) {
const item = Object.assign({}, this.leftTableData[index]);
this.leftTableData.splice(index + 1, 0, item);
},
// 删除
deleteItem(index) {
this.leftTableData.splice(index, 1);
},
// 调用dragstart事件并触发
dragStart2(index) {
this.draggedIndex2 = index;
},
// 调用dragOver事件并触发
dragOver2(index) {
event.preventDefault();
},
// 调用drop事件并触发
drop2(index) {
const draggedItem2 = this.rightTableData[this.draggedIndex2];
if (index === this.draggedIndex2) {
return;
}
this.rightTableData.splice(this.draggedIndex2, 1);
this.rightTableData.splice(index, 0, draggedItem2);
},
// 上移
moveUp2(index) {
if (index > 0) {
const temp = this.rightTableData[index];
this.rightTableData.splice(index, 1);
this.rightTableData.splice(index - 1, 0, temp);
}
},
// 下移
moveDown2(index) {
if (index < this.rightTableData.length - 1) {
const temp = this.rightTableData[index];
this.rightTableData.splice(index, 1);
this.rightTableData.splice(index + 1, 0, temp);
}
},
// 复制
duplicate2(index) {
const file = Object.assign({}, this.rightTableData[index]);
this.rightTableData.splice(index + 1, 0, file);
},
// 删除
deleteItem2(index) {
this.rightTableData.splice(index, 1);
},
uploadFile(table) {
const fileInput = event.target;
const files = fileInput.files;
const tableData = table === 1 ? this.leftTableData : this.rightTableData;
debugger
// 将上传的文件添加到对应的表格数据中
for (let i = 0; i < files.length; i++) {
tableData.push(files[i]);
}
// 按序号排序
tableData.sort((a, b) => a.name.localeCompare(b.name));
// 比较左右表格的文件名
if (this.leftTableData.length > 0 && this.rightTableData.length > 0) {
this.comparedFiles = this.compareFiles();
} else {
this.clearComparison();
}
},
compareFiles() {
this.showAnimation = true;
setTimeout(() => {
this.showAnimation = false;
}, 2800);
setTimeout(() => {
this.comparedFiles = [];
const minLength = Math.min(
this.leftTableData.length,
this.rightTableData.length
);
for (let i = 0; i < minLength; i++) {
const leftFileName = this.leftTableData[i].name;
const rightFileName = this.rightTableData[i].name;
if (leftFileName === rightFileName) {
this.comparedFiles.push("");
} else {
this.comparedFiles.push("");
}
}
}, 3000);
},
clearComparison() {
this.comparedFiles = [];
},
},
};
</script>
<style>
tr.dragged {
opacity: 0.5;
}
tr.dragged2 {
opacity: 0.5;
}
/* .drag-overlay
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 999;
pointer-events: none;
} */
.line {
width: 100%;
height: 1px;
background-color: red;
animation: lineAnimation 3s linear;
position: relative;
top: 15px;
}
@keyframes lineAnimation {
0% {
width: 0;
}
100% {
width: 100%;
}
}
.container {
display: flex;
justify-content: space-between;
margin: 100px;
}
.left-table,
.right-table {
width: 45%;
}
.comparison {
width: 20%;
position: relative;
margin-left: 100px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
th,
td {
border: 1px solid #ccc;
padding: 8px;
}
h2 {
font-size: 18px;
margin-bottom: 10px;
}
input[type="file"] {
margin-bottom: 10px;
}
ul {
list-style: none;
padding-left: 0;
}
li {
margin-bottom: 5px;
}
.comparison > ul {
margin-top: 85px;
position: relative;
}
.comparison > ul > li {
margin-top: 20px;
}
.animation {
width: 100px;
height: 100px;
background-color: red;
transition: opacity 0.3s ease-in-out;
}
.animation-enter-active,
.animation-leave-active {
opacity: 0;
}
tr.dragged {
opacity: 0.5;
}
tr.drag-over {
background-color: #e5e5e5;
}
</style>
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<el-form-item label="所属模板" prop="tempId"> <el-form-item label="所属模板" prop="tempId">
<el-select v-model="queryParams.tempId" filterable clearable placeholder="请选择上级分类"> <el-select v-model="queryParams.tempId" filterable clearable placeholder="请选择上级分类">
<el-option v-for="option in options" :key="option.templateName" :label="option.templateName" <el-option v-for="option in options" :key="option.templateName" :label="option.templateName"
:value="option.id"></el-option> :value="option.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="规则名称" prop="roleName"> <el-form-item label="规则名称" prop="roleName">
<el-input v-model="queryParams.roleName" placeholder="请输入规则名称" clearable size="small" <el-input v-model="queryParams.roleName" placeholder="请输入规则名称" clearable size="small"
@keyup.enter.native="handleQuery" /> @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态"> <el-select v-model="queryParams.status" placeholder="请选择状态">
...@@ -25,19 +25,19 @@ ...@@ -25,19 +25,19 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:suppliesrole:add']">新增</el-button> v-hasPermi="['system:suppliesrole:add']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['system:suppliesrole:remove']">删除</el-button> v-hasPermi="['system:suppliesrole:remove']">删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['system:suppliesrole:export']">导出</el-button> v-hasPermi="['system:suppliesrole:export']">导出</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="releaseStatus" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="releaseStatus"
v-hasPermi="['system:suppliesrole:releaseRS']">发布</el-button> v-hasPermi="['system:suppliesrole:releaseRS']">发布</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -66,31 +66,31 @@ ...@@ -66,31 +66,31 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" prop="status"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="releaseStatus(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="releaseStatus(scope.row)"
v-hasPermi="['system:suppliesrole:releaseRS']" v-hasPermi="['system:suppliesrole:releaseRS']"
:style="{ display: scope.row.status > 0 ? '' : 'none' }">发布 :style="{ display: scope.row.status > 0 ? '' : 'none' }">发布
</el-button> </el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="offShelfStatus(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="offShelfStatus(scope.row)"
v-hasPermi="['system:suppliesrole:offShelfRS']" v-hasPermi="['system:suppliesrole:offShelfRS']"
:style="{ display: scope.row.status === 0 ? '' : 'none' }">下架 :style="{ display: scope.row.status === 0 ? '' : 'none' }">下架
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:suppliesrole:edit']" v-hasPermi="['system:suppliesrole:edit']"
:style="{ display: scope.row.status === 1 ? '' : 'none' }">修改</el-button> :style="{ display: scope.row.status === 1 ? '' : 'none' }">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:suppliesrole:remove']">删除</el-button> v-hasPermi="['system:suppliesrole:remove']">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-detailUpdate" @click="detailUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-detailUpdate" @click="detailUpdate(scope.row)"
v-hasPermi="['system:suppliesrole:detailUpdate']" v-hasPermi="['system:suppliesrole:detailUpdate']"
:style="{ display: scope.row.status === 1 ? '' : 'none' }">修改规则详情</el-button> :style="{ display: scope.row.status === 1 ? '' : 'none' }">修改规则详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
<!-- 添加或修改导入规则对话框 --> <!-- 添加或修改导入规则对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
...@@ -98,15 +98,12 @@ ...@@ -98,15 +98,12 @@
<el-form-item label="所属模板" prop="tempId"> <el-form-item label="所属模板" prop="tempId">
<el-select v-model="form.tempId" filterable placeholder="请选择关联项" style="width:380px"> <el-select v-model="form.tempId" filterable placeholder="请选择关联项" style="width:380px">
<el-option v-for="option in options" :key="option.templateName" :label="option.templateName" <el-option v-for="option in options" :key="option.templateName" :label="option.templateName"
:value="option.id"></el-option> :value="option.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="规则名称" prop="roleName"> <el-form-item label="规则名称" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入规则名称" maxlength="36" /> <el-input v-model="form.roleName" placeholder="请输入规则名称" maxlength="36" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -116,28 +113,28 @@ ...@@ -116,28 +113,28 @@
</el-dialog> </el-dialog>
<!-- 添加或修改规则详情对话框 --> <!-- 添加或修改规则详情对话框 -->
<el-dialog :title="title" :visible.sync="optionDetail" width="1300px" append-to-body> <el-dialog @close="Dialog" :title="title" :visible.sync="optionDetail" width="1300px" append-to-body>
<el-form ref="forms" :model="forms" :rules="rules" label-width="80px"> <el-form ref="forms" :model="forms" :rules="rules" label-width="80px">
<el-form-item label="规则详情" prop="roleId"> <el-form-item label="规则详情" prop="roleId">
<el-select v-model="selectedOption" filterable placeholder="请选择关联项" <el-select v-model="selectedOption" filterable placeholder="请选择关联项"
@change="handleOptionChange(selectedOption)"> @change="handleOptionChange(selectedOption)">
<el-option v-for="option in options1" :key="option.detailName" :label="option.detailName" <el-option v-for="option in options1" :key="option.detailName" :label="option.detailName"
:value="option.id"></el-option> :value="option.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="规则名称" prop="detailName"> <el-form-item label="规则名称" prop="detailName">
<el-input v-model="forms.detailName" placeholder="请输入规则名称" maxlength="36" show-word-limit /> <el-input v-model="forms.detailName" placeholder="请输入规则名称" maxlength="36" show-word-limit />
</el-form-item> </el-form-item>
<el-form-item label="运算方法" prop="convertStatus"> <el-form-item label="运算方法" prop="convertStatus">
<el-select v-model="forms.convertStatus" filterable placeholder="请选择运算方法" @change="handleRadioChange"> <el-select v-model="forms.convertStatus" filterable placeholder="请选择运算方法" @change="handleRadioChange">
<el-option v-for="option in options2" :key="option.operationName" :label="option.operationName" <el-option v-for="option in options2" :key="option.operationName" :label="option.operationName"
:value="option.id"></el-option> :value="option.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="转换类型" prop="detailYS"> <el-form-item label="转换类型" prop="detailYS">
<el-radio-group v-model="forms.detailYS"> <el-radio-group v-model="forms.detailYS" @change="radiovalue">
<el-radio label="1">单元格转换</el-radio> <el-radio label="1">单元格转换</el-radio>
<el-radio label="2">行转换</el-radio> <el-radio label="2">行转换</el-radio>
<el-radio label="3">列转换</el-radio> <el-radio label="3">列转换</el-radio>
...@@ -145,23 +142,34 @@ ...@@ -145,23 +142,34 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="16">
<el-form-item v-if="forms.detailYS !== null"> <el-form-item v-if="optionid">
<el-button type="primary" <el-button type="primary" :disabled="isDisable || isDelete" @click="addInputs">添加规则</el-button>
:disabled="isDisable" @click="addInputs">添加规则</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- 生成输入框 --> <!-- 生成输入框 -->
<div v-for="index in instea" :key="index"> <div v-for="index in instea" :key="index">
<span v-if="isTitle && index == 1" style="color:red;"> <b> 物料编码 </b> </span>
<span v-if="isTitle && index == 2" style="color:red;"> <b> 部门名称 </b> </span>
<span v-if="isTitle && index == 3" style="color:red;"> <b> 计量单位 </b> </span>
<span v-if="isTitle && index == 4" style="color:red;"> <b> 费用来源 </b> </span>
<span v-if="isTittle && index == 1" style="color:red;"> <b> 数量 </b> </span>
<span v-if="isTittle && index == 2" style="color:red;"> <b> 金额 </b> </span>
<span v-if="isTittle && index == 1"
style="position: absolute; left:632px;top:342px; z-index: 2;color: red;"> <b> 数量 </b> </span>
<span v-if="isTittle && index == 2"
style="position: absolute; left:632px;top:444px; z-index: 2;color: red;"> <b> 单价 </b> </span>
<el-form-item label="表头所在行" prop="cleanIng" class="form-item-inline" v-if="optionid === 6"> <el-form-item label="表头所在行" prop="cleanIng" class="form-item-inline" v-if="optionid === 6">
<el-input-number size="medium" v-model="cleanIng.HeaderRow" :min="1" :step="1">1</el-input-number> <el-input-number size="medium" v-model="cleanIng.HeaderRow" :min="1" :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="模板表行坐标" prop="detailMH" class="form-item-inline" v-else> <el-form-item label="模板表行坐标" prop="detailMH" class="form-item-inline" v-else>
<el-input-number size="medium" v-model="detailMH[index - 1]" :min="1" :step="1">1</el-input-number> <el-input-number size="medium" v-model="detailMH[index - 1]" :min="1" :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="物料名称所在列" prop="cleanIng" class="form-item-inline" v-if="optionid === 6"> <el-form-item label="物料名称所在列" prop="cleanIng" class="form-item-inline" v-if="optionid === 6">
<el-input-number size="medium" v-model="cleanIng.NameColumn" :min="1" :step="1">1</el-input-number> <el-input-number size="medium" v-model="cleanIng.NameColumn" :min="1" :step="1">1</el-input-number>
</el-form-item> </el-form-item>
...@@ -180,7 +188,7 @@ ...@@ -180,7 +188,7 @@
<el-form-item label="部门所在列" prop="cleanIng" class="form-item-inline" v-if="optionid === 6"> <el-form-item label="部门所在列" prop="cleanIng" class="form-item-inline" v-if="optionid === 6">
<el-input-number size="medium" v-model="cleanIng.DepartmentColumn" :min="1" <el-input-number size="medium" v-model="cleanIng.DepartmentColumn" :min="1"
:step="1">1</el-input-number> :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="导入表列坐标" prop="detailYL" class="form-item-inline" v-else> <el-form-item label="导入表列坐标" prop="detailYL" class="form-item-inline" v-else>
...@@ -190,23 +198,66 @@ ...@@ -190,23 +198,66 @@
<el-form-item label="数量所在列" prop="cleanIng" class="form-item-inline" v-if="optionid === 6"> <el-form-item label="数量所在列" prop="cleanIng" class="form-item-inline" v-if="optionid === 6">
<el-input-number size="medium" v-model="cleanIng.NumberColumn" :min="1" <el-input-number size="medium" v-model="cleanIng.NumberColumn" :min="1"
:step="1">1</el-input-number> :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="金额所在列" prop="cleanIng" class="form-item-inline" v-if="optionid === 6"> <el-form-item label="金额所在列" prop="cleanIng" class="form-item-inline" v-if="optionid === 6">
<el-input-number size="medium" v-model="cleanIng.MoneyColumn" :min="1" :step="1">1</el-input-number> <el-input-number size="medium" v-model="cleanIng.MoneyColumn" :min="1" :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="计量单位所在列" prop="cleanIng" class="form-item-inline" v-if="optionid === 6">
<el-input-number size="medium" v-model="cleanIng.unit" :min="1" :step="1">1</el-input-number>
</el-form-item>
<br>
<el-form-item label="是否需要转换" prop="cleanIng" class="form-item-inline" v-if="optionid === 6">
<el-select v-model="cleanIng.conversion" placeholder="请选择" @change="ConversionChange">
<el-option v-for="item in conversion" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-form-item label="费用渠道所在列" prop="cleanIng" class="form-item-inline" v-if="ConversionValue === 0">
<el-input-number size="medium" v-model="cleanIng.expenses" :min="1"
:step="1">1</el-input-number>
</el-form-item>
<el-form-item label="费用备用所在列" prop="cleanIng" class="form-item-inline" v-if="ConversionValue === 1">
<el-input-number size="medium" v-model="cleanIng.spare" :min="1" :step="1">1</el-input-number>
</el-form-item>
</el-form-item>
<el-form-item label="日期所在列" prop="cleanIng" class="form-item-inline" v-if="optionid === 6"> <el-form-item label="日期所在列" prop="cleanIng" class="form-item-inline" v-if="optionid === 6">
<el-input-number size="medium" v-model="cleanIng.DateColumn" :min="1" :step="1">1</el-input-number>
<el-select v-model="datevalue" placeholder="请选择日期所在列" @change="dateChange" label="日期所在列">
<el-option v-for="item in date" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-input-number style="margin-left: 5vw;" v-if="datevalue == 1" size="medium"
v-model="cleanIng.DateColumn" :min="1" :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item style="display: inline-block;"> <el-form-item style="display: inline-block;" v-if="!isDelete">
<el-button type="danger" icon="el-icon-delete" size="small" <el-button type="danger" icon="el-icon-delete" size="small"
@click="removeInputs(index)">删除</el-button> @click="removeInputs(index)">删除</el-button>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item style="display: inline-block;" v-if="isDelete">
<el-button type="danger" icon="el-icon-delete" size="small" @click="removeInputs">删除</el-button>
</el-form-item>
<div v-if="optionid !== 6 && instea >= 1" style="color: red; margin-left: 2.5vw;">
为防止后面步骤出错,导入表和模板表的行列坐标必须为表头所在单元格的行列</div>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm2">确 定</el-button> <el-button type="primary" @click="submitForm2">确 定</el-button>
...@@ -236,12 +287,33 @@ export default { ...@@ -236,12 +287,33 @@ export default {
}, },
data() { data() {
return { return {
date: [{
value: 0,
label: ''
}, {
value: 1,
label: ''
}],
datevalue: 0,
conversion: [{
value: 0,
label: '不需要'
}, {
value: 1,
label: '需要'
}],
ConversionValue: '',
selectedOption: '', selectedOption: '',
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
ids: [], ids: [],
name: [], name: [],
radiitemValue: {
radio: '0',
conver: '0'
},
tempIds: [], tempIds: [],
// 非单个禁用 // 非单个禁用
single: true, single: true,
...@@ -257,7 +329,7 @@ export default { ...@@ -257,7 +329,7 @@ export default {
options: [], options: [],
options1: [], options1: [],
options2: [{ id: 0, operationName: "" }, { id: 1, operationName: "物料转换" }, { id: 2, operationName: "加法运算" }, { id: 3, operationName: "减法运算" }, { id: 4, operationName: "乘法运算" }, { id: 5, operationName: "除法运算" }, options2: [{ id: 0, operationName: "" }, { id: 1, operationName: "物料转换" }, { id: 2, operationName: "加法运算" }, { id: 3, operationName: "减法运算" }, { id: 4, operationName: "乘法运算" }, { id: 5, operationName: "除法运算" },
{ id: 6, operationName: '清洗规则' }],//上级ID { id: 6, operationName: '清洗规则' }],//上级ID
// 弹出层标题 // 弹出层标题
...@@ -275,7 +347,7 @@ export default { ...@@ -275,7 +347,7 @@ export default {
}, },
// 表单参数 // 表单参数
form: {}, form: {},
optionid:'', optionid: '',
forms: {}, forms: {},
formdeta: {}, formdeta: {},
formtemp: {}, formtemp: {},
...@@ -283,7 +355,19 @@ export default { ...@@ -283,7 +355,19 @@ export default {
detailML: [], detailML: [],
detailYH: [], detailYH: [],
detailYL: [], detailYL: [],
cleanIng:{}, cleanIng: {
HeaderRow: '',
NameColumn: '',
CodeColumn: '',
DepartmentColumn: '',
NumberColumn: '',
MoneyColumn: '',
DateColumn: '',
unit: '',
expenses: '',
conversion: '',
spare: ''
},
instea: 0, instea: 0,
// 表单校验 // 表单校验
rules: { rules: {
...@@ -297,8 +381,17 @@ export default { ...@@ -297,8 +381,17 @@ export default {
}; };
}, },
computed: { computed: {
isDisable(){ isDisable() {
return this.instea===1&&this.optionid===6 return (this.instea >= 1 && this.optionid == 6) || (this.radiitemValue.radio == 2 && this.radiitemValue.conver == 3 && this.instea >= 4)
},
isDelete() {
return (this.radiitemValue.radio == 3 && this.radiitemValue.conver == 1 && this.instea >= 4) || (this.radiitemValue.radio == 3 && this.radiitemValue.conver == 2 && this.instea >= 2)
},
isTitle() {
return this.radiitemValue.radio == 3 && this.radiitemValue.conver == 1
},
isTittle() {
return this.radiitemValue.radio == 3 && this.radiitemValue.conver == 2
} }
}, },
created() { created() {
...@@ -306,7 +399,44 @@ export default { ...@@ -306,7 +399,44 @@ export default {
this.getnameid(); this.getnameid();
}, },
methods: { methods: {
handleRadioChange() { empty() {
this.optionid = ''
this.datevalue = 0
this.radiitemValue.radio = 0
this.radiitemValue.conver = 0
this.detailMH = []
this.detailML = []
this.detailYH = []
this.detailYL = []
},
Dialog() {
this.empty()
},
radiovalue(value) {
this.radiitemValue.radio = Number(value)
this.detailMH = []
this.detailML = []
this.detailYH = []
this.detailYL = []
this.instea = 0
},
ConversionChange(value) {
this.ConversionValue = value
if (value === 0) {
this.cleanIng.spare = ''
} else {
this.cleanIng.expenses = ''
}
},
dateChange() {
this.cleanIng.DateColumn = ''
},
handleRadioChange(value) {
this.radiitemValue.conver = value
this.optionid = this.forms.convertStatus this.optionid = this.forms.convertStatus
this.detailMH = [] this.detailMH = []
this.detailML = [] this.detailML = []
...@@ -320,30 +450,74 @@ export default { ...@@ -320,30 +450,74 @@ export default {
DepartmentColumn: '', DepartmentColumn: '',
NumberColumn: '', NumberColumn: '',
MoneyColumn: '', MoneyColumn: '',
DateColumn: '' DateColumn: '',
unit: '',
expenses: '',
conversion: '',
spare: ''
} }
}, },
removeInputs(index) { removeInputs(index) {
if (this.isDelete) {
this.instea = 0
this.detailMH = []
this.detailML = []
this.detailYH = []
this.detailYL = []
} else {
this.detailMH.splice(index - 1, 1); this.detailMH.splice(index - 1, 1);
this.detailML.splice(index - 1, 1); this.detailML.splice(index - 1, 1);
this.detailYH.splice(index - 1, 1); this.detailYH.splice(index - 1, 1);
this.detailYL.splice(index - 1, 1); this.detailYL.splice(index - 1, 1);
this.instea = this.instea - 1; this.instea = this.instea - 1;
}
}, },
addInputs() { addInputs() {
if ((this.radiitemValue.radio == 3 && this.radiitemValue.conver == 1) || (this.radiitemValue.radio == 3 && this.radiitemValue.conver == 2)) {
if (this.radiitemValue.radio == 3 && this.radiitemValue.conver == 1) {
let i = 4 - this.instea
this.instea += i
this.instea += 1; if (this.detailMH && this.detailML && this.detailYH && this.detailYL) {
this.detailMH[this.instea - 1] = 1; [this.detailMH, this.detailML, this.detailYH, this.detailYL].forEach(arr => {
this.detailML[this.instea - 1] = 1; while (arr.length < 4) arr.push(1);
this.detailYH[this.instea - 1] = 1; });
this.detailYL[this.instea - 1] = 1; }
}
if (this.radiitemValue.radio == 3 && this.radiitemValue.conver == 2) {
let i = 2 - this.instea
this.instea += i
if (this.detailMH && this.detailML && this.detailYH && this.detailYL) {
[this.detailMH, this.detailML, this.detailYH, this.detailYL].forEach(arr => {
while (arr.length < 2) arr.push(1);
});
}
}
} else {
this.instea += 1;
this.detailMH.push(1)
this.detailML.push(1)
this.detailYH.push(1)
this.detailYL.push(1)
}
}, },
/**启用 */ /**启用 */
toggleEnable(suppliesRole) { toggleEnable(suppliesRole) {
console.log('你点击了【' + suppliesRole.s + '】的开关控件,当前开关值:' + suppliesRole.status); console.log('你点击了【' + suppliesRole.s + '】的开关控件,当前开关值:' + suppliesRole.status);
...@@ -403,6 +577,7 @@ export default { ...@@ -403,6 +577,7 @@ export default {
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.optionid = ''
this.open = false; this.open = false;
this.optionDetail = false; this.optionDetail = false;
this.reset(); this.reset();
...@@ -452,6 +627,7 @@ export default { ...@@ -452,6 +627,7 @@ export default {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids
getSuppliesrole(id).then(response => { getSuppliesrole(id).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改导入规则"; this.title = "修改导入规则";
...@@ -482,12 +658,21 @@ export default { ...@@ -482,12 +658,21 @@ export default {
handleOptionChange(selectedOption) { handleOptionChange(selectedOption) {
getSuppliesroledetail(selectedOption).then(response => { getSuppliesroledetail(selectedOption).then(response => {
this.forms = response.data; this.forms = response.data;
this.radiitemValue.conver = this.forms.convertStatus
this.radiitemValue.radio = this.forms.detailYS
const detailContent = response.data.detailContent; const detailContent = response.data.detailContent;
const parse = JSON.parse(detailContent); const parse = JSON.parse(detailContent);
this.optionid=response.data.convertStatus this.optionid = response.data.convertStatus
if (response.data.convertStatus===6) { this.instea = parse.length
this.instea =parse.length if (response.data.convertStatus === 6) {
this.cleanIng=parse[0] this.cleanIng = parse[0]
if (this.cleanIng.DateColumn !== '') {
this.datevalue = 1
} else {
this.datevalue = 0
}
} else { } else {
this.detailMH = parse.map(obj => parseInt(obj.rt) + 1); this.detailMH = parse.map(obj => parseInt(obj.rt) + 1);
this.detailML = parse.map(obj => parseInt(obj.ct) + 1); this.detailML = parse.map(obj => parseInt(obj.ct) + 1);
...@@ -526,7 +711,7 @@ export default { ...@@ -526,7 +711,7 @@ export default {
submitForm2() { submitForm2() {
this.form.cleanIng=JSON.stringify(this.cleanIng); this.forms.cleanIng = JSON.stringify(this.cleanIng);
this.forms.detailMH = this.detailMH; this.forms.detailMH = this.detailMH;
this.forms.detailML = this.detailML; this.forms.detailML = this.detailML;
this.forms.detailYH = this.detailYH; this.forms.detailYH = this.detailYH;
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="上级规则" prop="roleId">
<el-select v-model="queryParams.roleId" filterable clearable placeholder="请选择关联项">
<el-option v-for="option in options1" :key="option.roleName" :label="option.roleName"
:value="option.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="规则名称" prop="detailName">
<el-input v-model="queryParams.detailName" placeholder="请输入规则名称" clearable size="small"
@keyup.enter.native="handleQuery" maxlength="15" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态">
<el-option label="启用" :value="0"></el-option>
<el-option label="禁用" :value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="运算规则" prop="convertStatus">
<el-select v-model="queryParams.convertStatus" clearable filterable placeholder="请运算规则">
<el-option v-for="option in options2" :key="option.operationName" :label="option.operationName"
:value="option.id"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:suppliesroledetail:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['system:suppliesroledetail:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['system:suppliesroledetail:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="suppliesroledetailList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" width="80" align="center" label="序号" :index="indexMethod" />
<el-table-column label="上级规则" align="center" prop="roleName" />
<el-table-column label="规则名称" align="center" prop="detailName" />
<el-table-column label="规则内容" align="center" prop="detailContent" />
<el-table-column label="运算规则" align="center">
<template slot-scope="scope">
<div>
<template v-if="scope.row.convertStatus === 0">
</template>
<template v-if="scope.row.convertStatus === 1">
物料转换
</template>
<template v-if="scope.row.convertStatus === 2">
加法运算
</template>
<template v-if="scope.row.convertStatus === 3">
减法运算
</template>
<template v-if="scope.row.convertStatus === 4">
乘法运算
</template>
<template v-if="scope.row.convertStatus === 5">
除法运算
</template>
<template v-if="scope.row.convertStatus === 6">
清洗规则
</template>
</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div>
<template v-if="scope.row.status === 0">
<span style="color: #0cc030;">已发布</span>
</template>
<template v-else-if="scope.row.status === 1">
<span style="color: #0077ff;">未发布</span>
</template>
<template v-else-if="scope.row.status === 2">
<span style="color: #ff0000;">未发布</span>
</template>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:suppliesroledetail:edit']"
:style="{ display: scope.row.status === 1 ? '' : 'none' }">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:suppliesroledetail:remove']"
:style="{ display: scope.row.status === 1 ? '' : 'none' }">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 添加或修改规则详情对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1300px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="上级规则" prop="roleId">
<el-select v-model="form.roleId" filterable placeholder="请选择关联项">
<el-option v-for="option in options3" :key="option.roleName" :label="option.roleName"
:value="option.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="规则名称" prop="detailName">
<el-input v-model="form.detailName" placeholder="请输入规则名称" maxlength="36" show-word-limit />
</el-form-item>
<el-form-item label="运算方法" prop="convertStatus">
<el-select v-model="form.convertStatus" filterable placeholder="请选择运算方法" @change="handleRadioChange">
<el-option v-for="option in options2" :key="option.operationName" :label="option.operationName"
:value="option.id"></el-option>
</el-select>
</el-form-item>
<el-row>
<el-col :span="8">
<el-form-item label="转换类型" prop="detailYS">
<el-radio-group v-model="form.detailYS">
<el-radio label="1">单元格转换</el-radio>
<el-radio label="2">行转换</el-radio>
<el-radio label="3">列转换</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item v-if="form.detailYS !== null">
<el-button type="primary" :disabled="isDisable" @click="addInputs">添加规则</el-button>
</el-form-item>
</el-col>
</el-row>
<div v-for="index in instea" :key='index'>
<el-form-item label="表头所在行" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-input-number size="medium" v-model="CleanIng.HeaderRow" :min="1" :step="1">1</el-input-number>
</el-form-item>
<el-form-item label="模板表行坐标" prop="detailMH" class="form-item-inline" v-else>
<el-input-number size="medium" v-model="detailMH[index - 1]" :min="1" :step="1">1</el-input-number>
</el-form-item>
<el-form-item label="物料名称所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-input-number size="medium" v-model="CleanIng.NameColumn" :min="1" :step="1">1</el-input-number>
</el-form-item>
<el-form-item label="模板表列坐标" prop="detailML" class="form-item-inline" v-else>
<el-input-number size="medium" v-model="detailML[index - 1]" :min="1" :step="1">1</el-input-number>
</el-form-item>
<el-form-item label="物料编码所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-input-number size="medium" v-model="CleanIng.CodeColumn" :min="1" :step="1">1</el-input-number>
</el-form-item>
<el-form-item label="导入表行坐标" prop="detailYH" class="form-item-inline" v-else>
<el-input-number size="medium" v-model="detailYH[index - 1]" :min="1" :step="1">1</el-input-number>
</el-form-item>
<el-form-item label="部门所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-input-number size="medium" v-model="CleanIng.DepartmentColumn" :min="1"
:step="1">1</el-input-number>
</el-form-item>
<el-form-item label="导入表列坐标" prop="detailYL" class="form-item-inline" v-else>
<el-input-number size="medium" v-model="detailYL[index - 1]" :min="1" :step="1">1</el-input-number>
</el-form-item>
<el-form-item label="数量所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-input-number size="medium" v-model="CleanIng.NumberColumn" :min="1"
:step="1">1</el-input-number>
</el-form-item>
<el-form-item label="金额所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-input-number size="medium" v-model="CleanIng.MoneyColumn" :min="1" :step="1">1</el-input-number>
</el-form-item>
<el-form-item label="日期所在列" prop="CleanIng" class="form-item-inline"
v-if="options2id === 6 ">
<el-select v-model="datevalue" placeholder="请选择日期所在列" @change="dateChange"
label="日期所在列">
<el-option v-for="item in date" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-input-number style="margin-left: 5vw;" v-if="datevalue == 1" size="medium" v-model="CleanIng.DateColumn" :min="1" :step="1">1</el-input-number>
</el-form-item>
<el-form-item style="display: inline-block;">
<el-button type="danger" icon="el-icon-delete" size="small"
@click="removeInputs(index)">删除</el-button>
</el-form-item>
</div>
<div v-if="options2id !== 6 && instea >= 1" style="color: red; margin-left: 2.5vw;">
为防止后面步骤出错,导入表和模板表的行列坐标必须为表头所在单元格的行列</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<style>
.form-item-inline {
display: inline-block;
margin-right: 20px;
}
</style>
<script>
import {
listSuppliesroledetail,
getSuppliesroledetail,
delSuppliesroledetail,
addSuppliesroledetail,
updateSuppliesroledetail,
exportSuppliesroledetail,
saveSid,
toggleEnable,
toggleDisable,
saveOperation,
saveSidsta,
} from "@/api/system/suppliesroledetail";
import Editor from '@/components/Editor';
export default {
name: "Suppliesroledetail",
components: {
Editor,
},
data() {
return {
date: [{
value: 0,
label: ''
}, {
value: 1,
label: ''
}],
datevalue: 0,
// 遮罩层
loading: true,
//下拉选中的数值
options2id: '',
// 选中数组
ids: [],
name: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 规则详情表格数据
suppliesroledetailList: [],
options1: [],//上级ID
options3: [],
options2: [{ id: 0, operationName: "" }, { id: 1, operationName: "物料转换" }, { id: 2, operationName: "加法运算" }, { id: 3, operationName: "减法运算" }, { id: 4, operationName: "乘法运算" }, { id: 5, operationName: "除法运算" }, { id: 6, operationName: '清洗规则' }],//上级ID
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
inputCount: 0,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
roleId: null,
detailName: null,
detailContent: null,
status: null,
converStatus: null,
},
// 表单参数
form: {
},
CleanIng: {
HeaderRow: '',
NameColumn: '',
CodeColumn: '',
DepartmentColumn: '',
NumberColumn: '',
MoneyColumn: '',
DateColumn: ''
},
detailMH: [],
detailML: [],
detailYH: [],
detailYL: [],
instea: 0,
showTemplate: false, // 控制单元格的显示与隐藏
showImport: false, // 控制行转换的显示与隐藏
showLie: false, // 控制列转换的显示与隐藏
// 表单校验
rules: {
roleId: [
{ required: true, message: '关联id不能为空', trigger: 'change' },
],
convertStatus: [
{ required: true, message: '运算规则不能为空', trigger: 'change' },
],
detailName: [
{ required: true, message: '规则名称不能为空', trigger: 'change' },
]
}
};
},
watch: {
options2id(newValue) {
if (newValue >= 0 && this.detailMH.length >= 1) {
this.instea = 1
}
}
},
computed: {
isDisable() {
return this.instea >= 1 && this.options2id == 6;
},
},
created() {
this.getList();
this.getnameid();
},
methods: {
dateChange() {
this.CleanIng.DateColumn = ''
},
handleRadioChange() {
this.options2id = this.form.convertStatus
this.detailMH = []
this.detailML = []
this.detailYH = []
this.detailYL = []
this.instea = 0
this.CleanIng = {
HeaderRow: '',
NameColumn: '',
CodeColumn: '',
DepartmentColumn: '',
NumberColumn: '',
MoneyColumn: '',
DateColumn: ''
}
},
removeInputs(index) {
this.detailMH.splice(index - 1, 1);
this.detailML.splice(index - 1, 1);
this.detailYH.splice(index - 1, 1);
this.detailYL.splice(index - 1, 1);
this.instea = this.instea - 1;
},
addInputs() {
this.instea += 1;
this.detailMH.push(1)
this.detailML.push(1)
this.detailYH.push(1)
this.detailYL.push(1)
},
toggleEnable(suppliesRoleDetail) {
console.log('你点击了【' + suppliesRoleDetail.s + '】的开关控件,当前开关值:' + suppliesRoleDetail.status);
let enableText = ['启用', '禁用'];
if (suppliesRoleDetail.status === 0) {
toggleEnable(suppliesRoleDetail.id).then((response) => {
if (response.code === 200) {
let message = '操作成功,已经将【' + suppliesRoleDetail.roleName + '】的状态改为【' + enableText[suppliesRoleDetail.status] + '】 !';
this.$message({ message: message, type: 'success' });
} else {
this.$message.error(response.message);
}
});
} else {
toggleDisable(suppliesRoleDetail.id).then((response) => {
if (response.code === 200) {
let message = '操作成功,已经将【' + suppliesRoleDetail.roleName + '】的状态改为【' + enableText[suppliesRoleDetail.status] + '】 !';
this.$message({ message: message, type: 'error' });
} else {
this.$message.error(response.message);
}
});
}
},
/**显示序号*/
indexMethod(index) {
return index + 1;
},
/**获取关联表内容*/
getnameid() {
//上级规则
saveSid().then(response => {
this.options1 = response.rows;
})
},
/** 查询规则详情列表 */
getList() {
this.indexMethod(0);
this.loading = true;
listSuppliesroledetail(this.queryParams).then(response => {
this.suppliesroledetailList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
roleId: null,
detailName: null,
detailYS: null,
detailContent: null,
status: 0,
convertStatus: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
cleanIng: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.name = selection.map(item => item.detailName)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
//上级规则
saveSidsta().then(response => {
this.options3 = response.rows;
})
this.instea = 0;
this.getnameid();
this.reset();
this.open = true;
this.title = "添加规则详情";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.getnameid();
const ids = this.options1.map(option => option.id);
if (ids.findIndex(item => item === row.roleId) !== -1) {
this.reset();
const id = row.id || this.ids
getSuppliesroledetail(id).then(response => {
this.form = response.data;
this.options2id = response.data.convertStatus
const detailContent = response.data.detailContent;
const parse = JSON.parse(detailContent);
console.log(response.data)
if (this.options2id === 6) {
this.instea = 1
this.CleanIng = parse[0]
if (this.CleanIng.DateColumn !== '') {
this.datevalue = 1
} else {
this.datevalue = 0
}
} else {
this.detailMH = parse.map(obj => parseInt(obj.rt) + 1);
this.detailML = parse.map(obj => parseInt(obj.ct) + 1);
this.detailYH = parse.map(obj => parseInt(obj.re) + 1);
this.detailYL = parse.map(obj => parseInt(obj.ce) + 1);
this.instea = this.detailMH.length;
}
this.open = true;
this.title = "修改规则详情";
});
} else {
this.msgError("上级规则已发布,无法修改")
}
},
/** 提交按钮 */
submitForm() {
this.form.cleanIng = JSON.stringify(this.CleanIng);
this.form.detailMH = this.detailMH;
this.form.detailML = this.detailML;
this.form.detailYH = this.detailYH;
this.form.detailYL = this.detailYL;
this.form.status = 1;
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
console.log(JSON.parse(this.form.cleanIng),'2222222222')
updateSuppliesroledetail(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSuppliesroledetail(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
const name = row.detailName || this.name;
this.$confirm('是否确认删除规则详情编号为"' + name + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delSuppliesroledetail(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有规则详情数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportSuppliesroledetail(queryParams);
}).then(response => {
this.download(response.msg);
})
}
}
};
</script>
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<el-form-item label="上级规则" prop="roleId"> <el-form-item label="上级规则" prop="roleId">
<el-select v-model="queryParams.roleId" filterable clearable placeholder="请选择关联项"> <el-select v-model="queryParams.roleId" filterable clearable placeholder="请选择关联项">
<el-option v-for="option in options1" :key="option.roleName" :label="option.roleName" <el-option v-for="option in options1" :key="option.roleName" :label="option.roleName"
:value="option.id"></el-option> :value="option.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="规则名称" prop="detailName"> <el-form-item label="规则名称" prop="detailName">
<el-input v-model="queryParams.detailName" placeholder="请输入规则名称" clearable size="small" <el-input v-model="queryParams.detailName" placeholder="请输入规则名称" clearable size="small"
@keyup.enter.native="handleQuery" maxlength="15" /> @keyup.enter.native="handleQuery" maxlength="15" />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态"> <el-select v-model="queryParams.status" placeholder="请选择状态">
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<el-form-item label="运算规则" prop="convertStatus"> <el-form-item label="运算规则" prop="convertStatus">
<el-select v-model="queryParams.convertStatus" clearable filterable placeholder="请运算规则"> <el-select v-model="queryParams.convertStatus" clearable filterable placeholder="请运算规则">
<el-option v-for="option in options2" :key="option.operationName" :label="option.operationName" <el-option v-for="option in options2" :key="option.operationName" :label="option.operationName"
:value="option.id"></el-option> :value="option.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -31,15 +31,15 @@ ...@@ -31,15 +31,15 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:suppliesroledetail:add']">新增</el-button> v-hasPermi="['system:suppliesroledetail:add']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['system:suppliesroledetail:remove']">删除</el-button> v-hasPermi="['system:suppliesroledetail:remove']">删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['system:suppliesroledetail:export']">导出</el-button> v-hasPermi="['system:suppliesroledetail:export']">导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -94,23 +94,23 @@ ...@@ -94,23 +94,23 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:suppliesroledetail:edit']" v-hasPermi="['system:suppliesroledetail:edit']"
:style="{ display: scope.row.status === 1 ? '' : 'none' }">修改</el-button> :style="{ display: scope.row.status === 1 ? '' : 'none' }">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:suppliesroledetail:remove']" v-hasPermi="['system:suppliesroledetail:remove']"
:style="{ display: scope.row.status === 1 ? '' : 'none' }">删除</el-button> :style="{ display: scope.row.status === 1 ? '' : 'none' }">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
<!-- 添加或修改规则详情对话框 --> <!-- 添加或修改规则详情对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1300px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1300px" append-to-body @close="Dialog">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="上级规则" prop="roleId"> <el-form-item label="上级规则" prop="roleId">
<el-select v-model="form.roleId" filterable placeholder="请选择关联项"> <el-select v-model="form.roleId" filterable placeholder="请选择关联项">
<el-option v-for="option in options3" :key="option.roleName" :label="option.roleName" <el-option v-for="option in options3" :key="option.roleName" :label="option.roleName"
:value="option.id"></el-option> :value="option.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="规则名称" prop="detailName"> <el-form-item label="规则名称" prop="detailName">
...@@ -119,13 +119,13 @@ ...@@ -119,13 +119,13 @@
<el-form-item label="运算方法" prop="convertStatus"> <el-form-item label="运算方法" prop="convertStatus">
<el-select v-model="form.convertStatus" filterable placeholder="请选择运算方法" @change="handleRadioChange"> <el-select v-model="form.convertStatus" filterable placeholder="请选择运算方法" @change="handleRadioChange">
<el-option v-for="option in options2" :key="option.operationName" :label="option.operationName" <el-option v-for="option in options2" :key="option.operationName" :label="option.operationName"
:value="option.id"></el-option> :value="option.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="转换类型" prop="detailYS"> <el-form-item label="转换类型" prop="detailYS">
<el-radio-group v-model="form.detailYS"> <el-radio-group v-model="form.detailYS" @change="radiovalue">
<el-radio label="1">单元格转换</el-radio> <el-radio label="1">单元格转换</el-radio>
<el-radio label="2">行转换</el-radio> <el-radio label="2">行转换</el-radio>
<el-radio label="3">列转换</el-radio> <el-radio label="3">列转换</el-radio>
...@@ -134,11 +134,22 @@ ...@@ -134,11 +134,22 @@
</el-col> </el-col>
<el-col :span="16"> <el-col :span="16">
<el-form-item v-if="form.detailYS !== null"> <el-form-item v-if="form.detailYS !== null">
<el-button type="primary" :disabled="isDisable" @click="addInputs">添加规则</el-button> <el-button type="primary" :disabled="isDisable || isDelete" @click="addInputs">添加规则</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<div v-for="index in instea" :key='index'> <div v-for="index in instea" :key='index'>
<span v-if="isTitle && index == 1" style="color:red;"> <b> 物料编码 </b> </span>
<span v-if="isTitle && index == 2" style="color:red;"> <b> 部门名称 </b> </span>
<span v-if="isTitle && index == 3" style="color:red;"> <b> 计量单位 </b> </span>
<span v-if="isTitle && index == 4" style="color:red;"> <b> 费用来源 </b> </span>
<span v-if="isTittle && index == 1" style="color:red;"> <b> 数量 </b> </span>
<span v-if="isTittle && index == 2" style="color:red;"> <b> 金额 </b> </span>
<span v-if="isTittle && index == 1"
style="position: absolute; left:632px;top:342px; z-index: 2;color: red;"> <b> 数量 </b> </span>
<span v-if="isTittle && index == 2"
style="position: absolute; left:632px;top:444px; z-index: 2;color: red;"> <b> 单价 </b> </span>
<el-form-item label="表头所在行" prop="CleanIng" class="form-item-inline" v-if="options2id === 6"> <el-form-item label="表头所在行" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-input-number size="medium" v-model="CleanIng.HeaderRow" :min="1" :step="1">1</el-input-number> <el-input-number size="medium" v-model="CleanIng.HeaderRow" :min="1" :step="1">1</el-input-number>
</el-form-item> </el-form-item>
...@@ -154,43 +165,46 @@ ...@@ -154,43 +165,46 @@
<el-form-item label="物料编码所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6"> <el-form-item label="物料编码所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-input-number size="medium" v-model="CleanIng.CodeColumn" :min="1" :step="1">1</el-input-number> <el-input-number size="medium" v-model="CleanIng.CodeColumn" :min="1" :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="导入表行坐标" prop="detailYH" class="form-item-inline" v-else> <el-form-item label="导入表行坐标" prop="detailYH" class="form-item-inline" v-else>
<el-input-number size="medium" v-model="detailYH[index - 1]" :min="1" :step="1">1</el-input-number> <el-input-number size="medium" v-model="detailYH[index - 1]" :min="1" :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="部门所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6"> <el-form-item label="部门所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-input-number size="medium" v-model="CleanIng.DepartmentColumn" :min="1" <el-input-number size="medium" v-model="CleanIng.DepartmentColumn" :min="1"
:step="1">1</el-input-number> :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="导入表列坐标" prop="detailYL" class="form-item-inline" v-else> <el-form-item label="导入表列坐标" prop="detailYL" class="form-item-inline" v-else>
<el-input-number size="medium" v-model="detailYL[index - 1]" :min="1" :step="1">1</el-input-number> <el-input-number size="medium" v-model="detailYL[index - 1]" :min="1" :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="数量所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6"> <el-form-item label="数量所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-input-number size="medium" v-model="CleanIng.NumberColumn" :min="1" <el-input-number size="medium" v-model="CleanIng.NumberColumn" :min="1"
:step="1">1</el-input-number> :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="金额所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6"> <el-form-item label="单价所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-input-number size="medium" v-model="CleanIng.MoneyColumn" :min="1" :step="1">1</el-input-number> <el-input-number size="medium" v-model="CleanIng.MoneyColumn" :min="1" :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="日期所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-select v-model="datevalue" placeholder="请选择日期所在列" @change="dateChange" label="日期所在列">
<el-form-item label="日期所在列" prop="CleanIng" class="form-item-inline"
v-if="options2id === 6 ">
<el-select v-model="datevalue" placeholder="请选择日期所在列" @change="dateChange"
label="日期所在列">
<el-option v-for="item in date" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in date" :key="item.value" :label="item.label" :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<el-input-number style="margin-left: 5vw;" v-if="datevalue == 1" size="medium" v-model="CleanIng.DateColumn" :min="1" :step="1">1</el-input-number> <el-input-number style="margin-left: 5vw;" v-if="datevalue == 1" size="medium"
v-model="CleanIng.DateColumn" :min="1" :step="1">1</el-input-number>
</el-form-item>
<el-form-item label="计量单位所在列" prop="CleanIng" class="form-item-inline" v-if="options2id === 6">
<el-input-number size="medium" v-model="CleanIng.unit" :min="1" :step="1">1</el-input-number>
</el-form-item> </el-form-item>
<el-form-item style="display: inline-block;"> <br>
<el-form-item style="display: inline-block;" v-if="!isDelete">
<el-button type="danger" icon="el-icon-delete" size="small" <el-button type="danger" icon="el-icon-delete" size="small"
@click="removeInputs(index)">删除</el-button> @click="removeInputs(index)">删除</el-button>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item style="display: inline-block;" v-if="isDelete">
<el-button type="danger" icon="el-icon-delete" size="small" @click="removeInputs">删除</el-button>
</el-form-item>
<div v-if="options2id !== 6 && instea >= 1" style="color: red; margin-left: 2.5vw;"> <div v-if="options2id !== 6 && instea >= 1" style="color: red; margin-left: 2.5vw;">
为防止后面步骤出错,导入表和模板表的行列坐标必须为表头所在单元格的行列</div> 为防止后面步骤出错,导入表和模板表的行列坐标必须为表头所在单元格的行列</div>
</el-form> </el-form>
...@@ -202,350 +216,444 @@ ...@@ -202,350 +216,444 @@
</div> </div>
</template> </template>
<style> <style>
.form-item-inline { .form-item-inline {
display: inline-block; display: inline-block;
margin-right: 20px; margin-right: 20px;
} }
</style> </style>
<script> <script>
import { import {
listSuppliesroledetail, listSuppliesroledetail,
getSuppliesroledetail, getSuppliesroledetail,
delSuppliesroledetail, delSuppliesroledetail,
addSuppliesroledetail, addSuppliesroledetail,
updateSuppliesroledetail, updateSuppliesroledetail,
exportSuppliesroledetail, exportSuppliesroledetail,
saveSid, saveSid,
toggleEnable, toggleEnable,
toggleDisable, toggleDisable,
saveOperation, saveOperation,
saveSidsta, saveSidsta,
} from "@/api/system/suppliesroledetail"; } from "@/api/system/suppliesroledetail";
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
export default { export default {
name: "Suppliesroledetail", name: "Suppliesroledetail",
components: { components: {
Editor, Editor,
},
data() {
return {
date: [{
value: 0,
label: ''
}, {
value: 1,
label: ''
}],
ConversionValue: '',
datevalue: 0,
// 遮罩层
loading: true,
//下拉选中的数值
options2id: '',
// 选中数组
ids: [],
name: [],
radiitemValue: {
radio: '',
conver: ''
},
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 规则详情表格数据
suppliesroledetailList: [],
options1: [],//上级ID
options3: [],
options2: [{ id: 0, operationName: "" }, { id: 1, operationName: "物料转换" }, { id: 2, operationName: "加法运算" }, { id: 3, operationName: "减法运算" }, { id: 4, operationName: "乘法运算" }, { id: 5, operationName: "除法运算" }, { id: 6, operationName: '清洗规则' }],//上级ID
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
inputCount: 0,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
roleId: null,
detailName: null,
detailContent: null,
status: null,
converStatus: null,
},
// 表单参数
form: {
},
CleanIng: {
HeaderRow: '',
NameColumn: '',
CodeColumn: '',
DepartmentColumn: '',
NumberColumn: '',
MoneyColumn: '',
DateColumn: '',
unit: '',
expenses: '',
conversion: '',
spare: ''
},
detailMH: [],
detailML: [],
detailYH: [],
detailYL: [],
instea: 0,
showTemplate: false, // 控制单元格的显示与隐藏
showImport: false, // 控制行转换的显示与隐藏
showLie: false, // 控制列转换的显示与隐藏
// 表单校验
rules: {
roleId: [
{ required: true, message: '关联id不能为空', trigger: 'change' },
],
convertStatus: [
{ required: true, message: '运算规则不能为空', trigger: 'change' },
],
detailName: [
{ required: true, message: '规则名称不能为空', trigger: 'change' },
]
}
};
},
watch: {
open() {
if (this.open === false) {
this.radiitemValue.radio = 0
this.radiitemValue.conver = 0
}
}
},
computed: {
isDisable() {
return (this.instea >= 1 && this.options2id == 6) || (this.radiitemValue.radio == 2 && this.radiitemValue.conver == 3 && this.instea >= 4)
}, },
data() { isDelete() {
return { return (this.radiitemValue.radio == 3 && this.radiitemValue.conver == 1 && this.instea >= 4) || (this.radiitemValue.radio == 3 && this.radiitemValue.conver == 2 && this.instea >= 2)
date: [{
value: 0,
label: ''
}, {
value: 1,
label: ''
}],
datevalue: 0,
// 遮罩层
loading: true,
//下拉选中的数值
options2id: '',
// 选中数组
ids: [],
name: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 规则详情表格数据
suppliesroledetailList: [],
options1: [],//上级ID
options3: [],
options2: [{ id: 0, operationName: "" }, { id: 1, operationName: "物料转换" }, { id: 2, operationName: "加法运算" }, { id: 3, operationName: "减法运算" }, { id: 4, operationName: "乘法运算" }, { id: 5, operationName: "除法运算" }, { id: 6, operationName: '清洗规则' }],//上级ID
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
inputCount: 0,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
roleId: null,
detailName: null,
detailContent: null,
status: null,
converStatus: null,
},
// 表单参数
form: {
},
CleanIng: {
HeaderRow: '',
NameColumn: '',
CodeColumn: '',
DepartmentColumn: '',
NumberColumn: '',
MoneyColumn: '',
DateColumn: ''
},
detailMH: [],
detailML: [],
detailYH: [],
detailYL: [],
instea: 0,
showTemplate: false, // 控制单元格的显示与隐藏
showImport: false, // 控制行转换的显示与隐藏
showLie: false, // 控制列转换的显示与隐藏
// 表单校验
rules: {
roleId: [
{ required: true, message: '关联id不能为空', trigger: 'change' },
],
convertStatus: [
{ required: true, message: '运算规则不能为空', trigger: 'change' },
],
detailName: [
{ required: true, message: '规则名称不能为空', trigger: 'change' },
]
}
};
}, },
watch: { isTitle() {
options2id(newValue) { return this.radiitemValue.radio == 3 && this.radiitemValue.conver == 1
if (newValue >= 0 && this.detailMH.length >= 1) {
this.instea = 1
}
}
}, },
computed: { isTittle() {
isDisable() { return this.radiitemValue.radio == 3 && this.radiitemValue.conver == 2
return this.instea >= 1 && this.options2id == 6; }
}, },
created() {
this.getList();
this.getnameid();
},
methods: {
empty() {
this.optionid = ''
this.datevalue = 0
this.radiitemValue.radio = 0
this.radiitemValue.conver = 0
this.detailMH = []
this.detailML = []
this.detailYH = []
this.detailYL = []
}, },
created() { Dialog() {
this.getList(); this.empty()
this.getnameid();
}, },
methods: { radiovalue(value) {
dateChange() { this.detailMH = []
this.CleanIng.DateColumn = '' this.detailML = []
}, this.detailYH = []
handleRadioChange() { this.detailYL = []
this.options2id = this.form.convertStatus this.instea = 0
this.radiitemValue.radio = Number(value)
},
dateChange() {
this.CleanIng.DateColumn = ''
},
handleRadioChange(value) {
this.radiitemValue.conver = value
this.options2id = this.form.convertStatus
this.detailMH = []
this.detailML = []
this.detailYH = []
this.detailYL = []
this.instea = 0
this.CleanIng = {
HeaderRow: '',
NameColumn: '',
CodeColumn: '',
DepartmentColumn: '',
NumberColumn: '',
MoneyColumn: '',
DateColumn: '',
unit: '',
expenses: '',
conversion: '',
spare: ''
}
},
removeInputs(index) {
if (this.isDelete) {
this.instea = 0
this.detailMH = [] this.detailMH = []
this.detailML = [] this.detailML = []
this.detailYH = [] this.detailYH = []
this.detailYL = [] this.detailYL = []
this.instea = 0 } else {
this.CleanIng = {
HeaderRow: '',
NameColumn: '',
CodeColumn: '',
DepartmentColumn: '',
NumberColumn: '',
MoneyColumn: '',
DateColumn: ''
}
},
removeInputs(index) {
this.detailMH.splice(index - 1, 1); this.detailMH.splice(index - 1, 1);
this.detailML.splice(index - 1, 1); this.detailML.splice(index - 1, 1);
this.detailYH.splice(index - 1, 1); this.detailYH.splice(index - 1, 1);
this.detailYL.splice(index - 1, 1); this.detailYL.splice(index - 1, 1);
this.instea = this.instea - 1; this.instea = this.instea - 1;
}, }
addInputs() {
},
addInputs() {
if ((this.radiitemValue.radio == 3 && this.radiitemValue.conver == 1) || (this.radiitemValue.radio == 3 && this.radiitemValue.conver == 2)) {
if (this.radiitemValue.radio == 3 && this.radiitemValue.conver == 1) {
let i = 4 - this.instea
this.instea += i
if (this.detailMH && this.detailML && this.detailYH && this.detailYL) {
[this.detailMH, this.detailML, this.detailYH, this.detailYL].forEach(arr => {
while (arr.length < 4) arr.push(1);
});
}
}
if (this.radiitemValue.radio == 3 && this.radiitemValue.conver == 2) {
let i = 2 - this.instea
this.instea += i
if (this.detailMH && this.detailML && this.detailYH && this.detailYL) {
[this.detailMH, this.detailML, this.detailYH, this.detailYL].forEach(arr => {
while (arr.length < 2) arr.push(1);
});
}
}
} else {
this.instea += 1; this.instea += 1;
this.detailMH.push(1) this.detailMH.push(1)
this.detailML.push(1) this.detailML.push(1)
this.detailYH.push(1) this.detailYH.push(1)
this.detailYL.push(1) this.detailYL.push(1)
}, }
toggleEnable(suppliesRoleDetail) {
console.log('你点击了【' + suppliesRoleDetail.s + '】的开关控件,当前开关值:' + suppliesRoleDetail.status); },
let enableText = ['启用', '禁用']; toggleEnable(suppliesRoleDetail) {
if (suppliesRoleDetail.status === 0) { console.log('你点击了【' + suppliesRoleDetail.s + '】的开关控件,当前开关值:' + suppliesRoleDetail.status);
toggleEnable(suppliesRoleDetail.id).then((response) => { let enableText = ['启用', '禁用'];
if (response.code === 200) { if (suppliesRoleDetail.status === 0) {
let message = '操作成功,已经将【' + suppliesRoleDetail.roleName + '】的状态改为【' + enableText[suppliesRoleDetail.status] + '】 !'; toggleEnable(suppliesRoleDetail.id).then((response) => {
this.$message({ message: message, type: 'success' }); if (response.code === 200) {
} else { let message = '操作成功,已经将【' + suppliesRoleDetail.roleName + '】的状态改为【' + enableText[suppliesRoleDetail.status] + '】 !';
this.$message.error(response.message); this.$message({ message: message, type: 'success' });
} } else {
}); this.$message.error(response.message);
} else { }
toggleDisable(suppliesRoleDetail.id).then((response) => {
if (response.code === 200) {
let message = '操作成功,已经将【' + suppliesRoleDetail.roleName + '】的状态改为【' + enableText[suppliesRoleDetail.status] + '】 !';
this.$message({ message: message, type: 'error' });
} else {
this.$message.error(response.message);
}
});
}
},
/**显示序号*/
indexMethod(index) {
return index + 1;
},
/**获取关联表内容*/
getnameid() {
//上级规则
saveSid().then(response => {
this.options1 = response.rows;
})
},
/** 查询规则详情列表 */
getList() {
this.indexMethod(0);
this.loading = true;
listSuppliesroledetail(this.queryParams).then(response => {
this.suppliesroledetailList = response.rows;
this.total = response.total;
this.loading = false;
}); });
}, } else {
// 取消按钮 toggleDisable(suppliesRoleDetail.id).then((response) => {
cancel() { if (response.code === 200) {
this.open = false; let message = '操作成功,已经将【' + suppliesRoleDetail.roleName + '】的状态改为【' + enableText[suppliesRoleDetail.status] + '】 !';
this.reset(); this.$message({ message: message, type: 'error' });
}, } else {
// 表单重置 this.$message.error(response.message);
reset() { }
this.form = { });
id: null, }
roleId: null, },
detailName: null, /**显示序号*/
detailYS: null, indexMethod(index) {
detailContent: null, return index + 1;
status: 0, },
convertStatus: null, /**获取关联表内容*/
createBy: null, getnameid() {
createTime: null, //上级规则
updateBy: null, saveSid().then(response => {
updateTime: null, this.options1 = response.rows;
cleanIng: null })
}; },
this.resetForm("form"); /** 查询规则详情列表 */
}, getList() {
/** 搜索按钮操作 */ this.indexMethod(0);
handleQuery() { this.loading = true;
this.queryParams.pageNum = 1; listSuppliesroledetail(this.queryParams).then(response => {
this.getList(); this.suppliesroledetailList = response.rows;
}, this.total = response.total;
/** 重置按钮操作 */ this.loading = false;
resetQuery() { });
this.resetForm("queryForm"); },
this.handleQuery(); // 取消按钮
}, cancel() {
// 多选框选中数据
handleSelectionChange(selection) { this.open = false;
this.ids = selection.map(item => item.id) this.reset();
this.name = selection.map(item => item.detailName) },
this.single = selection.length !== 1 // 表单重置
this.multiple = !selection.length reset() {
}, this.form = {
/** 新增按钮操作 */ id: null,
handleAdd() { roleId: null,
//上级规则 detailName: null,
saveSidsta().then(response => { detailYS: null,
this.options3 = response.rows; detailContent: null,
}) status: 0,
this.instea = 0; convertStatus: null,
this.getnameid(); createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
cleanIng: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.name = selection.map(item => item.detailName)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
//上级规则
saveSidsta().then(response => {
this.options3 = response.rows;
})
this.instea = 0;
this.getnameid();
this.reset();
this.open = true;
this.title = "添加规则详情";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.getnameid();
const ids = this.options1.map(option => option.id);
if (ids.findIndex(item => item === row.roleId) !== -1) {
this.reset(); this.reset();
this.open = true; const id = row.id || this.ids
this.title = "添加规则详情"; getSuppliesroledetail(id).then(response => {
}, this.form = response.data;
/** 修改按钮操作 */ this.radiitemValue.conver = this.form.convertStatus
handleUpdate(row) { this.radiitemValue.radio = this.form.detailYS
this.getnameid(); this.options2id = response.data.convertStatus
const ids = this.options1.map(option => option.id); const detailContent = response.data.detailContent;
if (ids.findIndex(item => item === row.roleId) !== -1) { const parse = JSON.parse(detailContent);
this.reset(); this.instea = parse.length
const id = row.id || this.ids if (this.options2id === 6) {
getSuppliesroledetail(id).then(response => { this.CleanIng = parse[0]
this.form = response.data; if (this.CleanIng.DateColumn !== '') {
this.options2id = response.data.convertStatus this.datevalue = 1
const detailContent = response.data.detailContent;
const parse = JSON.parse(detailContent);
console.log(response.data)
if (this.options2id === 6) {
this.instea = 1
this.CleanIng = parse[0]
if (this.CleanIng.DateColumn !== '') {
this.datevalue = 1
} else {
this.datevalue = 0
}
} else { } else {
this.detailMH = parse.map(obj => parseInt(obj.rt) + 1); this.datevalue = 0
this.detailML = parse.map(obj => parseInt(obj.ct) + 1);
this.detailYH = parse.map(obj => parseInt(obj.re) + 1);
this.detailYL = parse.map(obj => parseInt(obj.ce) + 1);
this.instea = this.detailMH.length;
}
this.open = true;
this.title = "修改规则详情";
});
} else {
this.msgError("上级规则已发布,无法修改")
}
},
/** 提交按钮 */
submitForm() {
this.form.cleanIng = JSON.stringify(this.CleanIng);
this.form.detailMH = this.detailMH;
this.form.detailML = this.detailML;
this.form.detailYH = this.detailYH;
this.form.detailYL = this.detailYL;
this.form.status = 1;
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
console.log(JSON.parse(this.form.cleanIng),'2222222222')
updateSuppliesroledetail(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSuppliesroledetail(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
} }
} else {
this.detailMH = parse.map(obj => parseInt(obj.rt) + 1);
this.detailML = parse.map(obj => parseInt(obj.ct) + 1);
this.detailYH = parse.map(obj => parseInt(obj.re) + 1);
this.detailYL = parse.map(obj => parseInt(obj.ce) + 1);
this.instea = this.detailMH.length;
} }
this.open = true;
this.title = "修改规则详情";
}); });
}, } else {
/** 删除按钮操作 */ this.msgError("上级规则已发布,无法修改")
handleDelete(row) {
const ids = row.id || this.ids;
const name = row.detailName || this.name;
this.$confirm('是否确认删除规则详情编号为"' + name + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delSuppliesroledetail(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有规则详情数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportSuppliesroledetail(queryParams);
}).then(response => {
this.download(response.msg);
})
} }
},
/** 提交按钮 */
submitForm() {
this.form.cleanIng = JSON.stringify(this.CleanIng);
this.form.detailMH = this.detailMH;
this.form.detailML = this.detailML;
this.form.detailYH = this.detailYH;
this.form.detailYL = this.detailYL;
this.form.status = 1;
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
console.log(JSON.parse(this.form.cleanIng), '2222222222')
updateSuppliesroledetail(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSuppliesroledetail(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
const name = row.detailName || this.name;
this.$confirm('是否确认删除规则详情编号为"' + name + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delSuppliesroledetail(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有规则详情数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportSuppliesroledetail(queryParams);
}).then(response => {
this.download(response.msg);
})
} }
}; }
</script> };
</script>
\ No newline at end of file
...@@ -21,7 +21,6 @@ module.exports = { ...@@ -21,7 +21,6 @@ module.exports = {
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir: 'dist', outputDir: 'dist',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: 'static',
// 是否开启eslint保存检测,有效值:ture | false | 'error' // 是否开启eslint保存检测,有效值:ture | false | 'error'
lintOnSave: false,//process.env.NODE_ENV === 'development' lintOnSave: false,//process.env.NODE_ENV === 'development'
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
...@@ -34,9 +33,9 @@ module.exports = { ...@@ -34,9 +33,9 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://192.168.10.105:5001`, target: `http://192.168.0.111:8080`,
// target: `http://localhost:5001`, // target: `http://localhost:5001`,
target: `http://localhost:8080`, // target: `http://localhost:8080`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment