戴艳蓉 3 years ago
parent
commit
10af3fa483

+ 8 - 1
src/views/goodStore/goodsCost/columns.js

@@ -107,7 +107,7 @@ const listCol = [
     width: "70px",
   },
 
-  
+
   {
     prop: "addtime",
     label: "创建时间",
@@ -481,6 +481,13 @@ const rules = {
       trigger: "blur",
     },
   ],
+  cgd_gold_price: [
+    {
+      required: true,
+      validator: validate_num,
+      trigger: "blur",
+    },
+  ],
   is_step: {
     required: true,
     message: "请选择是否启用阶梯",

+ 76 - 47
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -576,7 +576,7 @@
       >
       <el-col :span="23" class="dmain">
         <el-row>
-          <el-col :span="8">
+          <el-col :span="6">
             <el-form-item label="供货区域" prop="supply_area">
               <el-select
                 v-model="ruleForm.supply_area"
@@ -595,31 +595,8 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="发货地" prop="delivery_place">
-              <select-area
-                :placeholder="'发货地'"
-                :value="ruleForm.delivery_place"
-                :is-detail="id !== 'add'"
-                :disabled="type === 'view' || type === 'editCoin'"
-                :size="'mini'"
-                @selectChange="selectAreadelivery_place"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="产地" prop="origin_place">
-              <select-area
-                :placeholder="'产地'"
-                :value="ruleForm.origin_place"
-                :size="'mini'"
-                :is-detail="id !== 'add'"
-                :disabled="type === 'view' || type === 'editCoin'"
-                @selectChange="selectAreaorigin_place"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
+
+          <el-col :span="6">
             <el-form-item label="物流时间" prop="delivery_day">
               <digital-input
                 :values="ruleForm.delivery_day"
@@ -637,7 +614,7 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="8">
+          <el-col :span="6">
             <el-form-item label="供货周期" prop="lead_time">
               <digital-input
                 :values="ruleForm.lead_time"
@@ -655,7 +632,7 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="8">
+          <el-col :span="6">
             <el-form-item label="调样周期" prop="sample_day">
               <digital-input
                 :values="ruleForm.sample_day"
@@ -673,6 +650,30 @@
               />
             </el-form-item>
           </el-col>
+          <el-col :span="12">
+            <el-form-item label="发货地" prop="delivery_place">
+              <select-area
+                :placeholder="'发货地'"
+                :value="ruleForm.delivery_place"
+                :is-detail="id !== 'add'"
+                :disabled="type === 'view' || type === 'editCoin'"
+                :size="'mini'"
+                @selectChange="selectAreadelivery_place"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="产地" prop="origin_place">
+              <select-area
+                :placeholder="'产地'"
+                :value="ruleForm.origin_place"
+                :size="'mini'"
+                :is-detail="id !== 'add'"
+                :disabled="type === 'view' || type === 'editCoin'"
+                @selectChange="selectAreaorigin_place"
+              />
+            </el-form-item>
+          </el-col>
         </el-row>
       </el-col>
     </el-row>
@@ -779,8 +780,8 @@
       >
       <el-col :span="23" class="dmain">
         <el-row>
-          <el-col :span="8">
-            <el-form-item label="证书费" prop="cert_fee">
+          <el-col :span="6">
+            <el-form-item label="证书费" prop="cert_fee" label-width="75px">
               <digital-input
                 :values="ruleForm.cert_fee"
                 :placeholder="'证书费'"
@@ -797,8 +798,8 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="包装费" prop="packing_fee">
+          <el-col :span="6">
+            <el-form-item label="包装费" prop="packing_fee" label-width="75px">
               <digital-input
                 :values="ruleForm.packing_fee"
                 :placeholder="'包装费'"
@@ -815,8 +816,8 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="工艺费" prop="cost_fee">
+          <el-col :span="6">
+            <el-form-item label="工艺费" prop="cost_fee" label-width="75px">
               <digital-input
                 :values="ruleForm.cost_fee"
                 :placeholder="'工艺费'"
@@ -833,8 +834,8 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="加标费" prop="mark_fee">
+          <el-col :span="6">
+            <el-form-item label="加标费" prop="mark_fee" label-width="75px">
               <digital-input
                 :values="ruleForm.mark_fee"
                 :placeholder="'加标费'"
@@ -851,8 +852,8 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="打样费" prop="demo_fee">
+          <el-col :span="6">
+            <el-form-item label="打样费" prop="demo_fee" label-width="75px">
               <digital-input
                 :values="ruleForm.demo_fee"
                 :placeholder="'打样费'"
@@ -869,8 +870,8 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="开模费" prop="open_fee">
+          <el-col :span="6">
+            <el-form-item label="开模费" prop="open_fee" label-width="75px">
               <digital-input
                 :values="ruleForm.open_fee"
                 :placeholder="'开模费'"
@@ -887,8 +888,8 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="调样费" prop="sample_fee">
+          <el-col :span="6">
+            <el-form-item label="调样费" prop="sample_fee" label-width="75px">
               <digital-input
                 :values="ruleForm.sample_fee"
                 :placeholder="'调样费'"
@@ -905,8 +906,8 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="市场价" prop="market_price">
+          <el-col :span="6">
+            <el-form-item label="市场价" prop="market_price" label-width="75px">
               <digital-input
                 :values="ruleForm.market_price"
                 :placeholder="'市场价'"
@@ -923,8 +924,8 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="裸价" prop="nake_price">
+          <el-col :span="6">
+            <el-form-item label="裸价" prop="nake_price" label-width="75px">
               <digital-input
                 :values="ruleForm.nake_price"
                 :placeholder="'裸价'"
@@ -941,6 +942,28 @@
               />
             </el-form-item>
           </el-col>
+          <el-col :span="8" v-show="is_noble">
+            <el-form-item
+              label="供应商采购金价"
+              prop="cgd_gold_price"
+              label-width="130px"
+            >
+              <digital-input
+                :values="ruleForm.cgd_gold_price"
+                :placeholder="'供应商采购金价'"
+                :min="0"
+                :name="'ruleForm.cgd_gold_price'"
+                :disabled="type === 'view' || type === 'editBase'"
+                :max="100000000000"
+                :position="'right'"
+                :precision="2"
+                :size="'mini'"
+                :controls="false"
+                :append="'元'"
+                @reschange="number_change($event, 'cgd_gold_price')"
+              />
+            </el-form-item>
+          </el-col>
         </el-row>
       </el-col>
     </el-row>
@@ -955,7 +978,7 @@
       >
       <el-col :span="23" class="dmain">
         <el-row>
-          <el-col :span="8">
+          <el-col :span="6">
             <el-form-item label="启用阶梯" prop="is_step">
               <el-select
                 v-model="ruleForm.is_step"
@@ -1494,6 +1517,7 @@ export default {
         sample_fee: "0",
         market_price: "0",
         nake_price: "0",
+        cgd_gold_price: "0",
         is_step: "",
         is_diff: "",
         config: [],
@@ -1565,6 +1589,7 @@ export default {
             is_gold_price, //	string	是否使用实时金价
             market_price, //	string	市场价
             nake_price, //	string	成本裸价
+            cgd_gold_price, //	string	供应商采购金价
             is_step, //	string	是否使用阶梯价
             // is_online, //	string	是否上线
             status, //		string	状态
@@ -1683,6 +1708,7 @@ export default {
             sample_fee: sample_fee || "",
             market_price: market_price || "",
             nake_price: nake_price || "",
+            cgd_gold_price: cgd_gold_price || "",
             is_step: is_step || "",
             is_diff: is_diff || "",
             config: config ? config.split(",") : [],
@@ -1722,6 +1748,7 @@ export default {
         delete item["is_gold_price"];
         delete item["market_price"];
         delete item["nake_price"];
+        delete item['cgd_gold_price'];
         delete item["is_step"];
         delete item["good_ladder"];
       } else {
@@ -1737,6 +1764,7 @@ export default {
           is_gold_price,
           market_price,
           nake_price,
+          cgd_gold_price,
           is_step,
           good_ladder,
           spuCode,
@@ -1753,6 +1781,7 @@ export default {
           is_gold_price: is_gold_price || "",
           market_price: market_price || "",
           nake_price: nake_price || "",
+          cgd_gold_price:cgd_gold_price||"",
           is_step: is_step || "",
           good_ladder: good_ladder || [],
           spuCode: spuCode || "",

+ 89 - 76
src/views/goodStore/goodsOnline/ShowDataTableColumns.js

@@ -1,4 +1,5 @@
-export default [
+
+const public_listCol = [
   {
     prop: "good_name",
     label: "商品名称",
@@ -11,8 +12,14 @@ export default [
     _slot_: "speclist",
   },
   {
-    prop: "supplierName",
-    label: "供应商名称",
+    prop: "skuCode",
+    label: "上线商品编号",
+    span: 6,
+  },
+  {
+    prop: "companyNo",
+    label: "业务企业编号",
+    span: 6,
   },
   {
     prop: "company",
@@ -24,16 +31,13 @@ export default [
     label: "详情图",
   },
   {
-    prop: "online_reason",
-    label: "上线原因",
-  },
-  {
-    prop: "skuCode",
-    label: "商品编号",
-    span: 6,
+    prop: "cat",
+    label: "分类",
+    span: 12,
   },
 
 
+
   {
     prop: "creater",
     label: "申请人",
@@ -55,10 +59,10 @@ export default [
     span: 6,
   },
   {
-    prop: "cat",
-    label: "分类",
-    span: 6,
+    prop: "online_reason",
+    label: "上线原因",
   },
+
   {
     prop: "online_remark",
     label: "上线备注",
@@ -69,14 +73,9 @@ export default [
     label: "品牌",
     span: 6,
   },
- 
 
-  {
-    prop: "is_auth",
-    label: "供应商权限",
-    _slot_: "is_auth",
-    span: 6,
-  },
+
+
   {
     prop: "exclusive",
     label: "专属类型",
@@ -117,6 +116,16 @@ export default [
     label: "装箱尺寸",
     span: 6,
   },
+  {
+    prop: "origin_place_cn",
+    label: "产地",
+    span: 8,
+  },
+  {
+    prop: "unit",
+    label: "单位",
+    span: 4,
+  },
   {
     prop: "good_bar",
     label: "商品条形码",
@@ -128,6 +137,17 @@ export default [
     _slot_: "supply_area",
     span: 6,
   },
+  {
+    prop: "delivery_place_cn",
+    label: "发货地",
+    span: 8,
+  },
+  {
+    prop: "is_stock",
+    label: "是否库存品",
+    _slot_: "is_stock",
+    span: 4,
+  },
   {
     prop: "exam_status",
     label: "状态",
@@ -135,26 +155,16 @@ export default [
     span: 6,
   },
   {
-    prop: "delivery_place_cn",
-    label: "发货地",
-    span: 10,
-  },
-  {
-    prop: "origin_place_cn",
-    label: "产地",
-    span: 10,
+    prop: "good_type",
+    label: "是否定制",
+    _slot_: "good_type",
+    span: 6
   },
 
   {
-    prop: "unit",
-    label: "单位",
-    span: 4,
-  },
-  {
-    prop: "is_stock",
-    label: "是否库存品",
-    _slot_: "is_stock",
-    span: 4,
+    prop: "addtime",
+    label: "创建时间",
+    span: 8,
   },
   {
     prop: "tax",
@@ -181,9 +191,46 @@ export default [
     append: '天',
     span: 4,
   },
+
+
+
+
+
+  {
+    prop: "after_sales",
+    label: "售后说明",
+    span: 24,
+  },
+  {
+    prop: "good_remark",
+    label: "商品备注",
+    span: 24,
+  },
+
+  {
+    prop: "craft_desc",
+    label: "工艺说明",
+    span: 24,
+  },
+
+
+
+
+]
+const purchase_listCol = [
+  {
+    prop: "supplierName",
+    label: "供应商名称",
+  },
+  {
+    prop: "is_auth",
+    label: "供应商权限",
+    _slot_: "is_auth",
+    span: 6,
+  },
   {
     prop: "is_step",
-    label: "启用阶梯",
+    label: "启用成本阶梯",
     _slot_: "is_step",
     span: 4,
   },
@@ -244,42 +291,6 @@ export default [
     append: '元',
     span: 6,
   },
-  
- 
-  {
-    prop: "updatetime",
-    label: "更新时间",
-    span: 6,
-  },
-  {
-    prop: "addtime",
-    label: "创建时间",
-    span: 6,
-  },
-  {
-    prop: "good_type",
-    label: "是否定制",
-    _slot_: "good_type",
-    span: 6
-  },
-
-  {
-    prop: "after_sales",
-    label: "售后说明",
-    span: 24,
-  },
-  {
-    prop: "good_remark",
-    label: "商品备注",
-    span: 24,
-  },
-
-  {
-    prop: "craft_desc",
-    label: "工艺说明",
-    span: 24,
-  },
-
   {
     prop: "nakelist",
     label: "采购起订量",
@@ -287,13 +298,15 @@ export default [
     span: 24,
   },
 
+
+]
+const sale_listCol = [
   {
     prop: "ladderlist",
     label: "销售起订量",
     _slot_: "ladderlist",
     span: 24,
   },
-
-
 ]
 
+export { public_listCol, purchase_listCol, sale_listCol }

+ 154 - 5
src/views/goodStore/goodsOnline/components/fixed-price-form.vue

@@ -16,13 +16,98 @@
           :size="'mini'"
           border
           stripe
+          max-height="300px"
+          row-key="key"
           style="width: 100%; margin: 0 0 20px 0"
         >
-          <el-table-column prop="min_num" label="起订量(>=)" />
-          <el-table-column prop="sale_price" label="售价" />
-          <el-table-column prop="market_price" label="市场价" />
-          <el-table-column prop="market_platform" label="对比平台" />
-          <el-table-column prop="status" label="状态">
+          <el-table-column type="index" width="50" show-overflow-tooltip />
+          <el-table-column
+            prop="min_num"
+            label="起订量(>=)"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-form-item
+                v-if="scope.row.edit"
+                :prop="'good_ladder.' + scope.$index + '.' + 'min_num'"
+                :rules="addrRules.min_num"
+                :size="'mini'"
+                :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+              >
+                <el-input
+                  v-model="scope.min_num"
+                  placeholder="起订量(>=)"
+                  :disabled="!scope.row.edit"
+                />
+              </el-form-item>
+              <span v-if="!scope.row.edit">{{ scope.row.min_num }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="sale_price" label="售价" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-form-item
+                v-if="scope.row.edit"
+                :prop="'good_ladder.' + scope.$index + '.' + 'sale_price'"
+                :rules="addrRules.sale_price"
+                :size="'mini'"
+                :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+              >
+                <el-input
+                  v-model="scope.sale_price"
+                  placeholder="售价"
+                  :disabled="!scope.row.edit"
+                />
+              </el-form-item>
+              <span v-if="!scope.row.edit">{{ scope.row.sale_price }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="market_price"
+            label="市场价"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-form-item
+                v-if="scope.row.edit"
+                :prop="'good_ladder.' + scope.$index + '.' + 'market_price'"
+                :rules="addrRules.market_price"
+                :size="'mini'"
+                :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+              >
+                <el-input
+                  v-model="scope.market_price"
+                  placeholder="市场价"
+                  :disabled="!scope.row.edit"
+                />
+              </el-form-item>
+              <span v-if="!scope.row.edit">{{ scope.row.market_price }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="market_platform"
+            label="对比平台"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-form-item
+                v-if="scope.row.edit"
+                :prop="'good_ladder.' + scope.$index + '.' + 'market_platform'"
+                :rules="addrRules.market_platform"
+                :size="'mini'"
+                :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+              >
+                <el-input
+                  v-model="scope.market_platform"
+                  placeholder="对比平台"
+                  :disabled="!scope.row.edit"
+                />
+              </el-form-item>
+              <span v-if="!scope.row.edit">{{
+                scope.row.market_platform
+              }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="status" label="状态" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-tag
                 :size="'mini'"
@@ -250,6 +335,31 @@ export default {
    * @searchChange             : 选中值变化调用   抛出选中数据
    */
   data() {
+    const validate_num = (rule, value, callback) => {
+      const { required } = rule;
+      if (required && value === "") {
+        callback(new Error("不能为空!"));
+      } else {
+        callback();
+      }
+    };
+    const validate_num_0 = (rule, value, callback) => {
+      const { required } = rule;
+      if (required && value === "") {
+        callback(new Error("不能为空!"));
+      } else if (
+        required &&
+        (value === "0" ||
+          value === "0." ||
+          value === "0.0" ||
+          value === "0.00" ||
+          value === "0.000")
+      ) {
+        callback(new Error("不能为零!"));
+      } else {
+        callback();
+      }
+    };
     return {
       loading: false,
       showVoucher: false,
@@ -318,6 +428,45 @@ export default {
           },
         ],
       },
+      addrRules: {
+        min_num: [
+          {
+            required: true,
+            validator: validate_num_0,
+            trigger: "blur",
+          },
+        ],
+
+        sale_price: [
+          {
+            required: true,
+            trigger: "blur",
+            validator: validate_num,
+          },
+        ],
+        market_price: [
+          {
+            required: true,
+            validator: validate_num,
+            trigger: "blur",
+          },
+        ],
+
+        market_platform: [
+          {
+            required: true,
+            message: "对比平台不能为空",
+            trigger: "blur",
+          },
+        ],
+        status: [
+          {
+            required: true,
+            message: "状态不能为空",
+            trigger: "change",
+          },
+        ],
+      },
     };
   },
   watch: {

+ 10 - 4
src/views/goodStore/goodsOnline/detail.vue

@@ -8,12 +8,12 @@
       <el-tabs v-model="activeTabs">
         <el-tab-pane label="商品上线详情" name="1" v-if="queryType !== 'add'">
           <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
-            <el-collapse-item title="上线详情" name="0">
+            <el-collapse-item title="商品上线详情" name="0">
               <show-data-table
                 :newTime="newTime"
                 v-if="newTime !== ''"
                 :sitem="sitem"
-                :columns="ShowDataTableColumns"
+                :columns="public_listCol"
               >
                 <template slot="good_name">
                   <img
@@ -248,7 +248,11 @@
 import asyncRequest from "@/apis/service/goodStore/goodsOnline";
 import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
-import ShowDataTableColumns from "./ShowDataTableColumns";
+import {
+  public_listCol,
+  purchase_listCol,
+  sale_listCol,
+} from "./ShowDataTableColumns";
 import onlineExamForm from "./components/online-exam-form";
 import fixedPriceForm from "./components/fixed-price-form";
 import handleOnlineForm from "./components/handle-online-form";
@@ -288,7 +292,9 @@ export default {
 
   data() {
     return {
-      ShowDataTableColumns: ShowDataTableColumns,
+      public_listCol: public_listCol,
+      purchase_listCol: purchase_listCol,
+      sale_listCol: sale_listCol,
       options1: options1,
       options2: options2,
       options3: options3,

+ 1 - 1
src/views/goodStore/goodsOnline/index.vue

@@ -91,7 +91,7 @@
           <el-row>
             <el-col :span="4" style="width: 200px">
               <el-select
-                v-model="parmValue.status"
+                v-model="parmValue.exam_status"
                 filterable
                 clearable
                 :size="searchSize"

+ 53 - 13
src/views/interest/role/addEdit.vue

@@ -5,7 +5,7 @@
     :center="true"
     align="left"
     top="5vh"
-    width="900px"
+    width="1040px"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"
     element-loading-text="拼命加载中"
@@ -13,22 +13,44 @@
     element-loading-background="rgba(0, 0, 0, 0.8)"
     @close="showModelThis = false"
   >
-    <el-card style="margin-top:-20px;">
+    <el-card style="margin-top: -20px">
       <el-row :gutter="10">
         <el-form
           ref="ruleForm"
           :model="ruleForm"
           status-icon
+          :size="'mini'"
           :rules="rulesThis"
           label-width="80px"
           class="demo-ruleForm"
         >
-          <el-col :span="12">
+          <el-col :span="9">
             <el-form-item label="角色名称" prop="role_name">
-              <el-input v-model="ruleForm.role_name" :disabled="isDetail" />
+              <el-input
+                v-model="ruleForm.role_name"
+                :disabled="isDetail"
+                placeholder="角色名称"
+              />
             </el-form-item>
           </el-col>
-          <el-col :span="12">
+          <el-col :span="9">
+            <el-form-item
+              label="关键字段权限"
+              prop="private_field"
+              label-width="110px"
+            >
+              <el-checkbox-group
+                v-model="ruleForm.private_field"
+                :disabled="isDetail"
+                placeholder="关键字段权限"
+              >
+                <el-checkbox :label="'1'">成本价</el-checkbox>
+                <el-checkbox :label="'2'">销售价</el-checkbox>
+                <el-checkbox :label="'3'">毛利率</el-checkbox>
+              </el-checkbox-group>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
             <el-form-item label="角色等级" prop="level">
               <el-select
                 v-model="ruleForm.level"
@@ -105,7 +127,7 @@
                               v-model="subItem.is_private_change"
                             >
                               <el-radio-button
-                              :disabled="isDetail"
+                                :disabled="isDetail"
                                 v-for="(radioN, ri) in subItem.private"
                                 :key="radioN.label + ri"
                                 :label="radioN.id"
@@ -234,10 +256,14 @@
           </div>
         </el-form>
         <el-col :span="24" style="text-align: right">
-          <el-button v-if="!isDetail" type="primary" @click="submitForm"
+          <el-button
+            v-if="!isDetail"
+            type="primary"
+            :size="'mini'"
+            @click="submitForm"
             >保 存
           </el-button>
-          <el-button @click="showModelThis = false">{{
+          <el-button @click="showModelThis = false" :size="'mini'">{{
             isDetail ? "关 闭" : "取 消"
           }}</el-button>
         </el-col>
@@ -253,7 +279,7 @@ import resToken from "@/mixins/resToken";
 export default {
   name: "Role",
   props: ["showModel", "id", "isDetail"],
-  mixins:[resToken],
+  mixins: [resToken],
   data() {
     const validatename = (rule, value, callback) => {
       if (value === "") {
@@ -279,6 +305,7 @@ export default {
       ruleForm: {
         role_name: "",
         level: "1",
+        private_field: [],
       },
       action_data: [], // 字段数据
       action: [], // 功能数据
@@ -294,6 +321,14 @@ export default {
       actionList: [],
       rulesThis: this.rules,
       rules: {
+        private_field: [
+          {
+            type: "array",
+            required: true,
+            message: "请选择关键字段权限",
+            trigger: "change",
+          },
+        ],
         role_name: [
           {
             required: true,
@@ -453,7 +488,6 @@ export default {
       // console.log(this.actionList[index].child[subIndex]);
     },
 
-    
     async initForm() {
       this.loading = true;
       if (this.id === "add") {
@@ -547,7 +581,7 @@ export default {
         this.actionList = arr;
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
-      }else{
+      } else {
         this.$message.warning(res.message);
       }
     },
@@ -585,7 +619,7 @@ export default {
         this.actionList = arr;
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
-      }else{
+      } else {
         this.$message.warning(res.message);
       }
     },
@@ -597,6 +631,7 @@ export default {
           this.$refs.ruleForm.clearValidate();
           this.ruleForm = {
             role_name: "",
+            private_field: [],
             level: "1",
           };
         }
@@ -625,11 +660,16 @@ export default {
             const model = {
               roleid: this.id,
               role_name: this.ruleForm.role_name,
+              private_field: JSON.parse(
+                JSON.stringify(this.ruleForm.private_field)
+              ),
               level: this.ruleForm.level,
               action: this.action,
               action_data: this.action_data,
               private_data: arr,
             };
+            console.log(this.ruleForm.private_field);
+            console.log(model);
             let res = {};
             if (this.id === "add") {
               delete model["roleid"];
@@ -649,7 +689,7 @@ export default {
               this.$emit("refresh");
             } else if (res && res.code >= 100 && res.code <= 104) {
               await this.logout();
-            }else{
+            } else {
               this.$message.warning(res.message);
             }
           }