|
@@ -58,19 +58,20 @@
|
|
|
<el-input-number v-model="tenant[item.identifier]" :disabled="item.readonly == '1' ? true : false" :min="0" :max="999999999"></el-input-number>
|
|
|
</el-form-item>
|
|
|
<!-- 如果是【选择器】-->
|
|
|
- <el-form-item
|
|
|
- v-if="item.identifier == 'zone_id' ? ($store.state.account.user.roles.indexOf('舱体') < 0 || $store.state.account.user.roles.indexOf('框体') < 0) : item.formControlsType == 'select' && item.showStatus == '1'"
|
|
|
+ <el-form-item :ref="item.identifier"
|
|
|
+ v-if="item.formControlsType == 'select' && item.showStatus == '1'"
|
|
|
:key="item.id"
|
|
|
:label="item.fieldName+':'"
|
|
|
:prop="item.identifier"
|
|
|
:rules="{required: item.requireFlag=='1' ? true : false, message: $t('rules.require'), trigger: 'blur'}"
|
|
|
- >
|
|
|
- <el-select v-model="tenant[item.identifier]"
|
|
|
+ v-show="getShow(item)"
|
|
|
+ >
|
|
|
+ <el-select v-model="tenant[item.identifier]"
|
|
|
:disabled=" item.identifier == 'zone_id' ? !zoneEdit:(item.readonly == '1' ? true : false)"
|
|
|
:placeholder='$t("common.pleaseSelect")' filterable style="width: 100%;">
|
|
|
<el-option
|
|
|
v-for="(obj, index) in commList[item.identifier]"
|
|
|
- :key="index"
|
|
|
+ :key="obj.code"
|
|
|
:label="obj.name"
|
|
|
:value="obj.code">
|
|
|
</el-option>
|
|
@@ -203,6 +204,14 @@ export default {
|
|
|
this.dicts = dicts
|
|
|
this.zoneEdit = this.type=='edit' ? false: true
|
|
|
},
|
|
|
+ getShow(item){
|
|
|
+ if(item.identifier == "zone_id"){
|
|
|
+ return (this.$store.state.account.user.roles.indexOf('舱体') < 0 && this.$store.state.account.user.roles.indexOf('框体') < 0)
|
|
|
+ }else if(item.identifier == "product_module_id"){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },
|
|
|
close () {
|
|
|
this.$emit('close')
|
|
|
},
|
|
@@ -214,12 +223,13 @@ export default {
|
|
|
},
|
|
|
submitForm () {
|
|
|
console.log("表单的数据:", this.tenant)
|
|
|
- //return false
|
|
|
+ this.tenant.zone_id = (this.tenant.zone_id==null)?this.commList.zone_id[0].code : this.tenant.zone_id
|
|
|
+ this.tenant.product_module_id = (this.tenant.product_module_id==null)? this.commList.product_module_id[0].code : this.tenant.product_module_id
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
|
// 清楚对象中一个属性
|
|
|
this.tenant.parent_name = undefined
|
|
|
- this.confirmDisabled = true
|
|
|
+ this.confirmDisabled = true
|
|
|
if (this.type === 'add') {
|
|
|
this.save()
|
|
|
} else {
|
|
@@ -251,6 +261,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
update () {
|
|
|
+ console.log(this.tenant)
|
|
|
bomMgrApi.update(this.tenant)
|
|
|
.then((response) => {
|
|
|
const res = response.data
|
|
@@ -300,22 +311,23 @@ export default {
|
|
|
},
|
|
|
|
|
|
// 加载动态表单的数据-函数
|
|
|
- getCommList(fieldObj){
|
|
|
+ getCommList(fieldObj){
|
|
|
+ let that = this
|
|
|
modelingCenterApi.formCommList({comboxUrl: fieldObj.comboxUrl}).then(res => {
|
|
|
res = res.data
|
|
|
console.log("动态表单的数据:", res)
|
|
|
if(res.isSuccess){
|
|
|
// 初始化,表单的数据
|
|
|
- if(fieldObj.identifier=="meterial_id" || fieldObj.identifier=="tray_id"){
|
|
|
+ if(fieldObj.identifier=="meterial_id" || fieldObj.identifier=="tray_id" || fieldObj.identifier=="zone_id"){
|
|
|
//数据权限过滤
|
|
|
let role = this.$store.state.account.user.roles.indexOf('舱体')<0 && this.$store.state.account.user.roles.indexOf('框体')<0 ? null : (this.$store.state.account.user.roles.indexOf('舱体')<0? "舱体":"框体")
|
|
|
if(role!=null){
|
|
|
res.data = res.data.filter(item=>{
|
|
|
return item.name.indexOf(role) < 0;
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- this.commList[fieldObj.identifier] = res.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ that.commList[fieldObj.identifier] = res.data
|
|
|
}
|
|
|
})
|
|
|
if(this.isEnd){
|