|
|
@@ -9,7 +9,11 @@
|
|
|
>
|
|
|
<headerTitle title="基本信息">
|
|
|
<el-button @click="cancel">返回</el-button>
|
|
|
- <el-button type="primary" @click="submit" :loading="loading"
|
|
|
+ <el-button
|
|
|
+ v-if="!isReadOnly"
|
|
|
+ type="primary"
|
|
|
+ @click="submit"
|
|
|
+ :loading="loading"
|
|
|
>保存
|
|
|
</el-button>
|
|
|
</headerTitle>
|
|
|
@@ -20,6 +24,7 @@
|
|
|
<el-input
|
|
|
v-model="form.categoryLevelName"
|
|
|
@click.native="openCategory"
|
|
|
+ :disabled="isReadOnly"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -33,8 +38,8 @@
|
|
|
@click.native="openCode"
|
|
|
:disabled="status == 0"
|
|
|
/> -->
|
|
|
- <el-input v-model="form.code" :disabled="status == 0">
|
|
|
- <template slot="append" v-if="status != 0">
|
|
|
+ <el-input v-model="form.code" :disabled="status == 0 || isReadOnly">
|
|
|
+ <template slot="append" v-if="status != 0 && !isReadOnly">
|
|
|
<el-link :underline="false" @click.native="getCodeOpen"
|
|
|
>申请编码
|
|
|
</el-link></template
|
|
|
@@ -45,7 +50,7 @@
|
|
|
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="名称" prop="name">
|
|
|
- <el-input v-model="form.name" />
|
|
|
+ <el-input v-model="form.name" :disabled="isReadOnly" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
@@ -61,6 +66,7 @@
|
|
|
v-model="form.attributeType"
|
|
|
filterable
|
|
|
class="ele-block"
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in attributeList"
|
|
|
@@ -80,6 +86,7 @@
|
|
|
v-model="form.componentAttribute"
|
|
|
filterable
|
|
|
multiple
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in lbjtList"
|
|
|
@@ -111,6 +118,7 @@
|
|
|
v-model="form.produceType"
|
|
|
filterable
|
|
|
@change="produceTypeChange"
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in produceTypeList"
|
|
|
@@ -142,6 +150,7 @@
|
|
|
v-model="form.isConsumable"
|
|
|
style="width: 100%"
|
|
|
@change="changeConsumable"
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
<el-option :value="1" label="批量"></el-option>
|
|
|
<el-option :value="0" label="单件"></el-option>
|
|
|
@@ -159,7 +168,7 @@
|
|
|
trigger: 'change'
|
|
|
}"
|
|
|
>
|
|
|
- <el-input v-model="form.brandNum" />
|
|
|
+ <el-input v-model="form.brandNum" :disabled="isReadOnly" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
@@ -172,7 +181,7 @@
|
|
|
trigger: 'change'
|
|
|
}"
|
|
|
>
|
|
|
- <el-input v-model="form.modelType" />
|
|
|
+ <el-input v-model="form.modelType" :disabled="isReadOnly" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
@@ -186,7 +195,7 @@
|
|
|
trigger: 'change'
|
|
|
}"
|
|
|
>
|
|
|
- <el-input v-model="form.specification" @input="inputSpe" />
|
|
|
+ <el-input v-model="form.specification" @input="inputSpe" :disabled="isReadOnly" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
@@ -204,6 +213,7 @@
|
|
|
v-model="form.measureType"
|
|
|
style="width: 100%"
|
|
|
@change="changeMeasureType"
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in measureTypeList"
|
|
|
@@ -221,6 +231,7 @@
|
|
|
clearable
|
|
|
v-model="form.measuringUnit"
|
|
|
@change="changeUnit"
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
@@ -233,6 +244,7 @@
|
|
|
clearable
|
|
|
v-model="form.weightUnit"
|
|
|
@change="changeWeightUnit"
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
@@ -245,6 +257,7 @@
|
|
|
clearable
|
|
|
v-model="form.packingUnit"
|
|
|
@change="changeUnit"
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
@@ -252,7 +265,7 @@
|
|
|
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="面积" prop="area">
|
|
|
- <el-input v-model="form.area" />
|
|
|
+ <el-input v-model="form.area" :disabled="isReadOnly" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
@@ -262,6 +275,7 @@
|
|
|
dictName="计量单位"
|
|
|
clearable
|
|
|
v-model="form.areaUnit"
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
@@ -277,7 +291,7 @@
|
|
|
trigger: 'change'
|
|
|
}"
|
|
|
>
|
|
|
- <el-input v-model="form.imgCode" />
|
|
|
+ <el-input v-model="form.imgCode" :disabled="isReadOnly" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
@@ -292,7 +306,7 @@
|
|
|
}"
|
|
|
>
|
|
|
<div class="form-line">
|
|
|
- <el-input v-model="form.roughWeight" @input="handleInput2" />
|
|
|
+ <el-input v-model="form.roughWeight" @input="handleInput2" :disabled="isReadOnly" />
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -309,7 +323,7 @@
|
|
|
}"
|
|
|
>
|
|
|
<div class="form-line">
|
|
|
- <el-input v-model="form.netWeight" @input="handleInput3" />
|
|
|
+ <el-input v-model="form.netWeight" @input="handleInput3" :disabled="isReadOnly" />
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -327,6 +341,7 @@
|
|
|
<el-input
|
|
|
v-model="form.volume"
|
|
|
style="width: calc(100% - 100px)"
|
|
|
+ :disabled="isReadOnly"
|
|
|
/>
|
|
|
<!-- @input="handleInput1" -->
|
|
|
<DictSelection
|
|
|
@@ -334,6 +349,7 @@
|
|
|
clearable
|
|
|
v-model="form.volumeUnit"
|
|
|
style="width: 100px"
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
</DictSelection>
|
|
|
</div>
|
|
|
@@ -355,6 +371,7 @@
|
|
|
v-model="form.level"
|
|
|
placeholder="请选择"
|
|
|
@change="levelChange"
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in levelOptions"
|
|
|
@@ -385,6 +402,7 @@
|
|
|
filterable
|
|
|
allow-create
|
|
|
default-first-option
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
@@ -407,6 +425,7 @@
|
|
|
filterable
|
|
|
allow-create
|
|
|
default-first-option
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
@@ -419,6 +438,7 @@
|
|
|
:active-text="form.isEnabled == 1 ? '启用' : '停用'"
|
|
|
:active-value="1"
|
|
|
:inactive-value="0"
|
|
|
+ :disabled="isReadOnly"
|
|
|
>
|
|
|
</el-switch>
|
|
|
</template>
|
|
|
@@ -449,10 +469,10 @@
|
|
|
<component
|
|
|
:is="f.tagType"
|
|
|
v-model="form.extField[f.prop]"
|
|
|
- :disabled="f.extAttribute?.disabled"
|
|
|
+ :disabled="f.extAttribute?.disabled || isReadOnly"
|
|
|
clearable
|
|
|
:isProhibit="
|
|
|
- f.modelType == 'dict' ? f.extAttribute?.disabled : false
|
|
|
+ f.modelType == 'dict' ? f.extAttribute?.disabled || isReadOnly : false
|
|
|
"
|
|
|
:dictName="f.modelType == 'dict' ? f.label : ''"
|
|
|
></component>
|
|
|
@@ -463,23 +483,23 @@
|
|
|
<template v-if="industryAttribute == 1">
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="性味与归经">
|
|
|
- <el-input v-model="form.propertiesChannelTropism" />
|
|
|
+ <el-input v-model="form.propertiesChannelTropism" :disabled="isReadOnly" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="功能与主治">
|
|
|
- <el-input v-model="form.actionsAndUses" />
|
|
|
+ <el-input v-model="form.actionsAndUses" :disabled="isReadOnly" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="用法与用量">
|
|
|
- <el-input v-model="form.usageAndDosage" />
|
|
|
+ <el-input v-model="form.usageAndDosage" :disabled="isReadOnly" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</template>
|
|
|
<el-col :span="8" v-if="clientEnvironmentId == 5">
|
|
|
<el-form-item label="需要序列号">
|
|
|
- <el-radio-group v-model="form.extTagField.needProductSequence">
|
|
|
+ <el-radio-group v-model="form.extTagField.needProductSequence" :disabled="isReadOnly">
|
|
|
<el-radio :label="1">是</el-radio>
|
|
|
<el-radio :label="0">否</el-radio>
|
|
|
</el-radio-group>
|
|
|
@@ -487,12 +507,12 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="物联产品Key">
|
|
|
- <el-input v-model="form.iotProductKey" />
|
|
|
+ <el-input v-model="form.iotProductKey" :disabled="isReadOnly" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="产品图片">
|
|
|
- <ImgUpload ref="imgUploadRef" v-model="form.imgUrl" />
|
|
|
+ <ImgUpload ref="imgUploadRef" v-model="form.imgUrl" :disabled="isReadOnly" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -503,7 +523,7 @@
|
|
|
<!-- {{ form.extTagField }} -->
|
|
|
<el-form label-width="100px">
|
|
|
<el-form-item label="是否消耗品">
|
|
|
- <el-radio-group v-model="form.extTagField.isConsumables">
|
|
|
+ <el-radio-group v-model="form.extTagField.isConsumables" :disabled="isReadOnly">
|
|
|
<el-radio :label="1">是</el-radio>
|
|
|
<el-radio :label="0">否</el-radio>
|
|
|
</el-radio-group>
|
|
|
@@ -529,26 +549,27 @@
|
|
|
:packingUnit="form.packingUnit"
|
|
|
:packageDispositionVOList="packageDispositionVOList"
|
|
|
@change="changePackagingSpecification"
|
|
|
+ :disabled="isReadOnly"
|
|
|
/>
|
|
|
<!-- 销售配置 -->
|
|
|
- <SalesInfos ref="salesRefs" :form="categorySales" />
|
|
|
+ <SalesInfos ref="salesRefs" :form="categorySales" :disabled="isReadOnly" />
|
|
|
<!-- 采购信息 -->
|
|
|
- <PurchasingInfo ref="PurchasingInfoRefs" :form="categoryPurchase" />
|
|
|
+ <PurchasingInfo ref="PurchasingInfoRefs" :form="categoryPurchase" :disabled="isReadOnly" />
|
|
|
<!-- 生产信息 -->
|
|
|
- <ProductionInfo ref="productionRefs" :form="categoryMes" />
|
|
|
+ <ProductionInfo ref="productionRefs" :form="categoryMes" :disabled="isReadOnly" />
|
|
|
<!-- 计划 -->
|
|
|
- <PlanInfo ref="planRefs" :form="categoryAps" />
|
|
|
+ <PlanInfo ref="planRefs" :form="categoryAps" :disabled="isReadOnly" />
|
|
|
<!-- 质量配置 -->
|
|
|
|
|
|
- <QualityInfo ref="qualityRefs" :form="categoryQms" />
|
|
|
+ <QualityInfo ref="qualityRefs" :form="categoryQms" :disabled="isReadOnly" />
|
|
|
<!-- 舟皿信息 -->
|
|
|
- <BoatInfo :form="categoryPallet" />
|
|
|
+ <BoatInfo :form="categoryPallet" :disabled="isReadOnly" />
|
|
|
<!-- 周转车信息 -->
|
|
|
- <TurnoverInfo ref="turnoverRefs" :form="categoryVehicle" />
|
|
|
+ <TurnoverInfo ref="turnoverRefs" :form="categoryVehicle" :disabled="isReadOnly" />
|
|
|
<!-- 模具信息 -->
|
|
|
- <MoldInfo ref="moldRefs" :form="categoryMold" />
|
|
|
+ <MoldInfo ref="moldRefs" :form="categoryMold" :disabled="isReadOnly" />
|
|
|
<!-- 备注信息 -->
|
|
|
- <RemarkInfo ref="remarkRefs" :form="remarkform" />
|
|
|
+ <RemarkInfo ref="remarkRefs" :form="remarkform" :disabled="isReadOnly" />
|
|
|
<!-- 关联信息 -->
|
|
|
<linkMsg
|
|
|
ref="linkMsgRef"
|
|
|
@@ -556,6 +577,7 @@
|
|
|
:categoryLevelId="form.categoryLevelId"
|
|
|
:categoryLevelGroupId="form.categoryLevelGroupId"
|
|
|
:code="form.code"
|
|
|
+ :disabled="isReadOnly"
|
|
|
/>
|
|
|
<!-- 申请编码 -->
|
|
|
|
|
|
@@ -680,6 +702,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ isReadOnly: false,
|
|
|
isShow: true,
|
|
|
produceTypeList,
|
|
|
packagingSpecificationList: [],
|
|
|
@@ -980,6 +1003,8 @@
|
|
|
},
|
|
|
async activated() {
|
|
|
this.status = this.$route.query.status;
|
|
|
+ this.isReadOnly = this.$route.query.readOnly === 'true' || this.$route.query.readOnly === true;
|
|
|
+ console.log('activated - isReadOnly 状态:', this.isReadOnly, 'readOnly参数:', this.$route.query.readOnly);
|
|
|
this.form.categoryLevelId = this.$route.query.categoryLevelId;
|
|
|
this.form.categoryLevelName = this.$route.query.categoryLevelName;
|
|
|
this.form.categoryLevelPath = this.$route.query.categoryLevelPath;
|
|
|
@@ -1013,6 +1038,9 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ this.isReadOnly = this.$route.query.readOnly === 'true' || this.$route.query.readOnly === true;
|
|
|
+ console.log('详情页 isReadOnly 状态:', this.isReadOnly, 'readOnly参数:', this.$route.query.readOnly);
|
|
|
+
|
|
|
parameterGetByCode({
|
|
|
code: 'mandatory_field'
|
|
|
}).then((res) => {
|
|
|
@@ -1412,6 +1440,7 @@
|
|
|
},
|
|
|
|
|
|
getCodeOpen() {
|
|
|
+ if (this.isReadOnly) return;
|
|
|
let parentId = [];
|
|
|
if (this.form.categoryLevelPathId?.length) {
|
|
|
parentId = this.form.categoryLevelPathId?.split(',');
|
|
|
@@ -1486,6 +1515,7 @@
|
|
|
},
|
|
|
|
|
|
openCategory() {
|
|
|
+ if (this.isReadOnly) return;
|
|
|
this.$refs.categoryRefs.open();
|
|
|
},
|
|
|
|