| | |
| | | const fileName = this.currentFile.fileName || this.fileUrl.split('/').pop().split('?')[0] |
| | | let state = /\.(jpg|jpeg|png|gif)$/i.test(fileName) |
| | | this.imgUrl = this.fileUrl |
| | | console.log("文件名:", fileName, "是否图片:", state) |
| | | // console.log("文件名:", fileName, "是否图片:", state) |
| | | return state; |
| | | }, |
| | | isPdf() { |
| | |
| | | this.bindPartFirst(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: '车间绑定', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.bindWokshop1(row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.objectType != '原辅料' && row.objectType != '包材' |
| | | } |
| | | }, |
| | | // { |
| | | // name: '车间绑定', |
| | | // type: 'text', |
| | | // clickFun: (row) => { |
| | | // this.bindWokshop1(row); |
| | | // }, |
| | | // disabled: (row) => { |
| | | // return row.objectType != '原辅料' && row.objectType != '包材' |
| | | // } |
| | | // }, |
| | | ] |
| | | } |
| | | ], |
| | |
| | | productColumn: [ |
| | | { label: '产品名称', prop: 'name' }, |
| | | { label: '产品名称EN', prop: 'nameEn' }, |
| | | { label: '车间名称', prop: 'workShopName' }, |
| | | // { label: '车间名称', prop: 'workShopName' }, |
| | | { |
| | | dataType: 'action', |
| | | label: '操作', |
| | |
| | | this.getDicts("product_classification").then((response) => { |
| | | this.productClassification = this.dictToValue(response.data); |
| | | }); |
| | | this.selectWorkShop() |
| | | // this.selectWorkShop() |
| | | }, |
| | | computed: { |
| | | title() { |
| | |
| | | // 产品维护 |
| | | upProduct(row) { |
| | | this.currentObj = row; |
| | | if (this.currentObj.objectType == '原辅料') { |
| | | if (this.productColumn.length < 4) { |
| | | this.productColumn.splice(2, 0, { label: '车间名称', prop: 'workShopName' }) |
| | | } |
| | | } else { |
| | | if (this.productColumn.length == 4) { |
| | | this.productColumn.splice(2, 1) |
| | | } |
| | | } |
| | | // if (this.currentObj.objectType == '原辅料') { |
| | | // if (this.productColumn.length < 4) { |
| | | // this.productColumn.splice(2, 0, { label: '车间名称', prop: 'workShopName' }) |
| | | // } |
| | | // } else { |
| | | // if (this.productColumn.length == 4) { |
| | | // this.productColumn.splice(2, 1) |
| | | // } |
| | | // } |
| | | this.diaProduct = true |
| | | this.objectId = row.id |
| | | this.productPage.current = 1 |
| | |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="车间:" prop="objectType" v-if="editForm.objectType == '原辅料' || editForm.objectType == '包材'"> |
| | | <el-select v-model="editForm.workShopId" placeholder="请选择" size="small"> |
| | | <el-option v-for="item in workshopList" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="closeDia">取 消</el-button> |
| | |
| | | |
| | | import { obtainItemParameterList } from "@/api/structural/laboratoryScope"; |
| | | import { addTestObject, upTestObject } from "@/api/structural/capability"; |
| | | import { selectWorkShop } from "@/api/structural/workshop.js" |
| | | |
| | | export default { |
| | | name: "EditForm", |
| | |
| | | specimenNameEn: '', // 检验对象EN |
| | | // code: '', // 对象代号 |
| | | objectType: '', // 对象类型 |
| | | workShopId: '',//车间 |
| | | }, |
| | | laboratoryList: [], |
| | | editFormRules: { |
| | |
| | | objectType: [ |
| | | { required: true, message: '请输入对象类型', trigger: 'change' } |
| | | ], |
| | | workShopId: [ |
| | | { required: true, message: '请选择车间', trigger: 'change' } |
| | | ], |
| | | }, |
| | | operationType: '' |
| | | operationType: '', |
| | | workshopList: [] |
| | | } |
| | | }, |
| | | // 方法集合 |
| | | methods: { |
| | | selectWorkShop() { |
| | | selectWorkShop({ size: -1, current: -1 }).then(res => { |
| | | this.workshopList = res.data.records |
| | | }) |
| | | }, |
| | | openDia(type, row) { |
| | | this.operationType = type |
| | | this.obtainItemParameterList() |
| | | this.selectWorkShop() |
| | | this.editFormDia = true |
| | | if (type === 'add') { |
| | | this.resetForm("editForm"); |
| | | this.editForm = {} |
| | | } else { |
| | | this.editForm = { ...row } |
| | | } |
| | |
| | | this.$refs.editForm.validate(valid => { |
| | | if (valid) { |
| | | this.editLoad = true |
| | | if (this.editForm.objectType != '原辅料' && this.editForm.objectType != '包材') { |
| | | this.editForm.workShopId = '' |
| | | } |
| | | this.editForm.workShopName = this.editForm.workShopId ? this.workshopList.find(m => m.id == this.editForm.workShopId).name : '' |
| | | if (this.editForm.id) { |
| | | // 修改 |
| | | upTestObject(this.editForm).then(res => { |