工艺代码提交

dev-scheduling
zhangdi 3 weeks ago
parent 1e37274850
commit 29ddfc7133
  1. 254
      src/views/inboundOutboundManagement/binTransfer/components/addEditDialog.vue
  2. 20
      src/views/orderManagement/components/exception/dataMissing.vue
  3. 206
      src/views/processManagement/components/processMainte/dsPartBasicInfo.vue
  4. 140
      src/views/processManagement/components/processMainte/processPlanning.vue
  5. 5
      src/views/warehouseManagement/components/borrowDialog.vue
  6. 2
      src/views/warehouseManagement/materialMaintenance.vue
  7. 2
      src/views/warehouseManagement/teamRequest/components/addEditDialog.vue

@ -19,26 +19,23 @@
</template> </template>
<template #default="scope"> <template #default="scope">
<!-- prop 格式数组名[索引].字段名 --> <!-- prop 格式数组名[索引].字段名 -->
<el-form-item :prop="`tableData[${scope.$index}].location`" :rules="formRules.location"> <el-form-item :prop="`tableData[${scope.$index}].location`" :rules="formRules.location" style="margin-top: 14px">
<el-select <jhSelect
v-model="scope.row.goodsId" v-model="scope.row.goodsId"
placeholder="请选择" placeholder="请搜索选择"
style="width: 100%; margin-top: 15px" api-url="/api/blade-wms/combox/config/goodsOut"
remote echo-api="/api/blade-wms/combox/config/goodsOut"
:remote-method="remoteMethodGoods" echoParamsKey="ids"
:loading="loading" echo-method="get"
reserve-keyword api-method="get"
clearable list-key="records"
filterable total-key="total"
@change="val => changeGoods(val, scope.$index)" label-key="goodsCodeAndGoodsName"
> value-key="goodsId"
<el-option search-key="filterValue"
v-for="item in goodsData" :debounce-time="500"
:key="item.goodsId" @change="(value, item) => changeGoods(value, item, scope.$index)"
:value="item.goodsId" />
:label="item.goodsCodeAndGoodsName"
></el-option>
</el-select>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -59,10 +56,7 @@
<span><i style="color: red">*</i>新库房号</span> <span><i style="color: red">*</i>新库房号</span>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-form-item <el-form-item :prop="`tableData[${scope.$index}].newShId`" :rules="formRules.newShId">
:prop="`tableData[${scope.$index}].newShId`"
:rules="formRules.newShId"
>
<el-select <el-select
v-model="scope.row.newShId" v-model="scope.row.newShId"
placeholder="请选择" placeholder="请选择"
@ -90,21 +84,22 @@
<!-- remote <!-- remote
:remote-method="remoteMethodLocation" --> :remote-method="remoteMethodLocation" -->
<template #default="scope"> <template #default="scope">
<el-form-item <el-form-item :prop="`tableData[${scope.$index}].newSlId`" :rules="formRules.newSlId">
:prop="`tableData[${scope.$index}].newSlId`"
:rules="formRules.newSlId"
>
<el-select <el-select
v-model="scope.row.newSlId" v-model="scope.row.newSlId"
placeholder="请选择" placeholder="请选择"
style="width: 100%; margin-top: 15px" style="width: 100%; margin-top: 15px"
:loading="loading" :loading="loading"
reserve-keyword reserve-keyword
clearable clearable
filterable filterable
> >
<el-option v-for="item in locationData" :key="item.id" :value="item.id" :label="item.location"></el-option> <el-option
v-for="item in locationData"
:key="item.id"
:value="item.id"
:label="item.location"
></el-option>
</el-select> </el-select>
<!-- <el-input style="margin-top: 15px" v-model="scope.row.newSlId" disabled></el-input> --> <!-- <el-input style="margin-top: 15px" v-model="scope.row.newSlId" disabled></el-input> -->
</el-form-item> </el-form-item>
@ -113,10 +108,7 @@
<!-- 旧库房号绑定数组字段 --> <!-- 旧库房号绑定数组字段 -->
<el-table-column align="center" label="旧库房号"> <el-table-column align="center" label="旧库房号">
<template #default="scope"> <template #default="scope">
<el-form-item <el-form-item :prop="`tableData[${scope.$index}].shName`" :rules="formRules.shName">
:prop="`tableData[${scope.$index}].shName`"
:rules="formRules.shName"
>
<el-input style="margin-top: 15px" v-model="scope.row.shName" disabled></el-input> <el-input style="margin-top: 15px" v-model="scope.row.shName" disabled></el-input>
</el-form-item> </el-form-item>
</template> </template>
@ -124,10 +116,7 @@
<!-- 旧库位号绑定数组字段 --> <!-- 旧库位号绑定数组字段 -->
<el-table-column align="center" label="旧库位号"> <el-table-column align="center" label="旧库位号">
<template #default="scope"> <template #default="scope">
<el-form-item <el-form-item :prop="`tableData[${scope.$index}].location`" :rules="formRules.location">
:prop="`tableData[${scope.$index}].location`"
:rules="formRules.location"
>
<el-input style="margin-top: 15px" v-model="scope.row.location" disabled></el-input> <el-input style="margin-top: 15px" v-model="scope.row.location" disabled></el-input>
</el-form-item> </el-form-item>
</template> </template>
@ -139,17 +128,18 @@
:prop="`tableData[${scope.$index}].specifications`" :prop="`tableData[${scope.$index}].specifications`"
:rules="formRules.specifications" :rules="formRules.specifications"
> >
<el-input style="margin-top: 15px" v-model="scope.row.specifications" disabled></el-input> <el-input
style="margin-top: 15px"
v-model="scope.row.specifications"
disabled
></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<!-- 批次号绑定数组字段 --> <!-- 批次号绑定数组字段 -->
<el-table-column align="center" label="批次号"> <el-table-column align="center" label="批次号">
<template #default="scope"> <template #default="scope">
<el-form-item <el-form-item :prop="`tableData[${scope.$index}].piNo`" :rules="formRules.piNo">
:prop="`tableData[${scope.$index}].piNo`"
:rules="formRules.piNo"
>
<el-input style="margin-top: 15px" v-model="scope.row.piNo" disabled></el-input> <el-input style="margin-top: 15px" v-model="scope.row.piNo" disabled></el-input>
</el-form-item> </el-form-item>
</template> </template>
@ -157,10 +147,7 @@
<!-- 库存数量绑定数组字段 --> <!-- 库存数量绑定数组字段 -->
<el-table-column align="center" label="库存数量"> <el-table-column align="center" label="库存数量">
<template #default="scope"> <template #default="scope">
<el-form-item <el-form-item :prop="`tableData[${scope.$index}].quantity`" :rules="formRules.quantity">
:prop="`tableData[${scope.$index}].quantity`"
:rules="formRules.quantity"
>
<el-input style="margin-top: 15px" v-model="scope.row.quantity" disabled></el-input> <el-input style="margin-top: 15px" v-model="scope.row.quantity" disabled></el-input>
</el-form-item> </el-form-item>
</template> </template>
@ -177,8 +164,8 @@
</template> </template>
<script> <script>
import {getGoodsOutList,addTransfer} from '@/api/storeManagement/binTransfer.js' import { getGoodsOutList, addTransfer } from '@/api/storeManagement/binTransfer.js';
import {getWareList,getLocationList} from "@/api/storeManagement/warehouseMaintenance.js" import { getWareList, getLocationList } from '@/api/storeManagement/warehouseMaintenance.js';
import { add } from '@/api/system/menu'; import { add } from '@/api/system/menu';
export default { export default {
props: { props: {
@ -195,12 +182,12 @@ export default {
return { return {
openShow: false, openShow: false,
warehouseData: [], warehouseData: [],
locationData:[], locationData: [],
formError:'', formError: '',
form: { form: {
tableData: [], tableData: [],
}, },
goodsData:[], goodsData: [],
formRules: { formRules: {
// 1 // 1
tableData: [ tableData: [
@ -208,7 +195,7 @@ export default {
required: true, required: true,
message: '请至少添加一行数据', message: '请至少添加一行数据',
trigger: 'submit', trigger: 'submit',
type: 'array' // type: 'array', //
}, },
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
@ -218,101 +205,94 @@ export default {
callback(); callback();
} }
}, },
trigger: 'submit' trigger: 'submit',
} },
], ],
// wcId // wcId
goodsCode: [ goodsCode: [{ required: true, message: '请选择物料编码', trigger: ['change', 'submit'] }],
{ required: true, message: '请选择物料编码', trigger: ['change', 'submit'] } newShId: [{ required: true, message: '请选择新库房号', trigger: ['change', 'submit'] }],
], newSlId: [{ required: true, message: '请选择新库位号', trigger: ['change', 'submit'] }],
newShId:[
{ required: true, message: '请选择新库房号', trigger: ['change', 'submit'] }
],
newSlId:[
{ required: true, message: '请选择新库位号', trigger: ['change', 'submit'] }
]
}, },
loading:false, loading: false,
}; };
}, },
mounted() { mounted() {
this.openShow = this.showDialog; this.openShow = this.showDialog;
}, },
methods: { methods: {
remoteMethodGoods(query){ remoteMethodGoods(query) {
console.log('query==========',query) console.log('query==========', query);
if (query) { if (query) {
console.log('1111111111111') console.log('1111111111111');
this.loading = true this.loading = true;
getGoodsOutList({ getGoodsOutList({
goodsCode:query goodsCode: query,
}).then(res =>{ }).then(res => {
this.goodsData = res.data.data.records; this.goodsData = res.data.data.records;
this.loading = false this.loading = false;
}) });
}else{ } else {
console.log('222222222222222') console.log('222222222222222');
this.loading = true this.loading = true;
getGoodsOutList({ getGoodsOutList({
current:1, current: 1,
size:9999 size: 9999,
}).then(res =>{ }).then(res => {
this.goodsData = res.data.data.records; this.goodsData = res.data.data.records;
this.loading = false this.loading = false;
}) });
} }
console.log('goods==============',this.goodsData) console.log('goods==============', this.goodsData);
}, },
remoteMethodWare(query){ remoteMethodWare(query) {
if(query){ if (query) {
this.loading = true this.loading = true;
getWareList({ getWareList({
warehouseCode:query warehouseCode: query,
}).then(res =>{ }).then(res => {
this.warehouseData = res.data.data.records; this.warehouseData = res.data.data.records;
this.loading = false this.loading = false;
}) });
}else{ } else {
this.loading = true this.loading = true;
getWareList().then(res =>{ getWareList().then(res => {
this.warehouseData = res.data.data.records; this.warehouseData = res.data.data.records;
this.loading = false this.loading = false;
}) });
} }
}, },
changeGoods(val,index){ changeGoods(val, item, index) {
let tmp = this.goodsData.find(item => item.goodsId == val) let tmp = item;
this.form.tableData[index].rlsId = tmp.id this.form.tableData[index].rlsId = tmp.id;
this.form.tableData[index].goodsName = tmp.goodsName this.form.tableData[index].goodsName = tmp.goodsName;
this.form.tableData[index].location = tmp.location this.form.tableData[index].location = tmp.location;
this.form.tableData[index].shName = tmp.shName this.form.tableData[index].shName = tmp.shName;
this.form.tableData[index].specifications = tmp.specifications this.form.tableData[index].specifications = tmp.specifications;
this.form.tableData[index].piNo = tmp.piNo this.form.tableData[index].piNo = tmp.piNo;
this.form.tableData[index].quantity = tmp.quantity this.form.tableData[index].quantity = tmp.quantity;
this.form.tableData[index].oldSlId = tmp.slId this.form.tableData[index].oldSlId = tmp.slId;
this.form.tableData[index].oldShId = tmp.shId this.form.tableData[index].oldShId = tmp.shId;
}, },
changeWare(val,index){ changeWare(val, index) {
this.form.tableData[index].newSlId = '' this.form.tableData[index].newSlId = '';
this.remoteMethodLocation(val) this.remoteMethodLocation(val);
}, },
remoteMethodLocation(val){ remoteMethodLocation(val) {
if(val){ if (val) {
this.loading = true this.loading = true;
getLocationList({ getLocationList({
shId:val shId: val,
}).then(res =>{ }).then(res => {
this.locationData = res.data.data.records; this.locationData = res.data.data.records;
this.loading = false this.loading = false;
}) });
}else{ } else {
this.loading = true this.loading = true;
getLocationList().then(res =>{ getLocationList().then(res => {
this.locationData = res.data.data.records; this.locationData = res.data.data.records;
this.loading = false this.loading = false;
}) });
} }
}, },
selectChange(list, row) { selectChange(list, row) {
row._select = !row._select; row._select = !row._select;
@ -340,18 +320,18 @@ export default {
}, },
closeDialog(val) { closeDialog(val) {
this.openShow = false; this.openShow = false;
this.$emit('closeDialog',val); this.$emit('closeDialog', val);
// //
this.form.tableData = []; this.form.tableData = [];
this.formError = ''; this.formError = '';
this.$refs.tableForm?.resetFields(); this.$refs.tableForm?.resetFields();
}, },
submitForm(){ submitForm() {
this.formError = ''; this.formError = '';
console.log('table----------------',this.form.tableData) console.log('table----------------', this.form.tableData);
if(this.form.tableData.length === 0){ if (this.form.tableData.length === 0) {
this.formError = '请至少填写一条数据'; this.formError = '请至少填写一条数据';
return return;
} }
// Form // Form
this.$refs.tableForm.validate((isValid, invalidFields) => { this.$refs.tableForm.validate((isValid, invalidFields) => {
@ -371,24 +351,26 @@ export default {
// //
const submitData = this.form.tableData.map(row => { const submitData = this.form.tableData.map(row => {
const { _select, const {
_select,
// goodsCode,goodsName, // goodsCode,goodsName,
// location,materialModel,piNo,quantity, // location,materialModel,piNo,quantity,
// shName,specifications, // shName,specifications,
...validData } = row; // ...validData
} = row; //
return validData; return validData;
}); });
console.log('submitData---------------',submitData) console.log('submitData---------------', submitData);
addTransfer(submitData).then(res =>{ addTransfer(submitData).then(res => {
if(res.data.code === 200){ if (res.data.code === 200) {
this.$message.success('新增成功') this.$message.success('新增成功');
this.closeDialog(true) this.closeDialog(true);
}
})
})
}
} }
});
});
},
},
}; };
</script> </script>

