Browse Source

Merge branch 'deploy' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into deploy

lilei 4 years ago
parent
commit
08cf7fa714

+ 37 - 0
src/api/allocLinkageOut.js

@@ -19,6 +19,13 @@ export const allocLinkageOutSave = (params) => {
     method: 'post'
   })
 }
+//  连锁调拨调出   提交
+export const allocLinkageOutSubmit = (params) => {
+  return axios({
+    url: `/allocLinkageOut/submit/${params.sn}`,
+    method: 'get'
+  })
+}
 //  连锁调拨调出 详情 列表  分页
 export const allocLinkageOutDetailList = (params) => {
   const url = `/allocLinkageOut/detail/queryPage/${params.pageNo}/${params.pageSize}`
@@ -37,6 +44,36 @@ export const allocLinkageOutDetailSn = (params) => {
     method: 'get'
   })
 }
+//  连锁调拨调出  详情  添加
+export const allocLinkageOutDetailSave = (params) => {
+  return axios({
+    url: '/allocLinkageOut/detail/save',
+    data: params,
+    method: 'post'
+  })
+}
+//  连锁调拨调出  详情  删除
+export const allocLinkageOutDetailDel = (params) => {
+  return axios({
+    url: `/allocLinkageOut/detail/delete/${params.id}`,
+    method: 'get'
+  })
+}
+//  连锁调拨调出  详情  整单删除
+export const allocLinkageOutDetailDelAll = (params) => {
+  return axios({
+    url: `/allocLinkageOut/detail/deleteAll/${params.allocationLinkageOutSn}`,
+    method: 'get'
+  })
+}
+//  连锁调拨调出  详情  合计
+export const allocLinkageOutDetailCount = (params) => {
+  return axios({
+    url: '/allocLinkageOut/detail/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
 //  连锁调拨调出   调往对象
 export const getTenantList = (params) => {
   return axios({

+ 1 - 1
src/views/allocationManagement/chainTransferOut/basicInfoModal.vue

@@ -19,7 +19,7 @@
       <a-form-model-item label="调出产品类型" prop="allocationType">
         <v-select
           v-model="form.allocationType"
-          ref="billStatus"
+          ref="allocationType"
           id="chainTransferOut-basicInfo-allocationType"
           code="ALLOCATION_LINKAGE_PRODUCT_TYPE"
           placeholder="请选择调出产品类型"

+ 136 - 47
src/views/allocationManagement/chainTransferOut/edit.vue

@@ -18,7 +18,7 @@
         <a-collapse-panel key="1" header="选择产品">
           <!-- 筛选条件 -->
           <div class="table-page-search-wrapper">
-            <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-form layout="inline" @keyup.enter.native="getProductList(1)">
               <a-row :gutter="15">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="产品编码" prop="productCode">
@@ -72,7 +72,7 @@
                   </a-col>
                 </template>
                 <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
-                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chainTransferOutEdit-refresh">查询</a-button>
+                  <a-button type="primary" @click="getProductList(1)" :disabled="disabled" id="chainTransferOutEdit-refresh">查询</a-button>
                   <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutEdit-reset">重置</a-button>
                   <a @click="advanced=!advanced" style="margin-left: 8px">
                     {{ advanced ? '收起' : '展开' }}
@@ -89,6 +89,7 @@
             size="small"
             :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
             :columns="columns"
+            :customRow="handleClickRow"
             :dataSource="loadData"
             :scroll="{ x: 1610, y: 300 }"
             bordered>
@@ -117,7 +118,7 @@
         <a-collapse-panel key="1" header="已选产品">
           <!-- 总计 -->
           <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">总成本:¥<strong>6.33</strong>,总数量: <strong>6</strong> ,总款数: <strong>6</strong> </div>
+            <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
           </a-alert>
           <!-- 筛选条件 -->
           <a-row :gutter="15" justify="space-between">
@@ -126,18 +127,18 @@
                 <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
                   <a-row :gutter="15">
                     <a-col :md="9" :sm="24">
-                      <a-form-item label="产品编码" prop="name">
-                        <a-input id="chainTransferOutEdit-name" v-model="queryParam.name" placeholder="请输入产品编码" allowClear />
+                      <a-form-item label="产品编码" prop="productCode">
+                        <a-input id="chainTransferOutEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
                       </a-form-item>
                     </a-col>
                     <a-col :md="9" :sm="24">
-                      <a-form-item label="产品名称" prop="name">
-                        <a-input id="chainTransferOutEdit-name" v-model="queryParam.name" placeholder="请输入产品名称" allowClear />
+                      <a-form-item label="产品名称" prop="productName">
+                        <a-input id="chainTransferOutEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
                       </a-form-item>
                     </a-col>
                     <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
-                      <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="disabled" id="chainTransferOutList-refresh">查询</a-button>
-                      <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutList-reset">重置</a-button>
+                      <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="chainTransferOutList-refresh">查询</a-button>
+                      <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="chainTransferOutList-reset">重置</a-button>
                     </a-col>
                   </a-row>
                 </a-form>
@@ -145,7 +146,7 @@
             </a-col>
             <a-col :span="7">
               <a-button size="small" style="margin-left: 8px" id="chainTransferOutEdit-import-btn">导入明细</a-button>
-              <a-button size="small" type="danger" style="margin-left: 8px" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
+              <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
             </a-col>
           </a-row>
           <!-- 列表 -->
@@ -182,7 +183,8 @@
 
 <script>
 import { STable, VSelect } from '@/components'
-import { allocLinkageOutDetailSn, allocLinkageOutDetailList } from '@/api/allocLinkageOut'
+import { getOperationalPrecision } from '@/libs/tools.js'
+import { allocLinkageOutDetailSn, allocLinkageOutDetailList, allocLinkageOutDetailSave, allocLinkageOutDetailDel, allocLinkageOutDetailCount, allocLinkageOutSubmit, allocLinkageOutDetailDelAll } from '@/api/allocLinkageOut'
 import { productQuery } from '@/api/allocWarehouse'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
@@ -206,6 +208,7 @@ export default {
       productType: [],
       warehouseList: [], //  仓库  下拉数据
       disabled: false, //  查询、重置按钮是否可操作
+      chooseDisabled: false,
       advanced: false, // 高级搜索 展开/关闭
       // 表头
       columns: [
@@ -239,28 +242,32 @@ export default {
       // 表头
       chooseColumns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'creatDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'custNahme', align: 'center', ellipsis: true },
-        { title: '原厂编码', dataIndex: 'totalP', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'custsNsame', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'custsNdame', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'custsNafme', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价(¥)', dataIndex: 'storageQuantity', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'custsNsagme', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', dataIndex: 'outCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '调出数量', dataIndex: 'outQty', width: 150, align: 'center' },
-        { title: '成本小计(¥)', dataIndex: 'custsNagme', width: 115, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本小计', dataIndex: 'costSubtotal', width: 115, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
-        this.disabled = true
-        return allocLinkageOutDetailList(Object.assign(parameter, this.chooseQueryParam, { allocationLinkageOutSn: this.$route.params.sn })).then(res => {
+        this.chooseDisabled = true
+        const params = Object.assign(parameter, this.chooseQueryParam, { allocationLinkageOutSn: this.$route.params.sn })
+        return allocLinkageOutDetailList(params).then(res => {
           const 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
+            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
           }
-          this.disabled = false
+          this.chooseDisabled = false
+          this.getDetailCount(params)
           return data
         })
       },
@@ -271,30 +278,111 @@ export default {
   methods: {
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
-      this.$refs.table.refresh(true)
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.productOrigCode = ''
+      this.queryParam.warehouseSn = undefined
+      this.queryParam.brandSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.getProductList(1)
+    },
+    // 已选产品  重置
+    chooseResetSearchForm () {
+      this.chooseQueryParam.productCode = ''
+      this.chooseQueryParam.productName = ''
+      this.$refs.chooseTable.refresh(true)
+    },
+    // 双击快速添加
+    handleClickRow (record) {
+      return {
+        on: {
+          dblclick: (event) => {
+            this.handleAdd(record)
+          }
+        }
+      }
     },
     // 基本信息
     getDetail () {
       allocLinkageOutDetailSn({ sn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data
+          this.getProductList(1)
+          this.getProductBrand()
+          this.getProductType()
         } else {
           this.basicInfoData = null
         }
       })
     },
-    //  添加
-    handleAdd (row) {},
+    //  添加/编辑
+    handleAdd (row, isEdit) {
+      if (!isEdit && !row.outQty) {
+        this.$message.warning('请输入调出数量')
+        return
+      }
+      const params = {
+        id: isEdit ? row.id : undefined,
+        allocationLinkageOutSn: this.$route.params.sn,
+        outCost: isEdit ? row.outCost : row.putCost,
+        outQty: row.outQty,
+        productSn: row.productSn,
+        productProduceDate: row.productProduceDate,
+        productExpiryDate: row.productExpiryDate,
+        warehouseSn: row.warehouseSn,
+        warehouseLocationSn: row.warehouseLocationSn
+      }
+      allocLinkageOutDetailSave(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.getProductList()
+          this.$refs.chooseTable.refresh()
+        }
+      })
+    },
     //  删除
-    handleDel (row) {},
+    handleDel (row, isAll) {
+      const _this = this
+      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      this.$confirm({
+        title: '提示',
+        content: content,
+        centered: true,
+        onOk () {
+          if (isAll) { //  整单删除
+            allocLinkageOutDetailDelAll({ allocationLinkageOutSn: _this.$route.params.sn }).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.getProductList()
+                _this.$refs.chooseTable.refresh()
+              }
+            })
+          } else { //  单个删除
+            allocLinkageOutDetailDel({ id: row.id }).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.getProductList()
+                _this.$refs.chooseTable.refresh()
+              }
+            })
+          }
+        }
+      })
+    },
     //  提交
-    handleSubmit () {},
+    handleSubmit () {
+      const _this = this
+      allocLinkageOutSubmit({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          setTimeout(() => {
+            _this.handleBack()
+          }, 1000)
+        }
+      })
+    },
     //  导入明细
     handleImport () {
       console.log(333)
@@ -312,11 +400,12 @@ export default {
     getProductList (pageNo) {
       this.disabled = true
       this.pageNo = pageNo || this.pageNo
+      // 箭冠品牌 sysFlag传1,非箭冠品牌传0。与新增时所选调出产品类型有关
+      this.queryParam.sysFlag = this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0'
       const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
       productQuery(params).then(res => {
         if (res.status == 200) {
           const data = res.data
-          console.log(data)
           this.paginationProps.total = Number(res.data.count) || 0
           this.paginationProps.current = data.pageNo
           const no = (data.pageNo - 1) * data.pageSize
@@ -332,12 +421,15 @@ export default {
         }
       })
     },
-    // 已选产品 调出数量  blur
-    outQtyBlur (val, record) {
-      //  光标移出,值发生改变再调用编辑接口
-      if (val != record.outQtyBackups) {
-        this.handleAdd(record, 'edit')
-      }
+    // 合计
+    getDetailCount (params) {
+      allocLinkageOutDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = null
+        }
+      })
     },
     //  产品分类  change
     changeProductType (val, opt) {
@@ -347,8 +439,8 @@ export default {
     },
     //  产品品牌  列表
     getProductBrand () {
-      // sysFlag不传,此处应查询所有产品
-      dealerProductBrandQuery({}).then(res => {
+      // sysFlag为1查询箭冠产品,为0查询非箭冠产品
+      dealerProductBrandQuery({ sysFlag: this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0' }).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -358,7 +450,7 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      dealerProductTypeList({}).then(res => {
+      dealerProductTypeList({ sysFlag: this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0' }).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {
@@ -380,10 +472,7 @@ export default {
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.getDetail()
-      vm.getProductList(1)
       vm.getWarehouseList()
-      vm.getProductBrand()
-      vm.getProductType()
     })
   }
 }

+ 3 - 3
src/views/bulkManagement/bulkWarehousingOrder/list.vue

@@ -118,18 +118,18 @@
         <a-button
           size="small"
           type="link"
-          v-else-if="record.state == 'WAIT_PUT_WAREHOUSE'"
+          v-if="record.state == 'WAIT_PUT_WAREHOUSE'"
           @click="handleWarehouse(record)"
           class="button-warning"
           id="bulkWarehousingOrderList-warehouse-btn">入库</a-button>
         <a-button
           size="small"
           type="link"
-          v-else-if="record.state != 'FINISH'"
+          v-if="record.state != 'FINISH'"
           @click="handleDel(record)"
           class="button-error"
           id="bulkWarehousingOrderList-del-btn">删除</a-button>
-        <span v-else>--</span>
+        <span v-if="(record.state == 'FINISH') && (record.state != 'WAIT_PUT_WAREHOUSE')">--</span>
       </template>
     </s-table>
     <!-- 选择基本信息弹框 -->

+ 14 - 1
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -22,6 +22,11 @@
       :data="loadData"
       :scroll="{ x: 1340 }"
       bordered>
+      <!-- 库存数量 -->
+      <template slot="currentQty" slot-scope="text, record">
+        {{ record.currentQty }}
+        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
+      </template>
     </s-table>
     <div class="btn-cont">
       <a-button id="inventoryQueryDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
@@ -63,7 +68,7 @@ export default {
         { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'putQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存数量', scopedSlots: { customRender: 'currentQty' }, width: 100, align: 'center' },
         { title: '成本单价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -112,6 +117,14 @@ export default {
       if (!newValue) {
         this.$emit('close')
       }
+    },
+    itemId (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        const _this = this
+        setTimeout(() => {
+          _this.$refs.table.refresh(true)
+        }, 300)
+      }
     }
   }
 }

+ 6 - 1
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -90,6 +90,11 @@
         <span v-if="record.productTypeName2">{{ record.productTypeName2 || '' }} ></span>
         <span v-if="record.productTypeName3">{{ record.productTypeName3 || '' }}</span>
       </template>
+      <!-- 现有库存数量 -->
+      <template slot="currentStockQty" slot-scope="text, record">
+        {{ record.currentStockQty }}
+        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
+      </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button size="small" type="link" class="button-success" @click="goDetail(record)" id="inventoryQueryList-detail-btn">库存详情</a-button>
@@ -140,7 +145,7 @@ export default {
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品品牌', dataIndex: 'brandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productTypeName' }, width: 240, align: 'center' },
-        { title: '现有库存数量(个)', dataIndex: 'currentStockQty', width: 165, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '现有库存数量(个)', scopedSlots: { customRender: 'currentStockQty' }, width: 165, align: 'center', sorter: true },
         { title: '现有库存成本(¥)', dataIndex: 'currentStockCost', width: 165, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
       ],

+ 0 - 2
src/views/purchasingManagement/purchaseReturn/edit.vue

@@ -252,8 +252,6 @@ export default {
     },
     // 导入明细
     handleImport () {},
-    // 整单删除
-    handleDelAll () {},
     //  删除
     handleDel (row, isAll) {
       const _this = this

+ 0 - 1
src/views/salesManagement/outboundOrder/list.vue

@@ -91,7 +91,6 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :showPagination="false"
       :scroll="{ x: 1700, y: tableHeight }"
       bordered>
       <!-- 操作 -->