lilei преди 3 години
родител
ревизия
3ddb8b4cff
променени са 2 файла, в които са добавени 131 реда и са изтрити 113 реда
  1. 20 2
      src/views/allocationManagement/storeTransferOut/edit.vue
  2. 111 111
      src/views/productManagement/productInfo/list.vue

+ 20 - 2
src/views/allocationManagement/storeTransferOut/edit.vue

@@ -73,6 +73,21 @@
               :scroll="{ y: 300 }"
               :defaultLoadData="false"
               bordered>
+              <!-- 调出数量 -->
+              <template slot="outQty" slot-scope="text, record">
+                <div @dblclick.stop>
+                  <a-input-number
+                    size="small"
+                    v-if="record.currentQty"
+                    v-model="record.outQty"
+                    :precision="0"
+                    :min="1"
+                    :max="record.currentQty"
+                    placeholder="请输入"
+                    style="width: 100%;" />
+                  <span v-else>--</span>
+                </div>
+              </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
                 <a-button
@@ -223,6 +238,7 @@ export default {
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '库存数量', dataIndex: 'currentQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '成本价(¥)', dataIndex: 'putCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -233,6 +249,7 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
+            data.list[i].outQty = 1
           }
           this.disabled = false
           return data
@@ -305,6 +322,7 @@ export default {
       return {
         on: {
           dblclick: (event) => {
+            event.stopPropagation()
             this.handleAdd(record)
           }
         }
@@ -332,7 +350,7 @@ export default {
         id: isEdit ? row.id : undefined,
         storeCallOutSn: this.$route.params.sn,
         outCost: isEdit ? row.outCost : row.putCost,
-        outQty: isEdit ? row.outQty : 1, //  添加时调出数量默认为1
+        outQty: row.outQty, //  添加时调出数量默认为1
         productSn: row.productSn,
         productCode: row.productCode,
         productOrigCode: row.productOrigCode || undefined,
@@ -354,7 +372,7 @@ export default {
       storeCallOutDetailSave(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
-          this.$refs.table.refresh()
+          // this.$refs.table.refresh()
           this.$refs.chooseTable.refresh()
           this.spinning = false
         } else {

+ 111 - 111
src/views/productManagement/productInfo/list.vue

@@ -17,7 +17,7 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品品牌">
-                  <ProductBrand id="productInfoList-productBrandSn" :sysFlag="0" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
+                  <ProductBrand id="productInfoList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -118,18 +118,18 @@
 </template>
 
 <script>
-import { commonMixin } from '@/utils/mixin';
-import ProductType from '../../common/productType.js';
-import ProductBrand from '../../common/productBrand.js';
-import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct';
-import { STable, VSelect } from '@/components';
-import productInfoDetailModal from './detailModal.vue';
-import { downloadExcel } from '@/libs/JGPrint.js';
+import { commonMixin } from '@/utils/mixin'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct'
+import { STable, VSelect } from '@/components'
+import productInfoDetailModal from './detailModal.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'ProductList',
   components: { STable, VSelect, productInfoDetailModal, ProductType, ProductBrand },
   mixins: [commonMixin],
-  data() {
+  data () {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
@@ -156,8 +156,8 @@ export default {
           dataIndex: 'code',
           width: '12%',
           align: 'center',
-          customRender: function(text) {
-            return text || '--';
+          customRender: function (text) {
+            return text || '--'
           }
         },
         {
@@ -166,8 +166,8 @@ export default {
           width: '13%',
           align: 'center',
           ellipsis: true,
-          customRender: function(text) {
-            return text || '--';
+          customRender: function (text) {
+            return text || '--'
           }
         },
         {
@@ -175,8 +175,8 @@ export default {
           dataIndex: 'origCode',
           width: '11%',
           align: 'center',
-          customRender: function(text) {
-            return text || '--';
+          customRender: function (text) {
+            return text || '--'
           }
         },
         {
@@ -184,8 +184,8 @@ export default {
           dataIndex: 'productBrandName',
           width: '9%',
           align: 'center',
-          customRender: function(text) {
-            return text || '--';
+          customRender: function (text) {
+            return text || '--'
           }
         },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '9%', align: 'center' },
@@ -194,8 +194,8 @@ export default {
           dataIndex: 'specialPrice',
           width: '7%',
           align: 'center',
-          customRender: function(text) {
-            return text || text == 0 ? text : '--';
+          customRender: function (text) {
+            return text || text == 0 ? text : '--'
           }
         },
         {
@@ -203,8 +203,8 @@ export default {
           dataIndex: 'terminalPrice',
           width: '6%',
           align: 'center',
-          customRender: function(text) {
-            return text || text == 0 ? text : '--';
+          customRender: function (text) {
+            return text || text == 0 ? text : '--'
           }
         },
         {
@@ -212,8 +212,8 @@ export default {
           dataIndex: 'carOwnersPrice',
           width: '6%',
           align: 'center',
-          customRender: function(text) {
-            return text || text == 0 ? text : '--';
+          customRender: function (text) {
+            return text || text == 0 ? text : '--'
           }
         },
         {
@@ -221,8 +221,8 @@ export default {
           dataIndex: 'createDate',
           width: '7%',
           align: 'center',
-          customRender: function(text) {
-            return text || '--';
+          customRender: function (text) {
+            return text || '--'
           }
         },
         { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: '7%', align: 'center' },
@@ -230,166 +230,166 @@ export default {
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        this.disabled = true;
-        this.spinning = true;
+        this.disabled = true
+        this.spinning = true
         return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
-          let data;
+          let data
           if (res.status == 200) {
-            data = res.data;
-            const no = (data.pageNo - 1) * data.pageSize;
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1;
-              const productTypeName1 = data.list[i].productTypeName1 ? data.list[i].productTypeName1 : '';
-              const productTypeName2 = data.list[i].productTypeName2 ? ' > ' + data.list[i].productTypeName2 : '';
-              const productTypeName3 = data.list[i].productTypeName3 ? ' > ' + data.list[i].productTypeName3 : '';
-              data.list[i].productTypeName = productTypeName1 + productTypeName2 + productTypeName3;
+              data.list[i].no = no + i + 1
+              const productTypeName1 = data.list[i].productTypeName1 ? data.list[i].productTypeName1 : ''
+              const productTypeName2 = data.list[i].productTypeName2 ? ' > ' + data.list[i].productTypeName2 : ''
+              const productTypeName3 = data.list[i].productTypeName3 ? ' > ' + data.list[i].productTypeName3 : ''
+              data.list[i].productTypeName = productTypeName1 + productTypeName2 + productTypeName3
             }
-            this.disabled = false;
+            this.disabled = false
           }
-          this.spinning = false;
-          return data;
-        });
+          this.spinning = false
+          return data
+        })
       },
       openModal: false, //  查看客户详情  弹框
       itemId: '', //  当前产品id
       productBrandList: [], //  品牌下拉数据
       productTypeList: [] //  分类下拉数据
-    };
+    }
   },
   methods: {
     //  重置
-    resetSearchForm() {
-      this.queryParam.code = '';
-      this.queryParam.name = '';
-      this.queryParam.origCode = '';
-      this.queryParam.productBrandSn = undefined;
-      this.queryParam.productTypeSn1 = '';
-      this.queryParam.productTypeSn2 = '';
-      this.queryParam.productTypeSn3 = '';
-      this.queryParam.enabledFlag = undefined;
-      this.productType = [];
-      this.$refs.table.refresh(true);
+    resetSearchForm () {
+      this.queryParam.code = ''
+      this.queryParam.name = ''
+      this.queryParam.origCode = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.enabledFlag = undefined
+      this.productType = []
+      this.$refs.table.refresh(true)
     },
     //  新增/编辑
-    handleEdit(row) {
+    handleEdit (row) {
       if (row) {
         //  编辑
-        this.$router.push({ path: `/productManagement/productInfo/edit/${row.id}` });
+        this.$router.push({ path: `/productManagement/productInfo/edit/${row.id}` })
       } else {
         //  新增
-        this.$router.push({ path: '/productManagement/productInfo/add' });
+        this.$router.push({ path: '/productManagement/productInfo/add' })
       }
     },
     //  批量导入
-    handleImport() {},
-    filterOption(input, option) {
-      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
+    handleImport () {},
+    filterOption (input, option) {
+      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     },
     //  详情
-    handleDetail(row) {
-      this.itemId = row.id;
-      this.openModal = true;
+    handleDetail (row) {
+      this.itemId = row.id
+      this.openModal = true
     },
     //  关闭弹框
-    closeModal() {
-      this.itemId = '';
-      this.openModal = false;
+    closeModal () {
+      this.itemId = ''
+      this.openModal = false
     },
     //  产品分类  change
-    changeProductType(val, opt) {
-      this.queryParam.productTypeSn1 = val[0] ? val[0] : '';
-      this.queryParam.productTypeSn2 = val[1] ? val[1] : '';
-      this.queryParam.productTypeSn3 = val[2] ? val[2] : '';
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
     // 启用 禁用
-    changeStatus(record) {
+    changeStatus (record) {
       if (record.enabledFlag == '1') {
         this.$confirm({
           title: '提示',
           content: '产品被禁用后,不能再销售,确定禁用吗?',
           centered: true,
           onOk: () => {
-            this.setEnable(record);
+            this.setEnable(record)
           }
-        });
+        })
       } else {
-        this.setEnable(record);
+        this.setEnable(record)
       }
     },
     // 启用 禁用
-    setEnable(record) {
+    setEnable (record) {
       const params = {
         id: record.id,
         enabledFlag: record.enabledFlag == 1 ? '0' : '1'
-      };
-      this.spinning = true;
+      }
+      this.spinning = true
       dealerProductUpdate(params).then(res => {
         if (res.status == 200) {
-          this.$message.success(res.message);
-          this.$refs.table.refresh();
-          this.spinning = false;
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.spinning = false
         } else {
-          this.$refs.table.refresh();
-          this.spinning = false;
+          this.$refs.table.refresh()
+          this.spinning = false
         }
-      });
+      })
     },
     //  导出
-    handleExport() {
-      this.exportLoading = true;
-      this.spinning = true;
+    handleExport () {
+      this.exportLoading = true
+      this.spinning = true
       dealerProductExport(this.queryParam).then(res => {
-        this.exportLoading = false;
-        this.spinning = false;
-        downloadExcel(res, '自建产品列表');
-      });
+        this.exportLoading = false
+        this.spinning = false
+        downloadExcel(res, '自建产品列表')
+      })
     },
-    pageInit() {
-      const _this = this;
+    pageInit () {
+      const _this = this
       this.$nextTick(() => {
         // 页面渲染完成后的回调
-        _this.setTableH();
-      });
+        _this.setTableH()
+      })
     },
-    setTableH() {
-      const tableSearchH = this.$refs.tableSearch.offsetHeight;
-      this.tableHeight = window.innerHeight - tableSearchH - 235;
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 235
     }
   },
   watch: {
-    advanced(newValue, oldValue) {
-      const _this = this;
+    advanced (newValue, oldValue) {
+      const _this = this
       this.$nextTick(() => {
         // 页面渲染完成后的回调
-        _this.setTableH();
-      });
+        _this.setTableH()
+      })
     },
-    '$store.state.app.winHeight'(newValue, oldValue) {
+    '$store.state.app.winHeight' (newValue, oldValue) {
       //  窗口变更时,需同时更改表格高度
-      this.setTableH();
+      this.setTableH()
     }
   },
-  mounted() {
+  mounted () {
     if (!this.$store.state.app.isNewTab) {
       // 页签刷新时调用
-      this.pageInit();
-      this.resetSearchForm();
+      this.pageInit()
+      this.resetSearchForm()
     }
   },
-  activated() {
+  activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit();
-      this.resetSearchForm();
+      this.pageInit()
+      this.resetSearchForm()
     }
     // 仅刷新列表,不重置页面
     if (this.$store.state.app.updateList) {
-      this.pageInit();
-      this.$refs.table.refresh();
+      this.pageInit()
+      this.$refs.table.refresh()
     }
   },
-  beforeRouteEnter(to, from, next) {
-    next(vm => {});
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
   }
-};
+}
 </script>