bug修改

fencang
anthonywj 3 years ago
parent 5655e6a1aa
commit 15586eb805

@ -1,130 +1,130 @@
<template> <template>
<div> <div>
<el-card> <el-card>
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini"> <el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input <el-input
v-model="filterQuery.name" v-model="filterQuery.name"
placeholder="业务类型" placeholder="业务类型"
style="width: 400px" style="width: 400px"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select v-model="filterQuery.thirdSys" placeholder="请选择第三方系统" @change="thirdSysChange"> <el-select v-model="filterQuery.thirdSys" placeholder="请选择第三方系统" @change="thirdSysChange">
<el-option <el-option
v-for="item in thirdSys" v-for="item in thirdSys"
:key="item.value" :key="item.value"
:label="item.thirdName" :label="item.thirdName"
:value="item.thirdId"> :value="item.thirdId">
<span style="float: left">{{ item.thirdName }}</span> <span style="float: left">{{ item.thirdName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.thirdId }}</span> <span style="float: right; color: #8492a6; font-size: 13px">{{ item.thirdId }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button-group style="margin-left: 10px;display:flex;"> <el-button-group style="margin-left: 10px;display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button> <el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="search"></el-button> <el-button type="primary" icon="search" @click="search"></el-button>
<el-button type="primary" icon="search" @click="handleAddClick" <el-button type="primary" icon="search" @click="handleAddClick"
:disabled="!configParms.typeThird" :disabled="!configParms.typeThird"
>新增 >新增
</el-button </el-button
> >
<!-- <el-button type="primary" icon="search" @click="updateDownload"></el-button>--> <!-- <el-button type="primary" icon="search" @click="updateDownload"></el-button>-->
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="loading" :data="list" style="width: 100%"> <el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="序号" type="index" width="55"></el-table-column> <el-table-column label="序号" type="index" width="55"></el-table-column>
<el-table-column label="单据类型名称" prop="name"></el-table-column> <el-table-column label="单据类型名称" prop="name"></el-table-column>
<el-table-column label="单据类型代码" prop="action"></el-table-column> <el-table-column label="单据类型代码" prop="action"></el-table-column>
<el-table-column label="第三方系统" prop="thirdSysName"></el-table-column> <el-table-column label="第三方系统" prop="thirdSysName"></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="操作" width="100" fixed="right"> <el-table-column label="操作" width="100" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
size="small" size="small"
:disabled="!configParms.typeThird" :disabled="!configParms.typeThird"
@click.native.stop="handleModifyClick(scope.row)" @click.native.stop="handleModifyClick(scope.row)"
>编辑 >编辑
</el-button </el-button
> >
<el-button <el-button
type="text" type="text"
size="small" size="small"
:disabled="!configParms.typeThird" :disabled="!configParms.typeThird"
@click.native.stop="handleDeleteClick(scope.row)" @click.native.stop="handleDeleteClick(scope.row)"
>删除 >删除
</el-button </el-button
> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog <el-dialog
title="新增第三方单据类型" title="新增第三方单据类型"
:visible.sync="addDialogVisible" :visible.sync="addDialogVisible"
width="70%" width="70%"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
v-if="addDialogVisible" v-if="addDialogVisible"
> >
<modifyDialog :inputQuery="inputQuery"></modifyDialog> <modifyDialog :inputQuery="inputQuery"></modifyDialog>
<div style="text-align: center"> <div style="text-align: center">
<el-button type="primary" size="small" icon="search" @click="onAddSubmit" <el-button type="primary" size="small" icon="search" @click="onAddSubmit"
:disabled="!configParms.typeThird" :disabled="!configParms.typeThird"
>提交 >提交
</el-button </el-button
> >
<el-button type="primary" size="small" icon="search" @click="cancelDialog" <el-button type="primary" size="small" icon="search" @click="cancelDialog"
>取消 >取消
</el-button </el-button
> >
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
title="编辑第三方单据类型" title="编辑第三方单据类型"
:visible.sync="modifyDialogVisible" :visible.sync="modifyDialogVisible"
width="70%" width="70%"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
v-if="modifyDialogVisible" v-if="modifyDialogVisible"
> >
<modifyDialog :inputQuery="inputQuery"></modifyDialog> <modifyDialog :inputQuery="inputQuery"></modifyDialog>
<div style="text-align: center"> <div style="text-align: center">
<el-button type="primary" size="small" icon="search" @click="onModifySubmit" <el-button type="primary" size="small" icon="search" @click="onModifySubmit"
:disabled="!configParms.typeThird" :disabled="!configParms.typeThird"
>提交 >提交
</el-button </el-button
> >
<el-button type="primary" size="small" icon="search" @click="cancelDialog" <el-button type="primary" size="small" icon="search" @click="cancelDialog"
>取消 >取消
</el-button </el-button
> >
</div> </div>
</el-dialog> </el-dialog>
<el-pagination <el-pagination
:page-size="filterQuery.limit" :page-size="filterQuery.limit"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
layout="prev, pager, next" layout="prev, pager, next"
:total="total" :total="total"
:current-page="filterQuery.page" :current-page="filterQuery.page"
></el-pagination> ></el-pagination>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import { import {
getOriginBusType, getOriginBusType,
updateBussinessType, delBussinessType, updateBussinessType, delBussinessType,
insertBussinessType, downloadBussinessType insertBussinessType, downloadBussinessType
} from "../../api/basic/busOriginType"; } from "../../api/basic/busOriginType";
import modifyDialog from "./BussinessTypeThirdModify"; import modifyDialog from "./BussinessTypeThirdModify";
@ -133,271 +133,278 @@ import {getBasicThirdSys} from "@/api/basic/basicThirdSys";
import {findConfig} from "@/api/thrsys/spsSyncStatus"; import {findConfig} from "@/api/thrsys/spsSyncStatus";
export default { export default {
data() { data() {
return { return {
filterQuery: { filterQuery: {
thirdSys: null, thirdSys: null,
name: "", name: "",
page: 1, page: 1,
limit: 20, limit: 20,
}, },
addDialogVisible: false, addDialogVisible: false,
modifyDialogVisible: false, modifyDialogVisible: false,
list: [], list: [],
inputQuery: { inputQuery: {
action: "", action: "",
name: "", name: "",
enable: "", enable: "",
remark: "", remark: "",
thirdSys: null, thirdSys: null,
thirdSysName: null, thirdSysName: null,
}, },
enableMap: { enableMap: {
true: "是", true: "是",
false: "否", false: "否",
}, },
thirdSys: [], thirdSys: [],
total: 0, total: 0,
multipleSelection: [], multipleSelection: [],
uploadFileUrl: null, uploadFileUrl: null,
loading: false, loading: false,
configParms: {}, configParms: {},
}; };
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
thirdSys: "thirdId",
name: null,
enable: null,
page: 1,
limit: 20,
};
this.getList();
},
cancelDialog() {
this.modifyDialogVisible = false;
this.addDialogVisible = false;
},
search() {
this.filterQuery.page = 1;
this.getList();
},
getList() {
this.loading = true;
getOriginBusType(this.filterQuery)
.then((response) => {
this.loading = false;
this.list = response.data.list || [];
if (this.list.length > 0) {
this.list.forEach(item => {
this.thirdSys.forEach(third => {
if (item.thirdSys === third.thirdId) {
item.thirdSysName = third.thirdName;
}
})
})
}
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
}, },
getBasicThirdSys() {
let query = {
enabled: true,
};
getBasicThirdSys(query)
.then((response) => {
this.thirdSys = response.data.list || [];
this.filterQuery.thirdSys = this.thirdSys[0].thirdId;
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
updateDownload() {
let query = {
thirdSys: this.filterQuery.thirdSys,
}
downloadBussinessType(query)
.then((response) => {
this.loading = false;
this.getList();
})
.catch(() => {
this.loading = false;
});
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
onAddSubmit() {
if (this.$isBlank(this.inputQuery.name)) { methods: {
this.$message.error("单据类型名称不能为空!"); onReset() {
return; this.$router.push({
} path: "",
if (this.$isBlank(this.inputQuery.action)) { });
this.$message.error("单据类型代码不能为空!"); this.filterQuery = {
return; thirdSys: "thirdId",
} name: null,
if (this.$isBlank(this.inputQuery.thirdSys)) { enable: null,
this.$message.error("所属系统不不能为空!"); page: 1,
return; limit: 20,
} };
let numRegExp = '^[0-9]*$';
let numReg = new RegExp(numRegExp);
if (numReg.test(this.inputQuery.name)) {
this.$message.error("单据类型名称不得为纯数字类型!");
return;
}
insertBussinessType(this.inputQuery)
.then((response) => {
this.loading = false;
this.cancelDialog();
this.getList(); this.getList();
}) },
.catch(() => { cancelDialog() {
this.loading = false; this.modifyDialogVisible = false;
this.cancelDialog(); this.addDialogVisible = false;
}); },
}, search() {
this.filterQuery.page = 1;
onModifySubmit() {
if (this.$isBlank(this.inputQuery.name)) {
this.$message.error("单据类型名称不能为空!");
return;
}
if (this.$isBlank(this.inputQuery.action)) {
this.$message.error("单据类型代码不能为空!");
return;
}
if (this.$isBlank(this.inputQuery.thirdSys)) {
this.$message.error("所属系统不不能为空!");
return;
}
updateBussinessType(this.inputQuery)
.then((response) => {
this.loading = false;
this.cancelDialog();
this.getList(); this.getList();
}) },
.catch(() => { getList() {
this.loading = false; this.loading = true;
this.cancelDialog(); getOriginBusType(this.filterQuery)
}); .then((response) => {
}, this.loading = false;
this.list = response.data.list || [];
if (this.list.length > 0) {
this.list.forEach(item => {
this.thirdSys.forEach(third => {
if (item.thirdSys === third.thirdId) {
item.thirdSysName = third.thirdName;
}
})
})
}
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
getBasicThirdSys() {
let query = {
enabled: true,
};
getBasicThirdSys(query)
.then((response) => {
this.thirdSys = response.data.list || [];
this.filterQuery.thirdSys = this.thirdSys[0].thirdId;
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
updateDownload() {
let query = {
thirdSys: this.filterQuery.thirdSys,
}
downloadBussinessType(query)
.then((response) => {
this.loading = false;
this.getList();
})
.catch(() => {
this.loading = false;
});
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
handleModifyClick(row) { onAddSubmit() {
this.inputQuery = { if (this.$isBlank(this.inputQuery.name)) {
id: row.id, this.$message.error("单据类型名称不能为空!");
remark: row.remark, return;
action: row.action, }
name: row.name, if (this.$isBlank(this.inputQuery.action)) {
enable: row.enable, this.$message.error("单据类型代码不能为空!");
thirdSys: row.thirdSys, return;
thirdSysName: row.thirdSysName }
}; if (this.$isBlank(this.inputQuery.thirdSys)) {
this.modifyDialogVisible = true; this.$message.error("所属系统不不能为空!");
}, return;
}
let numRegExp = '^[0-9]*$';
let numReg = new RegExp(numRegExp);
if (numReg.test(this.inputQuery.name)) {
this.$message.error("单据类型名称不得为纯数字类型!");
return;
}
insertBussinessType(this.inputQuery)
.then((response) => {
handleDeleteClick(row) { if (response.code == 20000) {
this.deleteDialog(row.id) this.loading = false;
}, this.cancelDialog();
this.getList();
handleAddClick() { } else {
this.inputQuery = { this.$message.error(response.message);
action: "", }
name: "",
enable: "",
remark: "",
thirdSys: null,
thirdSysName: null
};
this.addDialogVisible = true;
},
deleteDialog(rowId) { })
this.$confirm("此操作将永久删除该单据类型信息, 是否继续?", "提示", { .catch(() => {
confirmButtonText: "确定", this.loading = false;
cancelButtonText: "取消", this.cancelDialog();
type: "warning", });
}) },
.then(() => {
let query = { onModifySubmit() {
id: rowId, if (this.$isBlank(this.inputQuery.name)) {
this.$message.error("单据类型名称不能为空!");
return;
}
if (this.$isBlank(this.inputQuery.action)) {
this.$message.error("单据类型代码不能为空!");
return;
}
if (this.$isBlank(this.inputQuery.thirdSys)) {
this.$message.error("所属系统不不能为空!");
return;
} }
delBussinessType(query) updateBussinessType(this.inputQuery)
.then((response) => { .then((response) => {
this.getList(); this.loading = false;
this.cancelDialog();
this.getList();
}) })
.catch(() => { .catch(() => {
this.loading = false;
this.cancelDialog();
}); });
},
handleModifyClick(row) {
}) this.inputQuery = {
.catch(() => { id: row.id,
}); remark: row.remark,
}, action: row.action,
name: row.name,
enable: row.enable,
thirdSys: row.thirdSys,
thirdSysName: row.thirdSysName
};
this.modifyDialogVisible = true;
},
thirdSysChange() {
this.getList();
},
init() { handleDeleteClick(row) {
axios.get("./config.json").then(res => { this.deleteDialog(row.id)
// },
let response = res.data.BASE_URL;
this.uploadFileUrl = response + "udiwms/busstiness/file/upload"; handleAddClick() {
}); this.inputQuery = {
action: "",
name: "",
enable: "",
remark: "",
thirdSys: null,
thirdSysName: null
};
this.addDialogVisible = true;
},
deleteDialog(rowId) {
this.$confirm("此操作将永久删除该单据类型信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let query = {
id: rowId,
}
delBussinessType(query)
.then((response) => {
this.getList();
})
.catch(() => {
});
})
.catch(() => {
});
},
thirdSysChange() {
this.getList();
},
init() {
axios.get("./config.json").then(res => {
//
let response = res.data.BASE_URL;
this.uploadFileUrl = response + "udiwms/busstiness/file/upload";
});
},
handleChange(response, files, fileList) {
console.log(response);
if (response.code != 20000) {
this.$message.error(response.message);
} else {
// console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success(response.data);
this.getList();
}
},
getSyncConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configParms = response.data;
}
})
.catch(() => {
});
},
}, },
handleChange(response, files, fileList) { components: {
console.log(response); modifyDialog,
if (response.code != 20000) {
this.$message.error(response.message);
} else {
// console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success(response.data);
this.getList();
}
}, },
getSyncConfig() { mounted() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configParms = response.data;
}
})
.catch(() => {
});
}, },
}, created() {
components: { this.init();
modifyDialog, this.getSyncConfig();
}, this.getBasicThirdSys();
mounted() { this.getList();
},
created() {
this.init();
this.getSyncConfig();
this.getBasicThirdSys();
this.getList();
}, },
}; };
</script> </script>

Loading…
Cancel
Save