chencc 1 год назад
Родитель
Сommit
7b9806e0d6
2 измененных файлов с 40 добавлено и 5 удалено
  1. 38 3
      src/views/material/product/detail.vue
  2. 2 2
      vue.config.js

+ 38 - 3
src/views/material/product/detail.vue

@@ -180,7 +180,7 @@
             <el-form-item :label="f.label">
               <template>
                 <div class="form-line">
-    
+
                   <component :is="f.tagType" v-model="form.extField[f.prop]" :disabled="f.extAttribute?.disabled"
                     clearable :isProhibit="f.modelType == 'dict' ? f.extAttribute?.disabled : false
                       " :dictName="f.modelType == 'dict' ? f.label : ''"></component>
@@ -193,6 +193,18 @@
         </el-row>
       </el-form>
     </el-card>
+    <el-card shadow="never">
+      <headerTitle title="扩展标签"></headerTitle>
+      <!-- {{ form.extTagField }} -->
+      <el-form label-width="100px"  >
+        <el-form-item label="是否消耗品">
+          <el-radio-group v-model="form.extTagField.isConsumables">
+            <el-radio :label="1">是</el-radio>
+            <el-radio :label="0">否</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+    </el-card>
 
     <!--  自定义编码 -->
     <CodeDialog ref="codeRefs" v-if="codeShow" @close="codeShow = false" @chooseCode="chooseCode" />
@@ -330,7 +342,12 @@ export default {
         weightUnit: '',
         packingUnit: '',
         isEnabled: 1,
-        extField: {}
+        extField: {},
+        // isConsumables:2,
+        extTagField: {
+          isConsumables: 0,
+        },
+
       },
       lbjtList: [
         {
@@ -472,10 +489,16 @@ export default {
             weightUnit: '',
             packingUnit: '',
             extField: {},
+            extTagField: {
+              isConsumables: 0,
+            },
             measureType: 1,
             isEnabled: 1,
 
           };
+
+          console.log(this.form);
+
           this.categorySales = {};
           this.purchaseInfo = {};
           this.remarkform = {
@@ -741,8 +764,17 @@ export default {
       fieldModel({ relevance: 't_main_category' }).then((res) => {
         this.fileList = res;
 
+        if(!this.form.extTagField){
+          this.form.extTagField={
+            isConsumables:0
+          }; // 初始化动态模型属性
+
+        }
+        // this.$set(this.form.extTagField, 'isConsumables', 0); // 初始化动态模型属性
+
         this.fileList.forEach((f) => {
           this.$set(this.form.extField, f.prop, ''); // 初始化动态模型属性
+          // this.$set(this.form.extTagField, f.prop, ''); // 初始化动态模型属性  
         });
       });
     },
@@ -826,12 +858,13 @@ export default {
     // 保存
     submit() {
 
+      
       this.$refs.manageForm.validate(async (valid) => {
 
 
         let productionValid = await this.$refs.productionRefs.getFormValid();
         let warehouseValid = await this.$refs.warehouseRefs.getFormValid();
-        
+
 
         if (!valid || !productionValid || !warehouseValid) {
           return false;
@@ -890,6 +923,8 @@ export default {
               (item) => item.status == 1
             );
           this.form.extField.packingSpecification = packagingSpecificationList
+
+
             .map((item) => {
               return [
                 `${item.minPackageCell}${item.packageUnit}/${item.minConversionUnit}`,

+ 2 - 2
vue.config.js

@@ -36,10 +36,10 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.1.176:18086',
-        target: 'http://192.168.1.251:18086',
+        // target: 'http://192.168.1.251:18086',
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {