lilei 2 年之前
父節點
當前提交
66e8566022

+ 5 - 1
src/views/purchasingManagement/bulkWarehousingOrder/detailModal.vue

@@ -44,6 +44,10 @@
         :columns="columns"
         :data="loadData"
         bordered>
+        <template slot="productName" slot-scope="text, record">
+          {{record.productName}}
+          <a-tag color="red" v-if="record.giftFlag==1">赠品</a-tag>
+        </template>
       </s-table>
     </a-card>
     <div class="btn-cont">
@@ -97,7 +101,7 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '40%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品名称', scopedSlots: { customRender: 'productName' },width: '40%', align: 'center' },
         { title: '单位', dataIndex: 'unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '入库数量', dataIndex: 'productQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '入库单价', dataIndex: 'productCost',width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

+ 3 - 4
src/views/purchasingManagement/bulkWarehousingOrder/importGuideModal.vue

@@ -15,10 +15,9 @@
             <span>1</span>准备导入
           </div>
           <ul>
-            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“数量”的列,且名称必须相同</li>
-            <li>2) 除了“产品编码”、“数量”、“成本价”两列,其他列可自定义,不影响数据导入</li>
-            <li>3) “成本价”为空或输入的价格与系统设置相同时,允许导入</li>
-            <li>4) 如果导入的产品已经存在,则不会导入该行</li>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“数量”、“成本价”的列,且名称必须相同</li>
+            <li>2) 除了“产品编码”、“数量”、“成本价”三列,其他列可自定义,不影响数据导入</li>
+            <li>3) “成本价”为0或输入的价格与系统相同时,允许导入,成本价为0按赠品处理</li>
           </ul>
           <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>

+ 19 - 17
src/views/purchasingManagement/bulkWarehousingOrder/productModal.vue

@@ -23,6 +23,7 @@
             show-search
             id="bulkWarehousingOrder-product-productSn"
             ref="productSn"
+            :disabled="itemSn"
             v-model="form.productSn"
             placeholder="请选择"
             :filter-option="false"
@@ -42,6 +43,7 @@
             @change="changeWarehouseCascade"
             v-model="form.warehouse"
             expand-trigger="hover"
+            :disabled="itemSn"
             :allowClear="false"
             :options="warehouseCascadeData"
             :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
@@ -49,17 +51,9 @@
             placeholder="请选择仓库仓位"
             style="width: 100%;" />
         </a-form-model-item>
-        <a-form-model-item label="成本价" prop="productCost">
-          <a-input-number
-            id="bulkWarehousingOrder-product-productCost"
-            v-model="form.productCost"
-            :disabled="true"
-            :precision="2"
-            :min="0"
-            :max="999999"
-            placeholder="成本价"
-            style="width: 50%;margin-right:20px;" />
-            <a-checkbox v-model="isGift">是否为赠品</a-checkbox>
+        <a-form-model-item label="成本价">
+            <span style="margin-right:20px;">{{form.productCost || form.productCost == 0 ? form.productCost : '--'}}</span>
+            <a-checkbox v-if="productCost||isGift" :disabled="itemSn" v-model="isGift">是否为赠品</a-checkbox>
         </a-form-model-item>
         <a-form-model-item label="数量" prop="productQty">
           <a-input-number
@@ -138,7 +132,7 @@ export default {
           { required: true, message: '请选择仓库仓位', trigger: 'change' }
         ],
         productCost: [
-          { required: true, message: '成本价不能为空', trigger: 'blur' }
+          { required: true, message: '该产品没有设置成本价', trigger: 'blur' }
         ],
         productQty: [
           { required: true, message: '请输入数量', trigger: 'blur' }
@@ -182,7 +176,7 @@ export default {
       this.form.productName = this.productData[ind].product.name
       this.form.productCode = this.productData[ind].product.code
       this.form.productOrigCode = this.productData[ind].product.origCode
-      this.form.productCost = (this.productData[ind].cost && this.productData[ind].cost != 0) ? this.productData[ind].cost : ''
+      this.form.productCost = this.productData[ind].cost
       this.productCost = this.form.productCost
       this.form.productQty = ''
       this.isGift = false
@@ -218,6 +212,10 @@ export default {
           if (!_this.itemSn) {
             delete form.id
             delete form.sparePartsDetailSn
+            if(!this.productCost){
+              _this.$message.warning('该产品没有设置成本价!')
+              return false
+            }
           }
           _this.spinning = true
           sparePartsSaveDetail(form).then(res => {
@@ -226,9 +224,13 @@ export default {
               setTimeout(() => {
                 _this.$emit('ok', res.data)
                 _this.spinning = false
-                _this.resetData()
-                _this.$refs.productQty.blur()
-                _this.$refs.productSn.focus()
+                if (!_this.itemSn) {
+                  _this.resetData()
+                  _this.$refs.productQty.blur()
+                  _this.$refs.productSn.focus()
+                }else{
+                  _this.isShow = false
+                }
               })
             } else {
               _this.spinning = false
@@ -308,8 +310,8 @@ export default {
         productCost: '',
         productQty: ''
       }
+      this.productCost = ''
       this.isGift = false
-      // this.$refs.productSn.focus()
     }
   },
   watch: {