1.运行参数添加删除功能

2.提交单据到自助平台增加提示弹框
3.调整菜单
4.调整打印设置页面,增加预览功能
master
x_z 3 years ago
parent f9c16c5401
commit 9a14a4298f

@ -57,3 +57,12 @@ export function addCustomizeParam(data) {
data: data data: data
}); });
} }
//删除参数
export function deleteParam(query) {
return axios({
url: "/udiwms/sys/config/deleteParam",
method: "get",
params: query
});
}

@ -235,15 +235,14 @@ export const asyncRouterMap = [
} }
}, },
{ {
path: "/systemPDFTemplate", path: "systemPDFTemplate/template",
component: Empty, component: systemPDFTemplate,
name: "打印模板", name: "打印模板",
redirect: "/systemPDFTemplate/template",
icon: "", icon: "",
meta: { meta: {
authRule: ["systemParam/systemPDFTemplate"] authRule: ["systemParam/systemPDFTemplate"]
}, },
children: [ /*children: [
{ {
path: "template", path: "template",
component: systemPDFTemplate, component: systemPDFTemplate,
@ -253,7 +252,7 @@ export const asyncRouterMap = [
authRule: ["pdf/template"] authRule: ["pdf/template"]
} }
} }
] ]*/
}, },
{ {
path: "/enterpriseManage", path: "/enterpriseManage",

@ -59,13 +59,13 @@
>编辑 >编辑
</el-button </el-button
> >
<!-- <el-button <!-- <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="handleLinkClick(scope.row)" @click.native.stop="handleLinkClick(scope.row)"
>关联自助平台 >关联自助平台
</el-button </el-button
>--> >-->
<el-button <el-button
type="text" type="text"
size="small" size="small"
@ -92,6 +92,51 @@
:close-on-press-escape="false" :close-on-press-escape="false"
> >
<el-form :model="editQuery" ref="editQuery" :rules="rules"> <el-form :model="editQuery" ref="editQuery" :rules="rules">
<!--<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<div class="text item">
<div class="text item">
<el-form-item label="往来单位名称" prop="name">
<el-input v-model="editQuery.name" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="拼音码" prop="pinyinCode">
<el-input v-model="editQuery.pinyinCode" auto-complete="off" ></el-input>
</el-form-item>
<el-form-item label="企业自定义ID" prop="thirdId">
<el-input v-model="editQuery.thirdId"" auto-complete="off" ></el-input>
</el-form-item>
<el-form-item label="社会信用号" prop="creditNo">
<el-input type="" v-model="editQuery.creditNo" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</div>
</div>
</el-col>
<el-col :span="10" class="el-col" type="flex">
<div class="text item">
<el-form-item label="往来单位编码" prop="contact">
<el-input v-model="editQuery.contact" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="第三方往来单位ID" prop="thirdId">
<el-input v-model="editQuery.mobile" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="地址" prop="addr">
<el-input v-model="editQuery.addr" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
<el-form-item v-if="spellUpdate" label="往来单位类型" prop="corpType">
<el-select v-model="editQuery.corpType" placeholder="往来单位类型">
<el-option
v-for="item in corpTypeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</div>
</el-col>
</el-row>-->
<el-row :gutter="20" class="el-row" type="flex"> <el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col" type="flex"> <el-col :span="10" class="el-col" type="flex">
<div class="text item"> <div class="text item">
@ -105,17 +150,15 @@
</el-form-item> </el-form-item>
</div> </div>
</el-col> </el-col>
<el-col :span="10" class="el-col"> <el-col :span="10" class="el-col" type="flex">
<div class="text item"> <div class="text item">
<div class="text item"> <el-form-item label="拼音码" prop="pinyinCode">
<el-form-item label="往来单位简写" prop="spell"> <el-input
<el-input v-model="editQuery.pinyinCode"
v-model="editQuery.spell" style="width: 60%"
size="small" size="small"
style="width: 60%" ></el-input>
></el-input> </el-form-item>
</el-form-item>
</div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -167,7 +210,6 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20" class="el-row" type="flex"> <el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col" type="flex"> <el-col :span="10" class="el-col" type="flex">
<div class="text item"> <div class="text item">
@ -180,20 +222,6 @@
</el-form-item> </el-form-item>
</div> </div>
</el-col> </el-col>
<el-col :span="10" class="el-col" type="flex">
<div class="text item">
<el-form-item label="拼音码" prop="pinyinCode">
<el-input
v-model="editQuery.pinyinCode"
style="width: 60%"
size="small"
></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col" type="flex"> <el-col :span="10" class="el-col" type="flex">
<div class="text item"> <div class="text item">
<el-form-item label="往来单位类型" prop="corpType"> <el-form-item label="往来单位类型" prop="corpType">
@ -209,7 +237,6 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -313,260 +340,295 @@
</template> </template>
<script> <script>
import { import {
getUnitMaintain, getUnitMaintain,
addUnit, addUnit,
modifyUnit, modifyUnit,
deleteUnitMaintain deleteUnitMaintain
} from "../../api/receipts/unitMaintain"; } from "../../api/receipts/unitMaintain";
import { import {
getPlatform, getPlatform,
linkPlatform linkPlatform
} from "../../api/auth/platform"; } from "../../api/auth/platform";
export default { export default {
data() { data() {
return { return {
query: { query: {
key: "", key: "",
customerId: this.$store.getters.customerId, customerId: this.$store.getters.customerId,
page: 1, page: 1,
limit: 20 limit: 20
}, },
editQuery: {
unitId: null,
thirdId: null,
name: null,
spell: null,
creditNo: null,
pinyinCode: null,
contact: null,
mobile: null,
corpType: null,
outType: null
},
editLogin: {
platformId: null,
platformUsername: null,
platformPassword: null,
appid: null,
appKey: null,
sceretKey: null
},
editPlatfromQuery: {
id: null,
name: null,
host: null
},
spellUpdate: true,
platformVisible: false,
editLoginVisible: false,
checked: false,
editDialogVisible: false,
list: [],
platformList: [],
total: 0,
multipleSelection: [],
rules: {
name: [
{required: true, message: "请输入往来单位名称", trigger: "change"}
],
creditNo: [
{required: true, message: "请输入社会信用号", trigger: "change"}
],
corpType: [
{required: true, message: "请选择往来单位类型", trigger: "change"}
],
pinyinCode: [
{required: true, message: "请输入拼音码", trigger: "change"}
]
},
platformRules: {
platformId: [
{required: true, message: "请选择自助平台", trigger: "change"}
],
userName: [
{required: true, message: "请输入账号", trigger: "change"}
],
password: [
{required: true, message: "请输入密码", trigger: "change"}
]
editQuery: { },
unitId: null, editType: 0,
thirdId: null, editTypeMap: {
name: null, 0: "新增往来单位",
spell: null, 1: "编辑往来单位",
creditNo: null, 2: "关联自助平台"
pinyinCode: null, },
contact: null, corpTypeList: [
mobile: null, {
corpType: null, value: 1,
outType: null label: "客户"
},
{
value: 2,
label: "供应商"
},
{
value: 4,
label: "特殊往来"
}
],
coryTypeArr: {
1: "客户",
2: "供应商",
4: "特殊往来"
}
};
},
methods: {
onReset() {
this.$router.push({
path: ""
});
this.query = {
key: "",
customerId: this.$store.getters.customerId,
page: 1,
limit: 20
};
this.getList();
}, },
editLogin: { getList() {
platformId: null, this.loading = true;
platformUsername: null, getUnitMaintain(this.query)
platformPassword: null, .then((response) => {
appid: null, this.loading = false;
appKey: null, this.list = response.data.list || [];
sceretKey: null this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
}, },
editPlatfromQuery: { //
id: null, getPlatformList() {
name: null, this.loading = true;
host: null getPlatform()
.then((response) => {
this.loading = false;
this.platformList = response.data.list || [];
})
.catch(() => {
this.loading = false;
this.platformList = [];
});
}, },
platformVisible: false, deleteUnit(data) {
editLoginVisible: false, this.loading = true;
checked: false, let tquery = {
editDialogVisible: false, id: data.id + ""
list: [], };
platformList: [],
total: 0, deleteUnitMaintain(tquery)
multipleSelection: [], .then((response) => {
rules: { if (response.code == 20000) {
name: [ this.getList();
{ required: true, message: "请输入往来单位名称", trigger: "change" } this.$message({
], type: "success",
spell: [ message: "删除成功!"
{ required: true, message: "请输入往来单位简写", trigger: "change" } });
], }
creditNo: [ })
{ required: true, message: "请输入社会信用号", trigger: "change" } .catch(() => {
], });
corpType: [
{ required: true, message: "请选择往来单位类型", trigger: "change" }
],
pinyinCode: [
{ required: true, message: "请输入拼音码", trigger: "change" }
]
}, },
platformRules: {
platformId: [
{ required: true, message: "请选择自助平台", trigger: "change" }
],
userName: [
{ required: true, message: "请输入账号", trigger: "change" }
],
password: [
{ required: true, message: "请输入密码", trigger: "change" }
]
cancelDialog() {
this.editDialogVisible = false;
this.editLoginVisible = false;
}, },
editType: 0,
editTypeMap: { handleModifyClick(row) {
0: "新增往来单位", this.editType = 1;
1: "编辑往来单位", this.editDialogVisible = true;
2: "关联自助平台" this.editQuery = row;
}, },
corpTypeList: [ handleLinkClick(row) {
{ if (row.platformId != null) {
value: 1, //
label: "客户" this.$confirm("是否需要重新关联自助平台?", "提示", {
}, confirmButtonText: "确定",
{ cancelButtonText: "取消",
value: 2, type: "warning"
label: "供应商" }).then(() => {
}, this.editType = 2;
{ this.editLoginVisible = true;
value: 4, this.editLogin = row;
label: "特殊往来" }).catch(() => {
});
} else {
this.editType = 2;
this.editLoginVisible = true;
this.editLogin = row;
} }
], },
coryTypeArr: { handleAddClick() {
1: "客户", this.editType = 0;
2: "供应商", this.editDialogVisible = true;
4: "特殊往来" this.editQuery = {
} unitId: null,
}; thirdId: null,
}, name: null,
spell: null,
creditNo: null
};
var timestamp3 = new Date().getTime();
this.editQuery.unitId = timestamp3;
},
methods: { change() {
onReset() { var pinyin = require("pinyin");
this.$router.push({ var py = pinyin(this.editQuery.name, {
path: "" style: pinyin.STYLE_FIRST_LETTER, //
}); heteronym: true
this.query = {
key: "",
customerId: this.$store.getters.customerId,
page: 1,
limit: 20
};
this.getList();
},
getList() {
this.loading = true;
getUnitMaintain(this.query)
.then((response) => {
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
}); });
}, var str = "";
// py.forEach((item) => {
getPlatformList() { str = str + item[0];
this.loading = true;
getPlatform()
.then((response) => {
this.loading = false;
this.platformList = response.data.list || [];
})
.catch(() => {
this.loading = false;
this.platformList = [];
}); });
}, this.editQuery.pinyinCode = str;
deleteUnit(data) { },
this.loading = true;
let tquery = {
id: data.id + ""
};
deleteUnitMaintain(tquery) formSubmit() {
.then((response) => { this.$refs["editQuery"].validate((valid) => {
if (response.code == 20000) { if (valid) {
this.getList(); if (this.editType == 0) {
this.$message({ addUnit(this.editQuery)
type: "success", .then((response) => {
message: "删除成功!" if (response.code == 20000) {
}); this.getList();
this.$message({
type: "success",
message: "添加成功"
});
this.cancelDialog();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
} else {
modifyUnit(this.editQuery)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "修改成功"
});
this.cancelDialog();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
}
} }
})
.catch(() => {
}); });
}, },
intentPlatform(value) {
cancelDialog() { this.editPlatfromQuery.id = value;
this.editDialogVisible = false; },
this.editLoginVisible = false; deleteDialog(rowId) {
}, this.$confirm("此操作将永久删除该往来单位信息, 是否继续?", "提示", {
handleModifyClick(row) {
this.editType = 1;
this.editDialogVisible = true;
this.editQuery = row;
},
handleLinkClick(row) {
if (row.platformId != null) {
//
this.$confirm("是否需要重新关联自助平台?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(() => { })
this.editType = 2; .then(() => {
this.editLoginVisible = true; this.deleteUnit(rowId);
this.editLogin = row; })
}).catch(() => { .catch(() => {
}); });
} else { },
this.editType = 2; linkSubmit() {
this.editLoginVisible = true; this.$refs["editLogin"].validate((valid) => {
this.editLogin = row; if (valid) {
} linkPlatform(this.editLogin)
},
handleAddClick() {
this.editType = 0;
this.editDialogVisible = true;
this.editQuery = {
unitId: null,
thirdId: null,
name: null,
spell: null,
creditNo: null
};
var timestamp3 = new Date().getTime();
this.editQuery.unitId = timestamp3;
},
change() {
var pinyin = require("pinyin");
var py = pinyin(this.editQuery.name, {
style: pinyin.STYLE_FIRST_LETTER, //
heteronym: true
});
var str = "";
py.forEach((item) => {
str = str + item[0];
});
this.editQuery.pinyinCode = str;
},
formSubmit() {
this.$refs["editQuery"].validate((valid) => {
if (valid) {
if (this.editType == 0) {
addUnit(this.editQuery)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "添加成功"
});
this.cancelDialog();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
} else {
modifyUnit(this.editQuery)
.then((response) => { .then((response) => {
if (response.code == 20000) { if (response.code == 20000) {
this.getList(); this.getList();
this.$message({ this.$message({
type: "success", type: "success",
message: "修改成功" message: "关联成功"
}); });
this.cancelDialog(); this.cancelDialog();
} else { } else {
@ -575,77 +637,41 @@ export default {
}) })
.catch(() => { .catch(() => {
}); });
} }
}
});
},
intentPlatform(value) {
this.editPlatfromQuery.id = value;
},
deleteDialog(rowId) {
this.$confirm("此操作将永久删除该往来单位信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteUnit(rowId);
})
.catch(() => {
}); });
}, },
linkSubmit() {
this.$refs["editLogin"].validate((valid) => {
if (valid) {
linkPlatform(this.editLogin)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "关联成功"
});
this.cancelDialog();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
} exportTxt() {
}); },
},
exportTxt() { handleSelectionChange(val) {
}, console.log("----" + val);
this.multipleSelection = val;
},
handleSelectionChange(val) { handleCurrentChange(val) {
console.log("----" + val); this.query.page = val;
this.multipleSelection = val; this.getList();
}
}, },
mounted() {
handleCurrentChange(val) { },
this.query.page = val; created() {
this.getList(); this.getList();
this.getPlatformList();
var pinyin = require("pinyin");
console.log(
pinyin("中心", {
style: pinyin.STYLE_FIRST_LETTER, //
heteronym: true
})
);
} }
}, };
mounted() {
},
created() {
this.getList();
this.getPlatformList();
var pinyin = require("pinyin");
console.log(
pinyin("中心", {
style: pinyin.STYLE_FIRST_LETTER, //
heteronym: true
})
);
}
};
</script> </script>
<style> <style>
</style> </style>

@ -120,19 +120,19 @@
</p> </p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注字段1" prop="remark1" show-overflow-tooltip="true"> <el-table-column label="单据类型" prop="title" show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input :disabled="scope.$index !== currentCheckIndex" v-model="scope.row.remark1" <el-input :disabled="scope.$index !== currentCheckIndex" v-model="scope.row.remark1"
placeholder="请输入"></el-input> placeholder="请输入"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注字段2" prop="remark1" show-overflow-tooltip="true"> <el-table-column label="备注字段1" prop="remark1" show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input :disabled="scope.$index !== currentCheckIndex" v-model="scope.row.remark2" <el-input :disabled="scope.$index !== currentCheckIndex" v-model="scope.row.remark2"
placeholder="请输入"></el-input> placeholder="请输入"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注字段3" prop="remark1" show-overflow-tooltip="true"> <el-table-column label="备注字段2" prop="remark2" show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input :disabled="scope.$index !== currentCheckIndex" v-model="scope.row.remark3" <el-input :disabled="scope.$index !== currentCheckIndex" v-model="scope.row.remark3"
placeholder="请输入"></el-input> placeholder="请输入"></el-input>
@ -330,7 +330,7 @@
:close-on-press-escape="false" :close-on-press-escape="false"
:visible.sync="moduleFormVisible" :visible.sync="moduleFormVisible"
:before-close="moduleHideForm" :before-close="moduleHideForm"
width="70%" width="50%"
top="5vh" top="5vh"
> >
<el-form ref="singleTable"> <el-form ref="singleTable">
@ -338,8 +338,19 @@
highlight-current-row highlight-current-row
@current-change="moduleSelectHandleCurrentChange"> @current-change="moduleSelectHandleCurrentChange">
<el-table-column type="index" label="序号" width="50"></el-table-column> <el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="模板名称" prop="name" width="200"></el-table-column> <el-table-column label="模板名称" prop="name" width="300"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column> <el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" prop="remark" width="100">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="previewPdf(scope.row)"
>预览
</el-button
>
</template>
</el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination
@ -389,6 +400,7 @@ import { saveAs } from "file-saver";
import { BASE_URL, SERVER_IP } from "../../../config/app"; import { BASE_URL, SERVER_IP } from "../../../config/app";
import { authRoleAuthList } from "../../../api/auth/authRole"; import { authRoleAuthList } from "../../../api/auth/authRole";
import { updateStockOrderDetail } from "@/api/warehouse/stockOrder"; import { updateStockOrderDetail } from "@/api/warehouse/stockOrder";
import {demoPrint} from "@/api/itextpdf/itextpdf";
const formJson = { const formJson = {
id: "", id: "",
@ -544,7 +556,22 @@ export default {
xhr.send(); xhr.send();
}); });
}, },
previewPdf(row) {
let query = {id: row.id};
demoPrint(query).then((response) => {
//pdfurl
const binaryData = [];
binaryData.push(response);
//blob
let url = window.URL.createObjectURL(
new Blob(binaryData, {type: "application/pdf"})
);
this.loading = false;
window.open(url);//pdf
}).catch(() => {
this.loading = false;
});
},
jumpDl(row) { jumpDl(row) {
this.handleDownload(BASE_URL + "/udiwms/donwload/file?fileName=" + row.templateDlUrl, row.name + ".jrxml"); this.handleDownload(BASE_URL + "/udiwms/donwload/file?fileName=" + row.templateDlUrl, row.name + ".jrxml");
}, },

