1.修复页面校验信息未清除问题

2.修复未选择条码也可以进行删除问题
3.调整仓库字典页面,添加分页插件
master
x_z 3 years ago
parent 07dc8c7ea3
commit 18e5dfb618

@ -192,6 +192,15 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination
:page-size="busQuery.limit"
@current-change="loadBussinessTypeList"
layout="prev, pager, next"
:total="busTotal"
:current-page="busQuery.page"
>
</el-pagination>
</el-card> </el-card>
</div> </div>
@ -217,7 +226,7 @@
<el-pagination <el-pagination
:page-size="addUserQuery.limit" :page-size="addUserQuery.limit"
@current-change="loadUserList" @current-change="getAddUserList"
layout="prev, pager, next" layout="prev, pager, next"
:total="addUserTotal" :total="addUserTotal"
:current-page="addUserQuery.page" :current-page="addUserQuery.page"
@ -257,6 +266,15 @@
<el-table-column label="单据类型名称" prop="name" fixed></el-table-column> <el-table-column label="单据类型名称" prop="name" fixed></el-table-column>
</el-table> </el-table>
<el-pagination
:page-size="bussinessTypeQuery.limit"
@current-change="addBussinessType"
layout="prev, pager, next"
:total="bussinessTypeTotal"
:current-page="bussinessTypeQuery.page"
>
</el-pagination>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click.native="bussinessTypeFormVisible = !bussinessTypeFormVisible" <el-button @click.native="bussinessTypeFormVisible = !bussinessTypeFormVisible"
>取消 >取消
@ -868,24 +886,15 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
loadLinkData(row) { loadLinkData(row) {
let query = {
code: row.code
};
this.currentCode = row.code; this.currentCode = row.code;
this.currentRow = row; this.currentRow = row;
//
warehouseUserList(query).then((res) => {
this.userData = res.data;
}).catch((error) => {
this.$message.error("用户数据加载失败");
});
// this.userQuery.code = this.currentCode;
warehouseBussinessTypeList(query).then((res) => { this.userQuery.page = 1;
this.bussinessTypeData = res.data; this.busQuery.code = this.currentCode;
}).catch((error) => { this.busQuery.page = 1;
this.$message.error("单据类型数据加载失败"); this.loadUserList();
}); this.loadBussinessTypeList();
}, },
getAddUserList(val) { getAddUserList(val) {
this.addUserQuery.page = val; this.addUserQuery.page = val;
@ -908,10 +917,14 @@ export default {
}); });
}); });
}, },
addUser() { addUser(val) {
if (this.currentCode == null || this.currentCode == "") { if (this.currentCode == null || this.currentCode == "") {
this.$message.error("请先选择仓库"); this.$message.error("请先选择仓库");
} else { } else {
if (val === null || val === undefined) {
this.addUserQuery.page = 1;
this.addUserTotal = 0;
}
this.userFormVisible = true; this.userFormVisible = true;
this.getAddUserList(1); this.getAddUserList(1);
} }
@ -920,15 +933,27 @@ export default {
loadUserList(val) { loadUserList(val) {
if (val != null) { if (val != null) {
this.userQuery.page = val; this.userQuery.page = val;
} };
// //
warehouseUserList(this.userQuery).then((res) => { warehouseUserList(this.userQuery).then((res) => {
this.userData = res.data.list; this.userData = res.data.list || [];
this.userTotal = res.data.total; this.userTotal = res.data.total || 0;
}).catch((error) => { }).catch((error) => {
this.$message.error("用户数据加载失败") this.$message.error("用户数据加载失败")
}); });
}, },
loadBussinessTypeList(val) {
if (val != null) {
this.busQuery.page = val;
}
//
warehouseBussinessTypeList(this.busQuery).then((res) => {
this.bussinessTypeData = res.data.list || [];
this.busTotal = res.data.total || 0;
}).catch((error) => {
this.$message.error("单据类型数据加载失败");
});
},
handleUserSelectionChange(row) { handleUserSelectionChange(row) {
let _this = this; let _this = this;
_this.selectUserList = []; _this.selectUserList = [];
@ -958,27 +983,25 @@ export default {
let loadParam = { let loadParam = {
code: this.currentCode code: this.currentCode
}; };
// this.loadUserList();
warehouseUserList(loadParam).then((res) => {
this.userData = res.data;
}).catch((error) => {
});
}).catch((error) => { }).catch((error) => {
this.$message.error("添加失败"); this.$message.error("添加失败");
}); });
}, },
addBussinessType() { addBussinessType(val) {
if (this.currentCode == null || this.currentCode == "") { if (this.currentCode == null || this.currentCode == "") {
this.$message.error("请先选择仓库"); this.$message.error("请先选择仓库");
} else { } else {
this.bussinessTypeFormVisible = true; this.bussinessTypeFormVisible = true;
let query = { if (val === null || val === undefined) {
enabled: true, this.bussinessTypeQuery.page = 1;
customerId: this.$store.getters.customerId } else {
}; this.bussinessTypeQuery.page = val;
getJoinBussinessType(query).then((res) => { }
getJoinBussinessType(this.bussinessTypeQuery).then((res) => {
this.selectBussinessTypeList = []; this.selectBussinessTypeList = [];
this.bussinessTypeList = res.data.list; this.bussinessTypeList = res.data.list || [];
this.bussinessTypeTotal = res.data.total || 0;
var that = this; var that = this;
that.$nextTick(() => { that.$nextTick(() => {
@ -1007,15 +1030,11 @@ export default {
bussinessTypes: JSON.stringify(this.selectBussinessTypeList) bussinessTypes: JSON.stringify(this.selectBussinessTypeList)
}; };
saveWarehouseBussinessType(query).then((res) => { saveWarehouseBussinessType(query).then((res) => {
this.$message.success("添加成功"); if (res.code === 20000) {
// this.$message.success("添加成功");
let loadParam = { //
code: this.currentCode this.loadBussinessTypeList();
}; }
warehouseBussinessTypeList(loadParam).then((res) => {
this.bussinessTypeData = res.data;
}).catch((error) => {
});
}).catch((error) => { }).catch((error) => {
}); });
} }

@ -340,7 +340,9 @@ export default {
// //
resetForm() { resetForm() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["dataForm"].resetFields(); if (this.formName === "add") {
this.$refs["dataForm"].resetFields();
}
this.$refs["dataForm"].clearValidate(); this.$refs["dataForm"].clearValidate();
}); });
}, },
@ -349,23 +351,22 @@ export default {
// //
this.formVisible = !this.formVisible; this.formVisible = !this.formVisible;
// //
this.$refs["dataForm"].resetFields();
return true; return true;
}, },
// //
handleForm(index, row) { handleForm(index, row) {
this.formVisible = true; this.formVisible = true;
this.resetForm(); this.resetForm();
this.formData = JSON.parse(JSON.stringify(formJson));
if (row !== null) {
this.formData = Object.assign({}, row);
}
this.formName = "add"; this.formName = "add";
this.formRules = this.addRules; this.formRules = this.addRules;
if (index !== null) { if (index !== null) {
this.index = index; this.index = index;
this.formName = "edit"; this.formName = "edit";
this.formRules = this.editRules; this.formRules = this.editRules;
this.formData = JSON.parse(JSON.stringify(formJson));
if (row !== null) {
this.formData = Object.assign({}, row);
}
} }
if (this.$store.getters.customerId == 110) { if (this.$store.getters.customerId == 110) {
this.showRole = true; this.showRole = true;

@ -181,6 +181,10 @@ export default {
}, },
deleteDialog() { deleteDialog() {
if (this.multipleSelection.length === 0) {
this.$message.warning("请选择需要删除的条码")
return;
}
this.$confirm("是否删除所选条码?", "提示", { this.$confirm("是否删除所选条码?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -227,11 +231,15 @@ export default {
codes: codeList, codes: codeList,
}; };
deleteCodes(tquery).then((response) => { deleteCodes(tquery).then((response) => {
this.getCodeList(); if (response.code === 20000) {
this.$message({ this.getCodeList();
type: "success", this.$message({
message: "删除成功!", type: "success",
}); message: "删除成功!",
});
} else {
this.$message.error("删除失败!");
}
}); });
}, },

Loading…
Cancel
Save