Merge branch 'dev-scheduling' of http://42.192.7.176:3000/suojin/jonhon-mes-web into dev-scheduling

dev-scheduling
zhangdi 17 hours ago
commit 5efbd7ca93
  1. 12
      src/views/equiptManagement/workwearManagement/columnData.js
  2. 3
      src/views/oem/oemCustomer/index.vue
  3. 121
      src/views/processManagement/platingTypeInfo.vue

@ -108,8 +108,8 @@ export const feiBaOption = {
selection: true,
viewBtn: false,
delBtn: false,
labelWidth: 120,
searchLabelWidth: 120,
labelWidth: 80,
searchLabelWidth: 80,
menuWidth: 80,
menuAlign:"center",
dialogWidth: 600,
@ -123,7 +123,7 @@ export const feiBaOption = {
searchLabelPosition: "left",
searchGutter: 24,
searchSpan: 6,
menuAlign: "left",
menuAlign: "center",
gridBtn: false,
searchMenuPosition: "right",
addBtnIcon: " ",
@ -191,8 +191,8 @@ export const rackOption = {
selection: true,
viewBtn: false,
delBtn: false,
labelWidth: 120,
searchLabelWidth: 120,
labelWidth: 80,
searchLabelWidth: 80,
menuWidth: 80,
menuAlign:"center",
dialogWidth: 600,
@ -206,7 +206,7 @@ export const rackOption = {
searchLabelPosition: "left",
searchGutter: 24,
searchSpan: 6,
menuAlign: "left",
menuAlign: "center",
gridBtn: false,
searchMenuPosition: "right",
addBtnIcon: " ",

@ -160,7 +160,6 @@ export default {
sortable: true,
search: true,
overHidden: true,
width: 120,
rules: [
{
required: true,
@ -176,7 +175,6 @@ export default {
search: false,
overHidden: true,
hide: true,
width: 120,
rules: [
{
required: true,
@ -191,7 +189,6 @@ export default {
sortable: true,
search: false,
overHidden: true,
width: 260,
rules: [
{
required: true,

@ -17,6 +17,7 @@
@on-load="onLoad"
@row-save="rowSave"
@row-update="rowUpdate"
:before-open="beforeOpen"
>
<template #menu-left> </template>
@ -25,7 +26,24 @@
<el-button type="primary" @click="handleImport">导入</el-button>
</span>
</template>
<template #bcId="{ row }">
{{ row.bcName }}
</template>
<template #bcId-form="{ type }">
<span v-show="type == 'edit' || type == 'add'">
<el-select v-model="form.bcId" placeholder="请选择镀种分类" filterable
remote
reserve-keyword
:remote-method="remoteMethod">
<el-option
v-for="item in bcIdData"
:key="item.id"
:value="item.id"
:label="item.name"
/>
</el-select>
</span>
</template>
<template #bsBasicClass.name="scope">
<span>
{{ scope.row.bsBasicClass ? scope.row.bsBasicClass.name : '-' }}
@ -75,6 +93,7 @@ import {
getQueryAllCaDel,
} from '@/api/processManagement/processCapability';
import { getDictionary } from '@/api/system/dict';
import { getList } from '@/api/basicData/platingAssort';
import basicImport from '@/components/basic-import/main.vue';
export default {
components: {
@ -93,6 +112,7 @@ export default {
currentPage: 1,
total: 0,
},
bcIdData: [],
formOption: {
menuSpan: 12,
enter: true,
@ -173,13 +193,13 @@ export default {
filterable: true,
remote: true,
props: {
label: "name",
value: "id",
desc:"code",
res:"data.records"
label: 'name',
value: 'id',
desc: 'code',
res: 'data.records',
},
dicUrl: '/api/blade-desk/BA/BasicClazz/list?current=1&size=9999&descs=CODE&name={{key}}',
// dicUrl: "/blade-desk/BA/BasicClazz/listForSelectPlatingAssort",
dicUrl:
'/api/blade-desk/BA/BasicClazz/list?current=1&size=9999&descs=CODE&name={{key}}',
rules: [
{
required: true,
@ -483,12 +503,35 @@ export default {
this.$refs.crud.toggleSelection();
},
// beforeOpen
beforeOpen(done, type) {
if (['add'].includes(type)) {
this.form.flagCycleTest = 0;
}
if (['edit', 'view'].includes(type)) {
this.form.bcId = this.form.bcId + '';
async beforeOpen(done, type, loading) {
try {
// 1.
await this.remoteMethod('');
// 2.
if (['add'].includes(type)) {
this.form.flagCycleTest = 0;
}
// 3. / bcId 500
if (['edit', 'view'].includes(type)) {
const currentId = (this.form.bcId || '').toString().trim();
const currentName = this.form.bcName || '-'; //
// id
if (currentId) {
const hasItem = this.bcIdData.some(item => item.id == currentId);
console.log('hasItem =', hasItem);
if (!hasItem) {
//
this.bcIdData.unshift({
id: currentId,
name: currentName,
});
}
}
//
this.form.bcId = currentId;
}
} catch (err) {
console.error('加载镀种分类失败', err);
}
done();
},
@ -512,22 +555,48 @@ export default {
refreshChange() {
this.onLoad(this.page, this.query);
},
async remoteMethod(query) {
const res = await getList({ current: 1, size: 9999, descs: 'CODE',name:query })
this.bcIdData = res.data.data.records || []
},
// ID Promise
getBcName(id) {
if (!id) return Promise.resolve('-');
return getList({
current: 1,
size: 1,
id_equal: id,
descs: 'CODE',
})
.then(res => {
return res.data?.data?.records?.[0]?.name || id;
})
.catch(() => id);
},
//
//
onLoad(page, params = {}) {
async onLoad(page, params = {}) {
this.loading = true;
getPlatingTypeList({
current: this.page.currentPage,
size: this.page.pageSize,
...this.query,
}).then(res => {
res.data.data.records.map(item => {
item.bcId = item.bcId + '';
item.subClass = item.subClass + '';
try {
const res = await getPlatingTypeList({
current: this.page.currentPage,
size: this.page.pageSize,
...this.query,
});
this.data = res.data.data.records;
let list = res.data.data.records;
// bcName
await Promise.all(
list.map(async item => {
item.bcId = item.bcId + '';
item.subClass = item.subClass + '';
item.bcName = await this.getBcName(item.bcId); //
console.log('item.bcName =', item.bcName); //
})
);
this.data = list;
this.page.total = res.data.data.total;
this.loading = false;
});
} catch (e) {}
this.loading = false;
// // getLazyList(this.parentId, Object.assign(params, this.query)).then(res => {
// // this.data = res.data.data;
@ -1018,4 +1087,4 @@ export default {
},
},
};
</script>
</script>
Loading…
Cancel
Save