Browse Source

feat(qc): 将工厂编码输入框改为下拉选择并添加验证

- 将 qcFamilyAttribute.vue 中的工厂编码输入框改为下拉选择组件
- 将 qcItem.vue 中的工厂编码输入框改为下拉选择组件
- 将 qcMethod.vue 中的工厂编码输入框改为下拉选择组件
- 将 qcPartAttribute.vue 中的工厂编码输入框改为下拉选择组件
- 将 qcTemplate.vue 中的工厂编码输入框改为下拉选择组件
- 添加对工厂列表的获取和展示功能
- 为工厂编码字段添加必填验证规则
- 在表单提交前验证工厂编码是否已选择
- 为弹窗组件添加 append-to-body 属性以正确显示层级
master
qiankanghui 3 days ago
parent
commit
86a9f35521
  1. 26
      src/views/modules/qc/qcFamilyAttribute.vue
  2. 22
      src/views/modules/qc/qcItem.vue
  3. 22
      src/views/modules/qc/qcMethod.vue
  4. 28
      src/views/modules/qc/qcPartAttribute.vue
  5. 35
      src/views/modules/qc/qcTemplate.vue

26
src/views/modules/qc/qcFamilyAttribute.vue

@ -113,7 +113,14 @@
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="工厂编码:" prop="site" :rules="rules.site">
<el-input v-model="modalData.site" disabled style="width: 240px"></el-input>
<el-select v-model="modalData.site" placeholder="请选择" :disabled="modalDisableFlag" style="width: 240px">
<el-option
v-for = "i in factoryList"
:key = "i.baseData"
:label = "i.baseDesc"
:value = "i.baseData">
</el-option>
</el-select>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
@ -586,6 +593,7 @@
inspectionTypeSearch,
getSiteAndBuByUserName
} from "@/api/qc/qc.js"
import {getFactory} from "@/api/factory.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import qcUpload from "./qc_upload";
@ -793,6 +801,7 @@
itemListRow1: {},
itemListRow2: {},
options: [],
factoryList: [],
tempProgrammeRow: '',
itemSelections1: [],
itemSelections2: [],
@ -871,6 +880,8 @@
// this.favoriteIsOk()
// 获取检验类型
this.inspectionTypeSearch()
// 获取工厂列表
this.getFactoryList()
if (!this.authSearch) {
// 获取数据列表
this.getDataList()
@ -902,6 +913,15 @@
})
},
// 获取工厂列表
getFactoryList () {
getFactory().then(({data}) => {
if (data.code === 0) {
this.factoryList = data.list
}
})
},
chooseLevel (row) {
this.tempLevelRow = row
this.getBaseList(208)
@ -1024,6 +1044,10 @@
// this.$message.warning('请选择BU!')
// return
// }
if (this.modalData.site === '' || this.modalData.site == null) {
this.$message.warning('请选择工厂编码!')
return
}
if (this.modalData.familyID === '' || this.modalData.familyID == null) {
this.$message.warning('请选择物料分类编码!')
return

22
src/views/modules/qc/qcItem.vue

@ -123,7 +123,14 @@
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="工厂编码" prop="site" :rules="rules.site">
<el-input v-model="modalData.site" disabled style="width: 143px"></el-input>
<el-select v-model="modalData.site" placeholder="请选择" :disabled="modalDisableFlag" style="width: 143px">
<el-option
v-for = "i in factoryList"
:key = "i.baseData"
:label = "i.baseDesc"
:value = "i.baseData">
</el-option>
</el-select>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
@ -435,6 +442,7 @@
deleteItemObject, // 删除项目设备
updateItemObject, // 修改项目设备
} from "@/api/qc/qc.js"
import {getFactory} from "@/api/factory.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
@ -892,6 +900,7 @@
]
},
options: [],
factoryList: [],
methodData: {
site: '',
bu: '',
@ -976,6 +985,8 @@
// this.favoriteIsOk()
// 获取检验类型
this.inspectionTypeSearch()
// 获取工厂列表
this.getFactoryList()
// 动态列
// this.getTableUserColumn(this.$route.meta.menuId+'table',1)
if (this.authSearch) {
@ -1219,6 +1230,15 @@
})
},
// 获取工厂列表
getFactoryList () {
getFactory().then(({data}) => {
if (data.code === 0) {
this.factoryList = data.list
}
})
},
// 列表方法的回调
getBaseData (val) {
if (this.tagNo === 1036) {

22
src/views/modules/qc/qcMethod.vue

@ -122,7 +122,14 @@
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="工厂编码:" prop="site" :rules="rules.site">
<el-input v-model="modalData.site" disabled style="width: 221px"></el-input>
<el-select v-model="modalData.site" placeholder="请选择" :disabled="modalDisableFlag" style="width: 221px">
<el-option
v-for = "i in factoryList"
:key = "i.baseData"
:label = "i.baseDesc"
:value = "i.baseData">
</el-option>
</el-select>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
@ -163,6 +170,7 @@
inspectionTypeSearch, // 搜索所有检验类型
getSiteAndBuByUserName
} from "@/api/qc/qc.js"
import {getFactory} from "@/api/factory.js"
import {getTableDefaultListLanguage, getTableUserListLanguage,updateColumnSize} from "@/api/table.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import qcUpload from "./qc_upload"
@ -407,6 +415,7 @@
]
},
options: [],
factoryList: [],
userBuList: [],
authSearch: false,
authSave: false,
@ -431,6 +440,8 @@
// this.favoriteIsOk()
// 获取检验类型
this.inspectionTypeSearch()
// 获取工厂列表
this.getFactoryList()
// 动态列
this.getTableUserColumn(this.$route.meta.menuId+'table',1)
if (!this.authSearch) {
@ -601,6 +612,15 @@
}
},
// 获取工厂列表
getFactoryList () {
getFactory().then(({data}) => {
if (data.code === 0) {
this.factoryList = data.list
}
})
},
// 查询检验类型
inspectionTypeSearch () {
let tempData = {

28
src/views/modules/qc/qcPartAttribute.vue

@ -149,7 +149,7 @@
</el-pagination>
<!-- 物料属性新增/修改 -->
<el-dialog title="物料属性设置" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="430px">
<el-dialog title="物料属性设置" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="430px" append-to-body>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<!-- <el-form-item label="BU" prop="bu" :rules="rules.bu">-->
<!-- <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 295px">-->
@ -165,8 +165,15 @@
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="工厂编码:" prop="partDesc" :rules="rules.site">
<el-input v-model="modalData.site" disabled style="width: 184px"></el-input>
<el-form-item label="工厂编码:" prop="site" :rules="rules.site">
<el-select v-model="modalData.site" placeholder="请选择" :disabled="modalDisableFlag" style="width: 184px">
<el-option
v-for = "i in factoryList"
:key = "i.baseData"
:label = "i.baseDesc"
:value = "i.baseData">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="partNo" :rules="rules.partNoType">
<span v-if="modalDisableFlag === false" slot="label" @click="searchPartInfo()"><a herf="#">物料编码:</a></span>
@ -912,7 +919,7 @@
</el-dialog>
<!-- 物料编码 -->
<el-dialog title="物料选择" @close="closeDialog" :close-on-click-modal="false" v-drag :visible.sync="partDisableFlag" width="685px" height="273px">
<el-dialog title="物料选择" @close="closeDialog" :close-on-click-modal="false" v-drag :visible.sync="partDisableFlag" width="685px" height="273px" append-to-body>
<el-form :inline="true" label-position="top" :model="partDetailData" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="物料编码">
<el-input v-model="partDetailData.partNo" clearable style="width: 137px"></el-input>
@ -1077,6 +1084,7 @@
getPatrolOperationDescList as getPatrolOperationDescListApi,
getPartAttributeFileList
} from "@/api/qc/qc.js"
import {getFactory} from "@/api/factory.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {downLoadObjectFile} from '@/api/eam/eam_object_list.js'
@ -1909,6 +1917,7 @@
tempLevelRow: '',
tempProgrammeRow: '',
options: [],
factoryList: [],
itemSelections1: [],
itemSelections2: [],
rules: {
@ -2104,6 +2113,8 @@
// this.favoriteIsOk()
// 获取检验类型
this.inspectionTypeSearch()
// 获取工厂列表
this.getFactoryList()
// 动态列
// this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
// this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
@ -2161,6 +2172,15 @@
})
},
// 获取工厂列表
getFactoryList () {
getFactory().then(({data}) => {
if (data.code === 0) {
this.factoryList = data.list
}
})
},
isIPQCInspectionType (row) {
const name = (row && row.inspectionTypeName) ? String(row.inspectionTypeName) : ''
const no = (row && row.inspectionTypeNo) ? String(row.inspectionTypeNo) : ''

35
src/views/modules/qc/qcTemplate.vue

@ -125,8 +125,15 @@
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="工厂编码">
<el-input v-model="modalData.site" disabled style="width: 221px"></el-input>
<el-form-item label="工厂编码" prop="site" :rules="rules.site">
<el-select v-model="modalData.site" placeholder="请选择" :disabled="modalDisableFlag" style="width: 221px">
<el-option
v-for = "i in factoryList"
:key = "i.baseData"
:label = "i.baseDesc"
:value = "i.baseData">
</el-option>
</el-select>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
@ -529,6 +536,7 @@
goUpItemQC, // 上移项目位置
goDownItemQC,// 下移项目位置
} from "@/api/qc/qc.js"
import {getFactory} from "@/api/factory.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
@ -562,6 +570,7 @@
limit: 10,
},
options: [],
factoryList: [],
objects: [],
height: 200,
pageIndex: 1,
@ -1004,6 +1013,13 @@
},
rules: {
site: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
templateNameType: [
{
required: true,
@ -1061,6 +1077,8 @@
// this.favoriteIsOk()
// 获取检验类型
this.inspectionTypeSearch()
// 获取工厂列表
this.getFactoryList()
// 动态列
// this.getTableUserColumn(this.$route.meta.menuId+'table',1)
if (!this.authSearch) {
@ -1228,6 +1246,15 @@
})
},
// 获取工厂列表
getFactoryList () {
getFactory().then(({data}) => {
if (data.code === 0) {
this.factoryList = data.list
}
})
},
// 查询设备
objectSearch () {
let tempData = {
@ -1422,6 +1449,10 @@
},
saveData () {
if (this.modalData.site === '' || this.modalData.site == null) {
this.$message.warning('请选择工厂编码!')
return
}
if (this.modalData.templateName === '' || this.modalData.templateName == null) {
this.$message.warning('请输入检验模板名称!')
return

Loading…
Cancel
Save