@ -46,6 +46,9 @@
<el-tag class="ml-2" type="danger" v-if="row.curStatusText == '无工艺'">{{ <el-tag class="ml-2" type="danger" v-if="row.curStatusText == '无工艺'">{{
row.curStatusText row.curStatusText
}}</el-tag> }}</el-tag>
</template>
<template #validationMomo="{ row }">
<el-text class="mx-1" type="danger">{{ row.validationMomo }}</el-text>
</template> </template>
<template #menu="{ row }"> <template #menu="{ row }">
<el-button type="primary" text @click="editData(row)" v-if="permission.missing_data_edit">修改</el-button> <el-button type="primary" text @click="editData(row)" v-if="permission.missing_data_edit">修改</el-button>
@ -346,6 +349,23 @@ export default {
align: 'center', align: 'center',
column: [ column: [
{
label: '异常原因',
prop: 'validationMomo',
search: true,
sortable: 'custom',
width: 240,
span: 12,
headerAlign: 'center',
align: 'center',
rules: [
{
required: true,
message: '请输入计划单号',
trigger: 'blur',
},
],
},
{ {
label: '计划单号', label: '计划单号',
prop: 'ypCode', prop: 'ypCode',

@ -500,30 +500,72 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span style="font-size: 16px">子件信息</span> <span style="font-size: 16px">子件信息</span>
</div> </div>
<avue-crud <el-table :data="data" @select="selectChange" border >
:option="option" <el-table-column type="index" width="50" label="#" align="center"></el-table-column>
:table-loading="loading" <el-table-column align="center" label="零件号" prop="partCode" width="180">
:data="data" <template #default="scope">
v-model="form" <el-input v-model="scope.row.partCode" placeholder="请输入" />
v-model:page="page" </template>
ref="crud" </el-table-column>
<el-table-column align="center" prop="partName" label="零件名称"> </el-table-column>
<el-table-column align="center" prop="productType" label="产品型号"> </el-table-column>
<el-table-column align="center" prop="quota" label="数量" width="140">
<template #default="scope">
<el-input-number
v-model="scope.row.quota"
:min="0"
controls-position="right"
placeholder="请输入"
/>
</template>
</el-table-column>
<el-table-column align="center" prop="area" label="面积(d㎡)" width="140">
<template #default="scope">
<el-input-number
v-model="scope.row.area"
:min="0"
controls-position="right"
placeholder="请输入"
/>
</template>
</el-table-column>
<el-table-column align="center" prop="totalArea" label="总面积"> </el-table-column>
<el-table-column align="center" prop="sinTerType" label="零件类型">
<template #default="scope">
<el-select
v-model="scope.row.sinTerType"
placeholder="请选择"
style="width: 100%"
filterable
clearable
> >
<template #isElectroplating-form="{ row, disabled }"> <el-option label="插针" :value="1"> </el-option>
<el-form-item label="子件编号:" prop="partCode"> <el-option label="壳体" :value="2"> </el-option>
<el-option label="石墨模" :value="5"> </el-option>
<el-option label="自制玻璃饼" :value="3"> </el-option>
<el-option label="其他" :value="4"> </el-option>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" prop="isElectroplating" label="是否电镀">
<template #default="scope">
<el-select <el-select
v-model="row.isElectroplating" v-model="scope.row.isElectroplating"
placeholder="请选择" placeholder="请选择"
style="width: 250px" style="width: 100%"
v-if="!(row.sinTerType != 1 && row.partName.indexOf('A1') < 0)" v-if="!(scope.row.sinTerType != 1 && scope.row.partName.indexOf('A1') < 0)"
filterable filterable
clearable clearable
> >
<el-option label="是" value="1"> </el-option> <el-option label="是" value="1"> </el-option>
<el-option label="否" value="0"> </el-option> <el-option label="否" value="0"> </el-option>
</el-select> </el-select>
</el-form-item> <span v-else>-</span>
</template> </template>
</avue-crud> </el-table-column>
<el-table-column align="center" prop="updateUserStr" label="修改人"> </el-table-column>
<el-table-column align="center" prop="updateTime" label="修改时间"> </el-table-column>
</el-table>
</el-card> </el-card>
</div> </div>
</template> </template>
@ -634,143 +676,7 @@ export default {
}, },
submitLoading: false, submitLoading: false,
data: [], data: [],
option: {
tip: false,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
dialogWidth: '60%',
border: true,
selection: false,
viewBtn: true,
menuWidth: 240,
dialogClickModal: false,
excelBtn: true,
viewBtn: false,
editBtnText: '编辑',
refreshBtn: false,
searchShowBtn: false,
gridBtn: false,
menu: false,
header: false,
index: true,
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
gridBtn: false,
searchMenuPosition: 'right',
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
align: 'center',
column: [
{
label: '零件号',
prop: 'partCode',
search: false,
sortable: true,
overHidden: true,
cell: true,
width: 180,
},
{
label: '零件名称',
prop: 'partName',
search: false,
sortable: true,
overHidden: true,
},
{
label: '产品型号',
prop: 'productType',
search: false,
sortable: true,
overHidden: true,
},
{
label: '数量',
prop: 'quota',
search: false,
sortable: true,
overHidden: true,
cell: true,
},
{
label: '面积(d㎡)',
prop: 'area',
search: false,
sortable: true,
overHidden: true,
cell: true,
},
{
label: '总面积',
prop: 'totalArea',
cell: false,
search: false,
sortable: true,
overHidden: true,
},
{
label: '零件类型',
prop: 'sinTerType',
search: false,
sortable: true,
overHidden: true,
type: 'select',
filterable: true,
clearable: true,
cell: true,
dicData: [
{
label: '插针',
value: 1,
},
{
label: '壳体',
value: 2,
},
{
label: '石墨模',
value: 5,
},
{
label: '自制玻璃饼',
value: 3,
},
{
label: '其他',
value: 4,
},
],
},
{
label: '是否电镀',
prop: 'isElectroplating',
cell: true,
search: false,
sortable: true,
overHidden: true,
},
{
label: '修改人',
prop: 'updateUserStr',
search: false,
sortable: true,
overHidden: true,
},
{
label: '修改时间',
prop: 'updateTime',
search: false,
sortable: true,
overHidden: true,
},
],
},
partType: '', partType: '',
loading: false, loading: false,
plateList: [], // plateList: [], //

@ -114,7 +114,6 @@
style="width: 220px; margin-right: 12px" style="width: 220px; margin-right: 12px"
clearable clearable
filterable filterable
:filter-method="handleFilter"
></el-cascader> ></el-cascader>
<el-button type="primary" @click="modelLevelChange()" :loading="modelLevelLoading" <el-button type="primary" @click="modelLevelChange()" :loading="modelLevelLoading"
@ -390,11 +389,6 @@
</template> </template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`tableData3[${scope.$index}].mtId`" :rules="formRules3.mtId"> <el-form-item :prop="`tableData3[${scope.$index}].mtId`" :rules="formRules3.mtId">
<!-- <el-input
v-model="scope.row.tool"
placeholder="请输入"
style="width: 100%"
></el-input> -->
<jhSelect <jhSelect
v-model="scope.row.mtId" v-model="scope.row.mtId"
placeholder="请搜索选择" placeholder="请搜索选择"
@ -600,7 +594,6 @@ export default {
formRules1: { formRules1: {
ppsId: [{ required: true, message: '请选择', trigger: ['change', 'submit'] }], ppsId: [{ required: true, message: '请选择', trigger: ['change', 'submit'] }],
caId: [{ required: true, message: '请选择', trigger: ['change', 'submit'] }], caId: [{ required: true, message: '请选择', trigger: ['change', 'submit'] }],
// proDes: [{ required: true, message: '', trigger: ['change', 'submit'] }],
isMain: [{ required: true, message: '请选择', trigger: ['change', 'submit'] }], isMain: [{ required: true, message: '请选择', trigger: ['change', 'submit'] }],
processNo: [{ required: true, message: '请输入', trigger: ['change', 'submit'] }], processNo: [{ required: true, message: '请输入', trigger: ['change', 'submit'] }],
}, },
@ -642,6 +635,7 @@ export default {
}, },
cascaderValue: '', cascaderValue: '',
cascaderOptions: [], cascaderOptions: [],
cachedSelectedNodeId: null, // ID
}; };
}, },
@ -679,8 +673,6 @@ export default {
} }
}); });
this.cascaderOptions = data_; this.cascaderOptions = data_;
// this.filteredList = [...this.modelOption];
}); });
}, },
// //
@ -831,26 +823,7 @@ export default {
this.rankList = res.data.data; this.rankList = res.data.data;
}); });
}, },
handleFilter(keyword) {
// 1.
if (!keyword) {
this.filteredList = [...this.modelOption];
return;
}
// 2.
const lowerKeyword = keyword;
// 3. name pinyin
this.filteredList = this.modelOption.filter(item => {
// 1
const matchName = item.name.includes(lowerKeyword);
// 2
const matchPinyin = item.modelNameStr.includes(lowerKeyword);
//
return matchName || matchPinyin;
});
},
// //
async getModelList() { async getModelList() {
await getModelList().then(res => { await getModelList().then(res => {
@ -999,7 +972,7 @@ export default {
updateTreeNode(this.data); updateTreeNode(this.data);
}, },
// //
async getDetails() { async getDetails(shouldRestoreSelection = false) {
this.treeLoading = true; this.treeLoading = true;
let query_ = {}; let query_ = {};
if (!this.updateRow.partVersion) { if (!this.updateRow.partVersion) {
@ -1016,24 +989,79 @@ export default {
rank: this.lastConfirmedRank, rank: this.lastConfirmedRank,
}; };
} }
await getProcessAuthorized(query_)
.then(res => { try {
const res = await getProcessAuthorized(query_);
this.treeLoading = false; this.treeLoading = false;
this.data = this.transformCraftTree(res.data.data); this.data = this.transformCraftTree(res.data.data);
this.partInfoData = res.data.data.partInfo; this.partInfoData = res.data.data.partInfo;
this.$nextTick(() => { this.$nextTick(() => {
this.autoSelectFirstProcess(); //
this.calculateTableHeight(); if (!shouldRestoreSelection && this.data.length > 0) {
const rootNode = this.data[0];
this.handleNodeClick(rootNode, {
level: 1,
parent: { data: null, isRoot: true },
}); });
if (this.partInfoData.partName == '石墨模') { if (this.$refs.tree) {
let graphite = this.modelOption.find(item => item.name == '石墨模'); this.$refs.tree.setCurrentKey(rootNode.id);
this.modelLevel = graphite.id;
this.modelLevelChange();
} }
}) }
.catch(err => { //
else if (shouldRestoreSelection && this.cachedSelectedNodeId) {
this.restoreSelectedNode();
}
this.calculateTableHeight();
});
} catch (err) {
this.treeLoading = false; this.treeLoading = false;
}
},
//
restoreSelectedNode() {
const findAndSelectNode = nodes => {
for (let node of nodes) {
if (node.id === this.cachedSelectedNodeId) {
//
this.handleNodeClick(node, {
level: node.level,
parent: {
data: this.getParentNode(this.data, node.id),
isRoot: node.level === 1,
},
});
//
this.$nextTick(() => {
if (this.$refs.tree) {
this.$refs.tree.setCurrentKey(node.id);
}
}); });
return true;
}
if (node.children && node.children.length > 0) {
if (findAndSelectNode(node.children)) return true;
}
}
return false;
};
findAndSelectNode(this.data);
},
//
getParentNode(nodes, targetId, parent = null) {
for (let node of nodes) {
if (node.id === targetId) {
return parent;
}
if (node.children && node.children.length > 0) {
const found = this.getParentNode(node.children, targetId, node);
if (found) return found;
}
}
return null;
}, },
autoSelectFirstProcess() { autoSelectFirstProcess() {
if (!this.data || this.data.length === 0) return; if (!this.data || this.data.length === 0) return;
@ -1133,10 +1161,9 @@ export default {
if (nodes.disabled && node.level !== 1) { if (nodes.disabled && node.level !== 1) {
return false; return false;
} }
// console.log(node.level, nodes, 'node.level');
this.calculateTableHeight(); this.calculateTableHeight();
this.treeLoading = true; this.treeLoading = true;
this.cachedSelectedNodeId = nodes.id;
this.treeNodes = nodes; this.treeNodes = nodes;
const parentNode = node.parent; const parentNode = node.parent;
@ -1145,10 +1172,8 @@ export default {
} }
this.treeLeave = node.level; this.treeLeave = node.level;
// //
this.clearTableData(); this.clearTableData();
// //
if (this.treeLeave === 1) { if (this.treeLeave === 1) {
// 🟢 // 🟢
@ -1255,7 +1280,6 @@ export default {
this.$prompt('请输入零件号', '提示', { this.$prompt('请输入零件号', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
// inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
inputErrorMessage: '零件号正确', inputErrorMessage: '零件号正确',
}) })
.then(({ value }) => { .then(({ value }) => {
@ -1264,7 +1288,6 @@ export default {
partCode: value, partCode: value,
}; };
console.log(9999999, node.data.id);
craftBatchCopy(query).then(res => { craftBatchCopy(query).then(res => {
this.$message.success('复制成功'); this.$message.success('复制成功');
}); });
@ -1626,7 +1649,6 @@ export default {
} }
} }
// //
if (this.treeNodes.rawData.qualityGradeCode) { if (this.treeNodes.rawData.qualityGradeCode) {
let qualityInfo = this.rankList.find( let qualityInfo = this.rankList.find(
@ -1645,7 +1667,7 @@ export default {
.then(res => { .then(res => {
this.$message.success('保存成功'); this.$message.success('保存成功');
this.craftLoading = false; this.craftLoading = false;
this.getDetails(); this.getDetails(true);
}) })
.catch(err => { .catch(err => {
this.craftLoading = false; this.craftLoading = false;
@ -1678,7 +1700,8 @@ export default {
deleteIds: this.form2.deleteIds, //ids deleteIds: this.form2.deleteIds, //ids
}; };
saveProcessProjectSave(query_).then(res => { saveProcessProjectSave(query_)
.then(res => {
this.$message.success('保存成功'); this.$message.success('保存成功');
this.craftLoading = false; this.craftLoading = false;
// //
@ -1687,9 +1710,10 @@ export default {
this.updateTreeNodeProject(); this.updateTreeNodeProject();
this.refreshTableData(); // this.refreshTableData(); //
} }
}).catch(err=>{
this.craftLoading = false;
}) })
.catch(err => {
this.craftLoading = false;
});
} }
}); });
} }
@ -1702,7 +1726,8 @@ export default {
processMeasuringToolEntities: this.form3.tableData3, // processMeasuringToolEntities: this.form3.tableData3, //
deleteIds: this.form3.deleteIds, //ids deleteIds: this.form3.deleteIds, //ids
}; };
saveProcessMeasuringTool(query_).then(res => { saveProcessMeasuringTool(query_)
.then(res => {
this.$message.success('保存成功'); this.$message.success('保存成功');
this.craftLoading = false; this.craftLoading = false;
// //
@ -1711,9 +1736,10 @@ export default {
this.updateTreeNodeProject(); this.updateTreeNodeProject();
this.refreshTableData(); // this.refreshTableData(); //
} }
}).catch(err=>{
this.craftLoading = false;
}) })
.catch(err => {
this.craftLoading = false;
});
} }
}); });
} }
@ -1726,7 +1752,8 @@ export default {
processMoldToolEntities: this.form4.tableData4, // processMoldToolEntities: this.form4.tableData4, //
deleteIds: this.form4.deleteIds, //ids deleteIds: this.form4.deleteIds, //ids
}; };
saveProcessMoldTool(query_).then(res => { saveProcessMoldTool(query_)
.then(res => {
this.$message.success('保存成功'); this.$message.success('保存成功');
this.craftLoading = false; this.craftLoading = false;
// //
@ -1735,9 +1762,10 @@ export default {
this.updateTreeNodeProject(); this.updateTreeNodeProject();
this.refreshTableData(); // this.refreshTableData(); //
} }
}).catch(err=>{
this.craftLoading = false;
}) })
.catch(err => {
this.craftLoading = false;
});
} }
}); });
} }

