修改bug

This commit is contained in:
zds
2022-08-05 11:56:16 +08:00
parent b63f9af2af
commit 1632830ff8
6 changed files with 99 additions and 38 deletions

View File

@@ -47,10 +47,11 @@ export function submit2(data) {
})
}
export function getDevices() {
export function getDevices(params) {
return request({
url: 'api/producetask/getDevices',
method: 'get'
method: 'get',
params
})
}

View File

@@ -39,12 +39,13 @@
<el-button slot="append" icon="el-icon-search" @click="queryMater" />
</el-input>
</el-form-item>
<el-form-item label="系列" prop="product_series_id">
<el-form-item label="产线系列" prop="product_series_id">
<el-select
v-model="form.product_series_id"
placeholder=""
style="width: 210px"
class="filter-item"
@change="storChange"
>
<el-option
v-for="item in XLList"
@@ -101,7 +102,6 @@
<el-input v-model="form.remark" style="width: 480px;" rows="3" type="textarea" :disabled="crud.status.view > 0" />
</el-form-item>
</el-form>
<DeviceDialog :dialog-show.sync="dtlShow" @tableChanged="tableChanged" />
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @tableChanged2="tableChanged2" />
<span slot="footer" class="dialog-footer">
<el-button slot="left" type="info" @click="crud.cancelCU">关闭</el-button>
@@ -112,7 +112,6 @@
<script>
import CRUD, { crud, form } from '@crud/crud'
import DeviceDialog from '@/views/wms/pub/DeviceDialog'
import MaterDialog from '@/views/wms/pub/MaterDialog'
import workorder from '@/api/wms/pdm/workorder'
import crudseriesProcessRoute from '@/api/wms/pdm/seriesProcessRoute'
@@ -123,7 +122,6 @@ const defaultForm = {
plan_code: '',
material_code: '',
material_id: '',
device_name: '',
device_id: '',
plan_org_code: '',
plan_org_name: '',
@@ -137,7 +135,7 @@ const defaultForm = {
}
export default {
name: 'AddDialog',
components: { DeviceDialog, MaterDialog },
components: { MaterDialog },
mixins: [crud(), form(defaultForm)],
props: {
dialogShow: {
@@ -175,7 +173,7 @@ export default {
{ required: true, message: '产品不能为空', trigger: 'blur' }
],
product_series_id: [
{ required: true, message: '系列不能为空', trigger: 'blur' }
{ required: true, message: '产线系列不能为空', trigger: 'blur' }
],
product_weight: [
{ required: true, message: '重量不能为空', trigger: 'blur' }
@@ -208,17 +206,30 @@ export default {
async queryMater(index, row) {
this.materShow = true
},
storChange(row) {
this.form.device_id = ''
producetask.getDevices({ product_series_id: row }).then(res => {
this.Devices = res
if (this.Devices.length > 0) {
this.form.device_id = this.Devices[0].id
}
})
},
tableChanged2(row) {
this.form.material_id = row.material_id
this.form.material_code = row.material_code
this.form.product_series_id = row.product_series
this.form.weight_unit_id = row.base_unit_id
this.form.weight_unit_name = row.base_unit_id_name
this.form.pcsn = ''
},
tableChanged(row) {
this.form.device_id = row.device_id
this.form.device_name = row.device_name
this.form.product_weight = row.standard_weight_pft
producetask.getDevices({ product_series_id: row.product_series }).then(res => {
this.Devices = res
if (this.Devices.length > 0) {
this.form.device_id = this.Devices[0].id
} else {
this.form.device_id = ''
}
})
},
[CRUD.HOOK.beforeSubmit]() {
}