基础数据-镀种维护--镀种分类支持远程搜索

dev-scheduling
ysn 2 days ago
parent 448c4e8bb4
commit 2913c5d42e
  1. 246
      src/views/processManagement/platingTypeInfo.vue

@ -28,12 +28,12 @@
<template #bsBasicClass.name="scope"> <template #bsBasicClass.name="scope">
<span> <span>
{{ scope.row.bsBasicClass ? scope.row.bsBasicClass.name : "-" }} {{ scope.row.bsBasicClass ? scope.row.bsBasicClass.name : '-' }}
</span> </span>
</template> </template>
<template #subclass.bpsName="scope"> <template #subclass.bpsName="scope">
<span> <span>
{{ scope.row.subclass ? scope.row.subclass.bpsName : "-" }} {{ scope.row.subclass ? scope.row.subclass.bpsName : '-' }}
</span> </span>
</template> </template>
<template #name="{ row }"> <template #name="{ row }">
@ -47,29 +47,38 @@
</template> </template>
</avue-crud> </avue-crud>
<!-- 导入 --> <!-- 导入 -->
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport" <basic-import
v-if="isShowImport"
title="导入"
:isShow="isShowImport"
templateUrl="/blade-desk/BA/Plating/downloadExcelTemplate" templateUrl="/blade-desk/BA/Plating/downloadExcelTemplate"
templateName="镀种维护模板.xls" templateName="镀种维护模板.xls"
importUrl="/blade-desk/BA/Plating/importExcel" importUrl="/blade-desk/BA/Plating/importExcel"
@closeDialog="closeDialog"></basic-import> @closeDialog="closeDialog"
></basic-import>
</basic-container> </basic-container>
</template> </template>
<script> <script>
import { getLazyList, remove, update, add, getMenu } from "@/api/system/menu"; import { getLazyList, remove, update, add, getMenu } from '@/api/system/menu';
import {getPlatingTypeList,createPlatingType,updatePlatingType,deletePlatingType} from "@/api/basicData/platingTypeInfo" import {
getPlatingTypeList,
createPlatingType,
updatePlatingType,
deletePlatingType,
} from '@/api/basicData/platingTypeInfo';
import { mapGetters } from "vuex"; import { mapGetters } from 'vuex';
import { import {
getQueryAllCaList, getQueryAllCaList,
getQueryAllCaDeatils, getQueryAllCaDeatils,
getQueryAllCaSave, getQueryAllCaSave,
getQueryAllCaDel, getQueryAllCaDel,
} from "@/api/processManagement/processCapability"; } from '@/api/processManagement/processCapability';
import { getDictionary } from "@/api/system/dict"; import { getDictionary } from '@/api/system/dict';
import basicImport from '@/components/basic-import/main.vue' import basicImport from '@/components/basic-import/main.vue';
export default { export default {
components: { components: {
basicImport basicImport,
}, },
data() { data() {
return { return {
@ -78,7 +87,7 @@ export default {
query: {}, query: {},
loading: true, loading: true,
selectionList: [], selectionList: [],
parentId: "", parentId: '',
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -90,15 +99,15 @@ export default {
menuBtn: false, menuBtn: false,
column: [ column: [
{ {
label: "", label: '',
prop: "wtName", prop: 'wtName',
type: "select", type: 'select',
filterable: true, filterable: true,
props: { props: {
label: "dictValue", label: 'dictValue',
value: "dictKey", value: 'dictKey',
}, },
dicUrl: "/blade-system/dict/dictionary?code=ProcessCapabilityType", dicUrl: '/blade-system/dict/dictionary?code=ProcessCapabilityType',
}, },
], ],
}, },
@ -106,12 +115,12 @@ export default {
columnSort: true, columnSort: true,
// size: "medium", // size: "medium",
tip: false, tip: false,
height: "auto", height: 'auto',
calcHeight: 32, calcHeight: 32,
simplePage: false, simplePage: false,
searchShow: true, searchShow: true,
searchMenuSpan: 6, searchMenuSpan: 6,
dialogWidth: "60%", dialogWidth: '60%',
border: true, border: true,
selection: true, selection: true,
viewBtn: true, viewBtn: true,
@ -120,28 +129,28 @@ export default {
dialogClickModal: false, dialogClickModal: false,
excelBtn: true, excelBtn: true,
viewBtn: false, viewBtn: false,
addBtnIcon: " ", addBtnIcon: ' ',
viewBtnIcon: " ", viewBtnIcon: ' ',
delBtnIcon: " ", delBtnIcon: ' ',
editBtnIcon: " ", editBtnIcon: ' ',
editBtnText: "编辑", editBtnText: '编辑',
refreshBtn: false, refreshBtn: false,
searchShowBtn: false, searchShowBtn: false,
gridBtn: false, gridBtn: false,
searchIndex: 3, searchIndex: 3,
searchIcon: true, searchIcon: true,
searchLabelPosition: "left", searchLabelPosition: 'left',
searchLabelPosition: "left", searchLabelPosition: 'left',
searchGutter: 24, searchGutter: 24,
searchSpan: 6, searchSpan: 6,
menuAlign: "left", menuAlign: 'left',
gridBtn: false, gridBtn: false,
searchMenuPosition: "right", searchMenuPosition: 'right',
align: "center", align: 'center',
column: [ column: [
{ {
label: "配置码", label: '配置码',
prop: "configNo", prop: 'configNo',
search: true, search: true,
sortable: true, sortable: true,
width: 120, width: 120,
@ -149,36 +158,39 @@ export default {
rules: [ rules: [
{ {
required: true, required: true,
message: "请输入配置码", message: '请输入配置码',
trigger: "blur", trigger: 'blur',
}, },
], ],
}, },
{ {
label: "镀种分类", label: '镀种分类',
prop: "bcId", prop: 'bcId',
sortable: true, sortable: true,
search: true, search: true,
width: 200, width: 200,
type: "select", type: 'select',
filterable: true, filterable: true,
remote: true,
props: { props: {
label: "name", label: "name",
value: "id", value: "id",
desc:"code",
res:"data.records"
}, },
dicUrl: "/blade-desk/BA/BasicClazz/listForSelectPlatingAssort", dicUrl: '/api/blade-desk/BA/BasicClazz/list?current=1&size=9999&descs=CODE&name={{key}}',
// dicUrl: "/blade-desk/BA/BasicClazz/listForSelectPlatingAssort",
rules: [ rules: [
{ {
required: true, required: true,
message: "请选择镀种分类", message: '请选择镀种分类',
trigger: "click", trigger: 'click',
}, },
], ],
}, },
{ {
label: "镀种", label: '镀种',
prop: "plating", prop: 'plating',
sortable: true, sortable: true,
search: true, search: true,
width: 200, width: 200,
@ -186,14 +198,14 @@ export default {
rules: [ rules: [
{ {
required: true, required: true,
message: "请输入镀种", message: '请输入镀种',
trigger: "click", trigger: 'click',
}, },
], ],
}, },
{ {
label: "镀层代码", label: '镀层代码',
prop: "matCode", prop: 'matCode',
sortable: true, sortable: true,
search: false, search: false,
width: 200, width: 200,
@ -201,8 +213,8 @@ export default {
rules: [ rules: [
{ {
required: false, required: false,
message: "请输入镀层代码", message: '请输入镀层代码',
trigger: "click", trigger: 'click',
}, },
], ],
}, },
@ -228,8 +240,8 @@ export default {
// ], // ],
// }, // },
{ {
label: "材料", label: '材料',
prop: "material", prop: 'material',
width: 200, width: 200,
sortable: true, sortable: true,
search: true, search: true,
@ -237,42 +249,42 @@ export default {
rules: [ rules: [
{ {
required: false, required: false,
message: "请输入材料", message: '请输入材料',
trigger: "click", trigger: 'click',
}, },
], ],
}, },
{ {
label: "材料状态", label: '材料状态',
prop: "matState", prop: 'matState',
sortable: true, sortable: true,
search: false, search: false,
width: 200, width: 200,
rules: [ rules: [
{ {
required: false, required: false,
message: "请输入材料状态", message: '请输入材料状态',
trigger: "click", trigger: 'click',
}, },
], ],
}, },
{ {
label: "硬度", label: '硬度',
prop: "hardness", prop: 'hardness',
sortable: true, sortable: true,
search: true, search: true,
width: 120, width: 120,
rules: [ rules: [
{ {
required: false, required: false,
message: "请输入硬度", message: '请输入硬度',
trigger: "click", trigger: 'click',
}, },
], ],
}, },
{ {
label: "镀层代号", label: '镀层代号',
prop: "plateCode", prop: 'plateCode',
sortable: true, sortable: true,
search: false, search: false,
width: 120, width: 120,
@ -280,42 +292,42 @@ export default {
rules: [ rules: [
{ {
required: false, required: false,
message: "请输入镀层代号", message: '请输入镀层代号',
trigger: "click", trigger: 'click',
}, },
], ],
}, },
{ {
label: "物料编码", label: '物料编码',
prop: "plateGoodsCode", prop: 'plateGoodsCode',
sortable: true, sortable: true,
search: false, search: false,
width: 120, width: 120,
rules: [ rules: [
{ {
required: false, required: false,
message: "请输入物料编码", message: '请输入物料编码',
trigger: "click", trigger: 'click',
}, },
], ],
}, },
{ {
label: "镀层厚度", label: '镀层厚度',
prop: "plateThickness", prop: 'plateThickness',
sortable: true, sortable: true,
search: false, search: false,
width: 120, width: 120,
rules: [ rules: [
{ {
required: false, required: false,
message: "请输入镀层厚度", message: '请输入镀层厚度',
trigger: "click", trigger: 'click',
}, },
], ],
}, },
{ {
label: "其他要求", label: '其他要求',
prop: "memo", prop: 'memo',
sortable: true, sortable: true,
search: false, search: false,
overHidden: true, overHidden: true,
@ -323,15 +335,15 @@ export default {
rules: [ rules: [
{ {
required: false, required: false,
message: "请输入其他要求", message: '请输入其他要求',
trigger: "click", trigger: 'click',
}, },
], ],
}, },
{ {
label: "是否用于周期性试验", label: '是否用于周期性试验',
prop: "flagCycleTest", prop: 'flagCycleTest',
type: "switch", type: 'switch',
sortable: true, sortable: true,
search: false, search: false,
width: 200, width: 200,
@ -353,7 +365,7 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(["userInfo", "permission"]), ...mapGetters(['userInfo', 'permission']),
permissionList() { permissionList() {
return { return {
addBtn: this.validData(this.permission.menu_add, false), addBtn: this.validData(this.permission.menu_add, false),
@ -364,21 +376,21 @@ export default {
}, },
ids() { ids() {
let ids = []; let ids = [];
this.selectionList.forEach((ele) => { this.selectionList.forEach(ele => {
ids.push(ele.id); ids.push(ele.id);
}); });
return ids.join(","); return ids.join(',');
}, },
}, },
methods: { methods: {
// //
handleImport() { handleImport() {
this.isShowImport = true this.isShowImport = true;
}, },
closeDialog(val) { closeDialog(val) {
this.isShowImport = false this.isShowImport = false;
if (val) { if (val) {
this.onLoad() this.onLoad();
} }
}, },
initData() { initData() {
@ -389,7 +401,7 @@ export default {
}, },
handleAdd(row) { handleAdd(row) {
this.parentId = row.id; this.parentId = row.id;
const column = this.findObject(this.option.column, "parentId"); const column = this.findObject(this.option.column, 'parentId');
column.value = row.id; column.value = row.id;
column.addDisabled = true; column.addDisabled = true;
this.$refs.crud.rowAdd(); this.$refs.crud.rowAdd();
@ -398,27 +410,27 @@ export default {
rowSave(row, done, loading) { rowSave(row, done, loading) {
let params = { let params = {
...row, ...row,
flagCycleTest:row.flagCycleTest == '' ? 0 : row.flagCycleTest flagCycleTest: row.flagCycleTest == '' ? 0 : row.flagCycleTest,
} };
console.log('row-----------',row) console.log('row-----------', row);
createPlatingType(params).then(res => { createPlatingType(params).then(res => {
if (res.data.code === 200) { if (res.data.code === 200) {
this.$message.success('新增成功'); this.$message.success('新增成功');
this.onLoad() this.onLoad();
done() done();
} }
}); });
}, },
// //
rowUpdate(row, index, done, loading) { rowUpdate(row, index, done, loading) {
console.log('row-----------',row) console.log('row-----------', row);
updatePlatingType(row).then(res => { updatePlatingType(row).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success('修改成功'); this.$message.success('修改成功');
this.onLoad() this.onLoad();
done() done();
} }
}) });
// update(row).then( // update(row).then(
// () => { // () => {
// this.$message({ // this.$message({
@ -435,17 +447,17 @@ export default {
// ); // );
}, },
rowDel(row, index, done) { rowDel(row, index, done) {
this.$confirm("确定将选择数据删除?", { this.$confirm('确定将选择数据删除?', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning", type: 'warning',
}).then(() => { }).then(() => {
deletePlatingType({ ids: row.id }).then(res => { deletePlatingType({ ids: row.id }).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success('删除成功') this.$message.success('删除成功');
this.onLoad() this.onLoad();
} }
}) });
}); });
}, },
// //
@ -472,19 +484,19 @@ export default {
}, },
// beforeOpen // beforeOpen
beforeOpen(done, type) { beforeOpen(done, type) {
if (["add"].includes(type)) { if (['add'].includes(type)) {
this.form.flagCycleTest = 0 this.form.flagCycleTest = 0;
} }
if (["edit", "view"].includes(type)) { if (['edit', 'view'].includes(type)) {
this.form.bcId = this.form.bcId + '' this.form.bcId = this.form.bcId + '';
} }
done(); done();
}, },
// beforeClose // beforeClose
beforeClose(done) { beforeClose(done) {
this.parentId = ""; this.parentId = '';
const column = this.findObject(this.option.column, "parentId"); const column = this.findObject(this.option.column, 'parentId');
column.value = ""; column.value = '';
column.addDisabled = false; column.addDisabled = false;
done(); done();
}, },
@ -506,16 +518,16 @@ export default {
getPlatingTypeList({ getPlatingTypeList({
current: this.page.currentPage, current: this.page.currentPage,
size: this.page.pageSize, size: this.page.pageSize,
...this.query ...this.query,
}).then(res => { }).then(res => {
res.data.data.records.map(item => { res.data.data.records.map(item => {
item.bcId = item.bcId + '' item.bcId = item.bcId + '';
item.subClass = item.subClass + '' item.subClass = item.subClass + '';
}) });
this.data = res.data.data.records this.data = res.data.data.records;
this.page.total = res.data.data.total this.page.total = res.data.data.total;
this.loading = false; this.loading = false;
}) });
// // getLazyList(this.parentId, Object.assign(params, this.query)).then(res => { // // getLazyList(this.parentId, Object.assign(params, this.query)).then(res => {
// // this.data = res.data.data; // // this.data = res.data.data;

Loading…
Cancel
Save