@ -198,6 +198,7 @@ export default {
this.tableData[index].goodsId = tmp.id this.tableData[index].goodsId = tmp.id
this.tableData[index].unitName = tmp.unitName this.tableData[index].unitName = tmp.unitName
this.tableData[index].materialModel = tmp.materialModel this.tableData[index].materialModel = tmp.materialModel
if(val != ''){
getWarehouseList({ getWarehouseList({
goodsCode:val goodsCode:val
}).then(res =>{ }).then(res =>{
@ -205,6 +206,8 @@ export default {
this.tableData[index].shList = res.data.data this.tableData[index].shList = res.data.data
}) })
} }
}
// let tmp = this.goodsList.find(item => item.goodsCode == val) // let tmp = this.goodsList.find(item => item.goodsCode == val)
@ -231,7 +234,7 @@ export default {
}, },
changePiNo(val,index){ changePiNo(val,index){
let tmp = this.tableData[index].piNoList.find(item => item.piNo == val) let tmp = this.tableData[index].piNoList.find(item => item.piNo == val)
this.tableData[index].stockQuantity = tmp.quantity this.tableData[index].stockQuantity = tmp.usableQuantity
this.tableData[index].rlsId = tmp.id this.tableData[index].rlsId = tmp.id
}, },
getUser(){ getUser(){

@ -352,7 +352,7 @@ export default {
// ], // ],
}, },
{ {
label: '是否用', label: '是否用',
editDisplay: true, editDisplay: true,
prop: 'used', prop: 'used',
type: 'switch', type: 'switch',

@ -36,7 +36,7 @@
total-key="total" total-key="total"
label-key="goodsCode" label-key="goodsCode"
value-key="goodsCode" value-key="goodsCode"
search-key="goodsCode" search-key="filterValue"
:debounce-time="100" :debounce-time="100"
@change="(val, item) => changeGoods(val, item, scope.row, scope.$index)" @change="(val, item) => changeGoods(val, item, scope.row, scope.$index)"
/> />

Loading…
Cancel
Save