@ -71,8 +71,6 @@
>预览 >预览
</el-button </el-button
> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -326,7 +324,7 @@ import {
import {BASE_URL, SERVER_IP} from "../../../config/app"; import {BASE_URL, SERVER_IP} from "../../../config/app";
import {authRoleAuthList} from "../../../api/auth/authRole"; import {authRoleAuthList} from "../../../api/auth/authRole";
import {saveAs} from 'file-saver'; import {saveAs} from 'file-saver';
import {demoPrint, stockOrderPDFFromTemplateFile} from "@/api/itextpdf/itextpdf"; import {demoPrint} from "@/api/itextpdf/itextpdf";
const formJson = { const formJson = {
id: "", id: "",
@ -739,19 +737,6 @@ export default {
} }
this.$message.success("操作成功"); this.$message.success("操作成功");
this.formVisible = false; this.formVisible = false;
// if (this.formName === "add") {
// //
// if (response.data && response.data.id) {
// data.id = response.data.id;
// this.list.unshift(data);
// }
// } else {
// this.list.splice(this.index, 1, data);
// }
// //
// this.resetForm();
// this.getList();
// this.getModuleList();
}) })
.catch(() => { .catch(() => {
this.formLoading = false; this.formLoading = false;

@ -35,8 +35,13 @@
size="small" size="small"
@click.native="handleForm(scope.$index, scope.row)" @click.native="handleForm(scope.$index, scope.row)"
>设置 >设置
</el-button </el-button>
> <el-button
type="text"
size="small"
@click.native="deleteParam(scope.$index, scope.row)"
>删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -132,208 +137,234 @@
</template> </template>
<script> <script>
import { import {
systemParamConfigList, systemParamConfigList,
systemParamConfigSave, systemParamConfigSave,
getCustomizeParams, getCustomizeParams,
addCustomizeParam addCustomizeParam,
} from "../../../api/param/systemParamConfig"; deleteParam
} from "../../../api/param/systemParamConfig";
const formJson = { const formJson = {
id: "", id: "",
parentId: "", parentId: "",
paramName: "", paramName: "",
paramKey: "", paramKey: "",
paramValue: "", paramValue: "",
paramStatus: 1, paramStatus: 1,
paramType: 1, paramType: 1,
paramExplain: "", paramExplain: "",
customerId: null customerId: null
}; };
export default { export default {
data() { data() {
return { return {
query: { query: {
paramName: "", paramName: "",
paramStatus: 1, paramStatus: 1,
page: 1, page: 1,
limit: 20, limit: 20,
customerId: this.$store.getters.customerId customerId: this.$store.getters.customerId
}, },
list: [], list: [],
total: 0, total: 0,
loading: true, loading: true,
index: null, index: null,
formName: null, formName: null,
formMap: { formMap: {
add: "新增", add: "新增",
update: "设置" update: "设置"
}, },
formLoading: false, formLoading: false,
formVisible: false, formVisible: false,
addParamVisible: false, addParamVisible: false,
customizeParamList: [], customizeParamList: [],
formData: formJson, formData: formJson,
formRules: { formRules: {
paramValue: [ paramValue: [
{ required: true, message: "请输入参数值", trigger: "blur" } {required: true, message: "请输入参数值", trigger: "blur"}
] ]
// , // ,
// paramStatus: [ // paramStatus: [
// {required: true, message: "", trigger: "change"} // {required: true, message: "", trigger: "change"}
// ] // ]
}, },
deleteLoading: false deleteLoading: false
};
},
methods: {
onReset() {
this.$router.push({
path: ""
});
this.query = {
paramName: "",
paramStatus: 1,
page: 1,
limit: 20
}; };
this.getList();
},
onSubmit() {
this.getList();
}, },
handleCurrentChange(val) { methods: {
this.query.page = val; onReset() {
this.getList(); this.$router.push({
}, path: ""
getList() {
this.loading = true;
systemParamConfigList(this.query)
.then(response => {
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
}); });
}, this.query = {
// paramName: "",
resetForm() { paramStatus: 1,
if (this.$refs["dataForm"]) { page: 1,
// limit: 20
this.$refs["dataForm"].clearValidate(); };
//
this.$refs["dataForm"].resetFields();
this.getList(); this.getList();
} },
}, onSubmit() {
// this.getList();
hideForm() { },
// handleCurrentChange(val) {
this.formVisible = !this.formVisible; this.query.page = val;
return true; this.getList();
}, },
hideAddParamForm() { getList() {
this.addParamVisible = !this.addParamVisible; this.loading = true;
}, systemParamConfigList(this.query)
// .then(response => {
handleForm(index, row) { this.loading = false;
this.formVisible = true; this.list = response.data.list || [];
formJson.customerId = this.$store.getters.customerId; this.total = response.data.total || 0;
this.formData = JSON.parse(JSON.stringify(formJson)); })
if (row !== null) { .catch(() => {
this.formData = Object.assign({}, row); this.loading = false;
} this.list = [];
this.formName = "add"; this.total = 0;
if (index !== null) { });
this.index = index; },
this.formName = "update"; //
} resetForm() {
}, if (this.$refs["dataForm"]) {
formSubmit() { //
this.$refs["dataForm"].validate(valid => { this.$refs["dataForm"].clearValidate();
if (valid) { //
this.formLoading = true; this.$refs["dataForm"].resetFields();
let data = Object.assign({}, this.formData); this.getList();
data.paramValue = data.paramValue.trim(); }
systemParamConfigSave(data, this.formName) },
.then(response => { //
this.formLoading = false; hideForm() {
if (response.code !== 20000) { //
this.$message.error(response.message); this.formVisible = !this.formVisible;
return false; return true;
} },
this.$message.success("操作成功"); hideAddParamForm() {
this.formVisible = false; this.addParamVisible = !this.addParamVisible;
if (this.formName === "add") { },
// //
if (response.data && response.data.id) { handleForm(index, row) {
data.id = response.data.id; this.formVisible = true;
this.list.unshift(data); formJson.customerId = this.$store.getters.customerId;
this.formData = JSON.parse(JSON.stringify(formJson));
if (row !== null) {
this.formData = Object.assign({}, row);
}
this.formName = "add";
if (index !== null) {
this.index = index;
this.formName = "update";
}
},
formSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.formLoading = true;
let data = Object.assign({}, this.formData);
data.paramValue = data.paramValue.trim();
systemParamConfigSave(data, this.formName)
.then(response => {
this.formLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
} }
} else { this.$message.success("操作成功");
this.list.splice(this.index, 1, data); this.formVisible = false;
} if (this.formName === "add") {
// //
this.resetForm(); if (response.data && response.data.id) {
this.getList(); data.id = response.data.id;
}) this.list.unshift(data);
.catch(() => { }
this.formLoading = false; } else {
this.list.splice(this.index, 1, data);
}
//
this.resetForm();
this.getList();
})
.catch(() => {
this.formLoading = false;
});
}
});
},
//
addCustomizeParam() {
this.addParamVisible = true;
let query = {customerId: this.$store.getters.customerId};
getCustomizeParams(query).then((res) => {
this.customizeParamList = res.data || [];
}).catch((error) => {
});
},
//
addParam(index, row) {
row.customerId = this.$store.getters.customerId;
addCustomizeParam(row).then((res) => {
this.$message.success("添加成功");
this.getList();
this.customizeParamList.splice(index, 1);
if (this.customizeParamList.length == 0) {
this.addParamVisible = false;
}
}).catch((error) => {
this.$message.error(error.message);
});
},
//
deleteParam(index, row) {
this.$confirm('是否确认删除此参数?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let data = {id: row.id};
deleteParam(data).then((res) => {
this.getList();
this.$message({
type: 'success',
message: '删除成功!'
}); });
} }).catch((error) => {
}); this.$message.error("删除失败");
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}
}, },
// filters: {
addCustomizeParam() { paramStatusFilterType(paramStatus) {
this.addParamVisible = true; const paramStatusMap = {
let query = { customerId: this.$store.getters.customerId}; 0: "gray",
getCustomizeParams(query).then((res) => { 1: "success"
this.customizeParamList = res.data || []; };
}).catch((error) => { return paramStatusMap[paramStatus];
}); },
paramStatusFilterName(paramStatus) {
const paramStatusMap = {
0: "禁用",
1: "正常"
};
return paramStatusMap[paramStatus];
}
}, },
// mounted() {
addParam(index, row) {
row.customerId = this.$store.getters.customerId;
addCustomizeParam(row).then((res) => {
this.$message.success("添加成功");
this.getList();
this.customizeParamList.splice(index, 1);
if (this.customizeParamList.length == 0) {
this.addParamVisible = false;
}
}).catch((error) => {
this.$message.error(error.message);
});
}
},
filters: {
paramStatusFilterType(paramStatus) {
const paramStatusMap = {
0: "gray",
1: "success"
};
return paramStatusMap[paramStatus];
}, },
paramStatusFilterName(paramStatus) { created() {
const paramStatusMap = { //
0: "禁用", this.getList();
1: "正常"
};
return paramStatusMap[paramStatus];
} }
}, };
mounted() {
},
created() {
//
this.getList();
}
};
</script> </script>
<style type="text/scss" lang="scss"> <style type="text/scss" lang="scss">

@ -787,21 +787,33 @@
}); });
}, },
uploadSpms(row) { uploadSpms(row) {
let orderIds = []; this.$confirm('是否确认提交到 “' + row.fromCorp + '” 的UDI自助平台', '提示', {
orderIds.push(row.orderId); confirmButtonText: '确定',
let query = {orderIds: orderIds}; cancelButtonText: '取消',
row.uploadStatus = 1; type: 'warning'
updateSpms(query) }).then(() => {
.then((response) => { let orderIds = [];
if (response.code == 20000) { orderIds.push(row.orderId);
this.$message.success(response.data); let query = {orderIds: orderIds};
this.getList(); row.uploadStatus = 1;
} else { updateSpms(query)
this.$message.error(response.message); .then((response) => {
} if (response.code == 20000) {
}) this.$message.success(response.data);
.catch(() => { this.getList();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
}); });
});
} }
}, },
components: { components: {

Loading…
Cancel
Save