linwenxin 8 mēneši atpakaļ
vecāks
revīzija
eefce34153

+ 17 - 26
src/views/auxiliaryFittings/vender/components/ShopPurchaseArea.vue

@@ -72,21 +72,21 @@
         >
           <el-table-column prop="goodsId" label="辅材编号" />
           <el-table-column prop="goodsName" label="辅材名称" width="230" />
-          <el-table-column prop="estimateCost" label="预估进价" header-align="left" align="center" />
-          <el-table-column prop="purchaseQty" label="订货数量" header-align="left" align="center" />
-          <el-table-column prop="deliverQty" label="供应数量" header-align="left" align="center">
+          <el-table-column prop="applyCost" label="预估进价" header-align="left" align="center" />
+          <el-table-column prop="applyQty" label="订货数量" header-align="left" align="center" />
+          <el-table-column prop="checkQty" label="供应数量" header-align="left" align="center">
             <template slot-scope="{ $index, row }">
-              <label v-if="inputParam.openType === 'view'">{{ row.deliverQty + ' /' + row.measureUnit }}</label>
+              <label v-if="inputParam.openType === 'view'">{{ row.checkQty + ' /' + row.goodsStockUnit }}</label>
               <el-form-item
                 v-else
                 style="margin: 18px 0"
                 label-width="0"
                 size="mini"
-                :prop="'items.' + $index + '.deliverQty'"
-                :rules="dataFormRules.deliverQty"
+                :prop="'items.' + $index + '.checkQty'"
+                :rules="dataFormRules.checkQty"
               >
-                <el-input v-model="row.deliverQty" size="mini">
-                  <template slot="suffix">{{ ' /' + row.measureUnit }}</template>
+                <el-input v-model="row.checkQty" size="mini">
+                  <template slot="suffix">{{ ' /' + row.goodsStockUnit }}</template>
                 </el-input>
               </el-form-item>
             </template>
@@ -95,9 +95,8 @@
             <el-table-column prop="recQty" label="验收数量" />
             <el-table-column prop="recGiftQty" label="验收赠品数量" />
           </template>
-          <el-table-column prop="measureUnit" label="采购单位" />
-          <el-table-column prop="productModel" label="商品型号" />
-          <el-table-column prop="specification" label="规格" />
+          <el-table-column prop="goodsStockUnit" label="采购单位" />
+          <el-table-column prop="goodsSpecification" label="规格" />
         </el-table>
         <el-row>
           <el-col :span="24"
@@ -108,11 +107,11 @@
     </el-row>
     <div style="text-align: right">
       <el-button @click="cancelForm">取 消</el-button>
-      <el-button v-if="checkBtn('edit')" type="primary" :disabled="saveBtn" @click="submitForm('edit')"
+      <el-button v-if="$restrict('edit')" type="primary" :disabled="saveBtn" @click="submitForm('edit')"
         >保 存</el-button
       >
-      <el-button v-if="checkBtn('verify')" type="success" @click="verifySheet(dataForm.purchaseId)">核 实</el-button>
-      <el-button v-if="checkBtn('revoke')" type="danger" @click="revokeSheet(dataForm.purchaseId)">撤 消</el-button>
+      <el-button v-if="$restrict('verify')" type="success" @click="verifySheet(dataForm.purchaseId)">核 实</el-button>
+      <el-button v-if="$restrict('revoke')" type="danger" @click="revokeSheet(dataForm.purchaseId)">撤 消</el-button>
     </div>
   </el-form>
 </template>
@@ -141,7 +140,7 @@ export default {
     }
   },
   data() {
-    const validateDeliverQty = (rule, value, callback) => {
+    const validatecheckQty = (rule, value, callback) => {
       this.saveBtn = true
       if (Number.isNaN(parseFloat(value))) {
         return callback(new Error('请输入数字值'))
@@ -165,8 +164,9 @@ export default {
         flag: '',
         items: [] // 关系辅材列表
       },
+      authShop: [],
       dataFormRules: {
-        deliverQty: [{ validator: validateDeliverQty, trigger: 'blur' }]
+        checkQty: [{ validator: validatecheckQty, trigger: 'blur' }]
       },
       venderList: [],
       saveBtn: false // 保存按钮状态
@@ -223,6 +223,7 @@ export default {
         }
       })
     },
+
     setDataForm(data) {
       this.dataForm = {
         purchaseId: data.purchaseId, // 单据编号
@@ -233,16 +234,6 @@ export default {
         items: data.items // 关系商品列表
       }
     },
-    checkBtn(type) {
-      const typeMap = {
-        add: this.inputParam.openType === type,
-        edit: this.dataForm.flag === 1 && this.inputParam.openType === type,
-        revoke: this.dataForm.flag === 1,
-        verify: this.dataForm.flag === 1
-      }
-      // 检查按钮权限
-      return true // this.checkBtnRole(type) && typeMap[type]
-    },
 
     // 核实 采购申请单
     verifySheet(purchaseId) {

+ 13 - 13
src/views/auxiliaryFittings/vender/shop-purchase/index.vue

@@ -17,7 +17,7 @@
       <div style="box-sizing: border-box; padding: 20px">
         <el-page-header
           :content="
-            shopPurchaseAreaParam.openType !== 'add'
+            shopPurchaseAreaParam.openType === 'add'
               ? '新增网点采购单'
               : shopPurchaseAreaParam.openType === 'view'
               ? '查看网点采购单'
@@ -111,15 +111,15 @@ export default {
     },
     optionsEvensGroup() {
       return [
-        [
-          [
-            this.optionsEvensAuth('add', {
-              click: () => {
-                this.addOrEdit('add')
-              }
-            })
-          ]
-        ]
+        // [
+        //   [
+        //     this.optionsEvensAuth('add', {
+        //       click: () => {
+        //         this.addOrEdit('add')
+        //       }
+        //     })
+        //   ]
+        // ]
       ]
     }
   },
@@ -199,7 +199,7 @@ export default {
         },
         edit: {
           conditions: ({ row, index, column }) => {
-            return row.flag === 1
+            return row.flag === 'SUBMIT' && row.isRecheck === 'ON'
           },
           click: ({ row, index, column }) => {
             this.handleCommand([row.purchaseId, 'edit'])
@@ -208,7 +208,7 @@ export default {
         verify: {
           prompt: '确定核实吗?',
           conditions: ({ row, index, column }) => {
-            return row.flag === 1
+            return row.flag === 'SUBMIT' && row.isRecheck === 'ON'
           },
           click: ({ row, index, column }) => {
             this.handleCommand([row.purchaseId, 'verify'])
@@ -217,7 +217,7 @@ export default {
         revoke: {
           prompt: '确定撤消吗?',
           conditions: ({ row, index, column }) => {
-            return row.flag === 1
+            return row.flag === 'SUBMIT' && row.isRecheck === 'ON'
           },
           click: ({ row, index, column }) => {
             this.handleCommand([row.purchaseId, 'revoke'])