chenrui 2 rokov pred
rodič
commit
ed69749c41

+ 7 - 5
src/views/purchasingManagement/bulkWarehousingOrder/chooseImportModal.vue

@@ -87,19 +87,21 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量', dataIndex: 'qtyText', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'unit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '单位', dataIndex: 'unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', dataIndex: 'costText', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       loadData: [],
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '23%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '26%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量', dataIndex: 'qtyText', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'errorDesc', width: '22%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '成本价', dataIndex: 'costText', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '备注', dataIndex: 'errorDesc', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       unLoadData: [],
       loading: false

+ 1 - 1
src/views/purchasingManagement/bulkWarehousingOrder/edit.vue

@@ -160,7 +160,7 @@ export default {
         { title: '单位', dataIndex: 'unit', width: '10%', 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 : '--') } },
-        { title: '小计', dataIndex: 'subtotal', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '小计', dataIndex: 'subtotal', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowCost')) { //  成本价权限

+ 1 - 1
src/views/purchasingManagement/bulkWarehousingOrder/importGuideModal.vue

@@ -15,7 +15,7 @@
             <span>1</span>准备导入
           </div>
           <ul>
-            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“数量”的列,且名称必须与系统相同</li>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“数量”、“成本价”的列,且名称必须相同</li>
             <li>2) 除了“产品编码”、“数量”、“成本价”三列,其他列可自定义,不影响数据导入</li>
             <li>3) “成本价”为0或输入的价格与系统相同时,允许导入,成本价为0按赠品处理</li>
           </ul>

+ 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: {

+ 1 - 1
vue.config.js

@@ -107,7 +107,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.0.216:8602/ocs-admin',
+        // target: 'http://192.168.0.183:8602/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
         target: 'http://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,