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

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

@ -57,3 +57,12 @@ export function addCustomizeParam(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",
component: Empty,
path: "systemPDFTemplate/template",
component: systemPDFTemplate,
name: "打印模板",
redirect: "/systemPDFTemplate/template",
icon: "",
meta: {
authRule: ["systemParam/systemPDFTemplate"]
},
children: [
/*children: [
{
path: "template",
component: systemPDFTemplate,
@ -253,7 +252,7 @@ export const asyncRouterMap = [
authRule: ["pdf/template"]
}
}
]
]*/
},
{
path: "/enterpriseManage",

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

@ -120,19 +120,19 @@
</p>
</template>
</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">
<el-input :disabled="scope.$index !== currentCheckIndex" v-model="scope.row.remark1"
placeholder="请输入"></el-input>
</template>
</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">
<el-input :disabled="scope.$index !== currentCheckIndex" v-model="scope.row.remark2"
placeholder="请输入"></el-input>
</template>
</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">
<el-input :disabled="scope.$index !== currentCheckIndex" v-model="scope.row.remark3"
placeholder="请输入"></el-input>
@ -330,7 +330,7 @@
:close-on-press-escape="false"
:visible.sync="moduleFormVisible"
:before-close="moduleHideForm"
width="70%"
width="50%"
top="5vh"
>
<el-form ref="singleTable">
@ -338,8 +338,19 @@
highlight-current-row
@current-change="moduleSelectHandleCurrentChange">
<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" 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-pagination
@ -389,6 +400,7 @@ import { saveAs } from "file-saver";
import { BASE_URL, SERVER_IP } from "../../../config/app";
import { authRoleAuthList } from "../../../api/auth/authRole";
import { updateStockOrderDetail } from "@/api/warehouse/stockOrder";
import {demoPrint} from "@/api/itextpdf/itextpdf";
const formJson = {
id: "",
@ -544,7 +556,22 @@ export default {
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) {
this.handleDownload(BASE_URL + "/udiwms/donwload/file?fileName=" + row.templateDlUrl, row.name + ".jrxml");
},

@ -71,8 +71,6 @@
>预览
</el-button
>
</template>
</el-table-column>
</el-table>
@ -326,7 +324,7 @@ import {
import {BASE_URL, SERVER_IP} from "../../../config/app";
import {authRoleAuthList} from "../../../api/auth/authRole";
import {saveAs} from 'file-saver';
import {demoPrint, stockOrderPDFFromTemplateFile} from "@/api/itextpdf/itextpdf";
import {demoPrint} from "@/api/itextpdf/itextpdf";
const formJson = {
id: "",
@ -739,19 +737,6 @@ export default {
}
this.$message.success("操作成功");
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(() => {
this.formLoading = false;

@ -35,8 +35,13 @@
size="small"
@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>
</el-table-column>
</el-table>
@ -132,208 +137,234 @@
</template>
<script>
import {
systemParamConfigList,
systemParamConfigSave,
getCustomizeParams,
addCustomizeParam
} from "../../../api/param/systemParamConfig";
import {
systemParamConfigList,
systemParamConfigSave,
getCustomizeParams,
addCustomizeParam,
deleteParam
} from "../../../api/param/systemParamConfig";
const formJson = {
id: "",
parentId: "",
paramName: "",
paramKey: "",
paramValue: "",
paramStatus: 1,
paramType: 1,
paramExplain: "",
customerId: null
};
export default {
data() {
return {
query: {
paramName: "",
paramStatus: 1,
page: 1,
limit: 20,
customerId: this.$store.getters.customerId
},
list: [],
total: 0,
loading: true,
index: null,
formName: null,
formMap: {
add: "新增",
update: "设置"
},
formLoading: false,
formVisible: false,
addParamVisible: false,
customizeParamList: [],
formData: formJson,
formRules: {
paramValue: [
{ required: true, message: "请输入参数值", trigger: "blur" }
]
// ,
// paramStatus: [
// {required: true, message: "", trigger: "change"}
// ]
},
deleteLoading: false
};
},
methods: {
onReset() {
this.$router.push({
path: ""
});
this.query = {
paramName: "",
paramStatus: 1,
page: 1,
limit: 20
const formJson = {
id: "",
parentId: "",
paramName: "",
paramKey: "",
paramValue: "",
paramStatus: 1,
paramType: 1,
paramExplain: "",
customerId: null
};
export default {
data() {
return {
query: {
paramName: "",
paramStatus: 1,
page: 1,
limit: 20,
customerId: this.$store.getters.customerId
},
list: [],
total: 0,
loading: true,
index: null,
formName: null,
formMap: {
add: "新增",
update: "设置"
},
formLoading: false,
formVisible: false,
addParamVisible: false,
customizeParamList: [],
formData: formJson,
formRules: {
paramValue: [
{required: true, message: "请输入参数值", trigger: "blur"}
]
// ,
// paramStatus: [
// {required: true, message: "", trigger: "change"}
// ]
},
deleteLoading: false
};
this.getList();
},
onSubmit() {
this.getList();
},
handleCurrentChange(val) {
this.query.page = val;
this.getList();
},
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;
methods: {
onReset() {
this.$router.push({
path: ""
});
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$refs["dataForm"].resetFields();
this.query = {
paramName: "",
paramStatus: 1,
page: 1,
limit: 20
};
this.getList();
}
},
//
hideForm() {
//
this.formVisible = !this.formVisible;
return true;
},
hideAddParamForm() {
this.addParamVisible = !this.addParamVisible;
},
//
handleForm(index, row) {
this.formVisible = true;
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;
}
this.$message.success("操作成功");
this.formVisible = false;
if (this.formName === "add") {
//
if (response.data && response.data.id) {
data.id = response.data.id;
this.list.unshift(data);
},
onSubmit() {
this.getList();
},
handleCurrentChange(val) {
this.query.page = val;
this.getList();
},
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;
});
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$refs["dataForm"].resetFields();
this.getList();
}
},
//
hideForm() {
//
this.formVisible = !this.formVisible;
return true;
},
hideAddParamForm() {
this.addParamVisible = !this.addParamVisible;
},
//
handleForm(index, row) {
this.formVisible = true;
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.list.splice(this.index, 1, data);
}
//
this.resetForm();
this.getList();
})
.catch(() => {
this.formLoading = false;
this.$message.success("操作成功");
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();
})
.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: '已取消'
});
});
}
},
//
addCustomizeParam() {
this.addParamVisible = true;
let query = { customerId: this.$store.getters.customerId};
getCustomizeParams(query).then((res) => {
this.customizeParamList = res.data || [];
}).catch((error) => {
});
filters: {
paramStatusFilterType(paramStatus) {
const paramStatusMap = {
0: "gray",
1: "success"
};
return paramStatusMap[paramStatus];
},
paramStatusFilterName(paramStatus) {
const paramStatusMap = {
0: "禁用",
1: "正常"
};
return paramStatusMap[paramStatus];
}
},
//
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];
mounted() {
},
paramStatusFilterName(paramStatus) {
const paramStatusMap = {
0: "禁用",
1: "正常"
};
return paramStatusMap[paramStatus];
created() {
//
this.getList();
}
},
mounted() {
},
created() {
//
this.getList();
}
};
};
</script>
<style type="text/scss" lang="scss">

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

Loading…
Cancel
Save