Browse Source

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

lilei 4 years ago
parent
commit
8e6ec49a63

+ 96 - 0
src/api/allocateBill.js

@@ -0,0 +1,96 @@
+import { axios } from '@/utils/request'
+
+//  调拨管理 列表  分页
+export const allocateBillList = (params) => {
+  const url = `/allocateBill/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 调拨管理  新增
+export const allocateBillSave = params => {
+  return axios({
+    url: '/allocateBill/save',
+    data: params,
+    method: 'post'
+  })
+}
+// 调拨管理  详情
+export const allocateBillDel = params => {
+  return axios({
+    url: `/allocateBill/delete/${params.sn}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 调拨管理  删除
+export const allocateBillDetail = params => {
+  return axios({
+    url: `/allocateBill/findBySn/${params.sn}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 调拨管理  审核
+export const allocateBillAudit = params => {
+  return axios({
+    url: `/allocateBill/audit/${params.sn}/${params.state}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 调拨管理  提交
+export const allocateBillSubmit = params => {
+  return axios({
+    url: `/allocateBill/submit/${params.sn}`,
+    data: {},
+    method: 'get'
+  })
+}
+//  调拨管理  明细 列表  分页
+export const allocateBillDetailList = (params) => {
+  const url = `/allocateBill/detail/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  调拨管理  明细 列表  合计
+export const allocateBillDetailCount = (params) => {
+  return axios({
+    url: '/allocateBill/detail/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 调拨管理  详情  删除
+export const allocateBillDetailDel = params => {
+  return axios({
+    url: `/allocateBill/detail/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 调拨管理  详情  整单删除
+export const allocateBillDetailDelAll = params => {
+  return axios({
+    url: `/allocateBill/detail/deleteAll/${params.sn}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 调拨管理  详情  保存
+export const allocateBillDetailSave = params => {
+  return axios({
+    url: '/allocateBill/detail/save',
+    data: params,
+    method: 'post'
+  })
+}

+ 8 - 0
src/api/allocateType.js

@@ -11,6 +11,14 @@ export const allocateTypeList = (params) => {
     method: 'post'
   })
 }
+// 调拨类型管理 列表  无分页
+export const allocateTypeAllList = params => {
+  return axios({
+    url: '/allocateType/queryList',
+    data: params,
+    method: 'post'
+  })
+}
 // 调拨类型管理  新增/编辑
 export const allocateTypeSave = params => {
   return axios({

+ 2 - 2
src/api/warehouse.js

@@ -31,7 +31,7 @@ export const warehouseSave = params => {
 // 删除仓库
 export const warehouseDel = params => {
   return axios({
-    url: `/warehouse/delete/${params.id}`,
+    url: `/warehouse/delete/${params.sn}`,
     data: {},
     method: 'get'
   })
@@ -70,7 +70,7 @@ export const warehouseLocSave = params => {
 // 删除仓位
 export const warehouseLocDel = params => {
   return axios({
-    url: `/warehouseLoc/delete/${params.id}`,
+    url: `/warehouseLoc/delete/${params.sn}`,
     data: {},
     method: 'get'
   })

+ 3 - 3
src/config/router.config.js

@@ -760,7 +760,7 @@ export const asyncRouterMap = [
                   hidden: true
                   // permission: 'M_outboundOrder_list'
                 }
-              },
+              }
             ]
           },
           {
@@ -1166,7 +1166,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'add/:id/:sn',
+                path: 'add/:id/:sn/:name',
                 name: 'transferOutAdd',
                 component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/transferOut/edit.vue'),
                 meta: {
@@ -1177,7 +1177,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'edit/:id/:sn',
+                path: 'edit/:id/:sn/:name',
                 name: 'transferOutEdit',
                 component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/transferOut/edit.vue'),
                 meta: {

+ 79 - 73
src/views/allocationManagement/transferOut/basicInfoModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="storeTransferOut-basicInfo-modal"
+    class="allocateBill-basicInfo-modal"
     :footer="null"
     :maskClosable="false"
     title="新增"
@@ -9,54 +9,58 @@
     @cancle="isShow = false"
     width="80%">
     <a-form-model
-      id="storeTransferOut-basicInfo-form"
+      id="allocateBill-basicInfo-form"
       ref="ruleForm"
       :model="form"
       :rules="rules"
       :label-col="formItemLayout.labelCol"
       :wrapper-col="formItemLayout.wrapperCol"
     >
-      <a-form-model-item label="调往对象" prop="putPersonType">
-        <a-radio-group v-model="form.putPersonType" @change="putPersonTypeChange">
-          <a-radio v-for="(item,index) in putPersonTypeList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
+      <a-form-model-item label="调往对象" prop="targetType">
+        <a-radio-group v-model="form.targetType" @change="targetTypeChange">
+          <a-radio v-for="(item,index) in targetTypeList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
         </a-radio-group>
       </a-form-model-item>
-      <a-form-model-item label="调往对象名称" :prop="isCustomer ? 'putPersonSn' : 'putPersonName'">
+      <a-form-model-item label="调往对象名称" :prop="isDealer ? 'targetSn' : 'targetName'">
         <a-select
-          v-if="isCustomer"
-          v-model="form.putPersonSn"
+          v-if="isDealer"
+          show-search
+          id="allocateBill-basicInfo-dealerName"
+          v-model="form.targetSn"
           placeholder="请选择"
-          allowClear
-          :showSearch="true"
-          option-filter-prop="children"
-          :filter-option="filterOption"
-          @change="putPersonChange">
-          <a-select-option v-for="item in custData" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</a-select-option>
+          :filter-option="false"
+          :not-found-content="fetching ? undefined : null"
+          @search="fetchUser"
+          @change="handleChange"
+        >
+          <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+          <a-select-option v-for="item in dealerData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
         </a-select>
-        <a-input v-if="!isCustomer" v-model="form.putPersonName" placeholder="请输入调往对象名称(最多30个字符)" allowClear :maxLength="30" />
+        <a-input v-if="!isDealer" v-model="form.targetName" placeholder="请输入调往对象名称(最多30个字符)" allowClear :maxLength="30" />
       </a-form-model-item>
-      <a-form-model-item label="调拨类型" prop="callOutType">
-        <a-select v-model="form.callOutType" placeholder="请选择调拨类型" allowClear >
-          <a-select-option v-for="item in storeCallOutTypeList" :key="item.storeCallOutTypeSn" :value="item.storeCallOutTypeSn">{{ item.name }}</a-select-option>
+      <a-form-model-item label="调拨类型" prop="allocateTypeSn">
+        <a-select id="allocateBill-basicInfo-allocateTypeSn" v-model="form.allocateTypeSn" placeholder="请选择调拨类型" allowClear >
+          <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
         </a-select>
       </a-form-model-item>
       <a-form-model-item label="备注" prop="remark">
-        <a-textarea id="storeTransferOut-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
+        <a-textarea id="allocateBill-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
       </a-form-model-item>
     </a-form-model>
     <div class="btn-cont">
-      <a-button type="primary" id="storeTransferOut-basicInfo-modal-save" @click="handleSave">保存</a-button>
-      <a-button id="storeTransferOut-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      <a-button type="primary" id="allocateBill-basicInfo-modal-save" @click="handleSave">保存</a-button>
+      <a-button id="allocateBill-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
     </div>
   </a-modal>
 </template>
 
 <script>
+import debounce from 'lodash/debounce'
 import { VSelect } from '@/components'
-import { storeCallOutSave } from '@/api/storeCallOut'
-import { custAllList } from '@/api/customer'
+import { allocateBillSave } from '@/api/allocateBill'
+import { dealerQueryList } from '@/api/dealer'
 import { getLookUpData } from '@/api/data'
-import { storeCallOutTypeAllList } from '@/api/storeCallOutType'
+import { allocateTypeAllList } from '@/api/allocateType'
 export default {
   name: 'StoreTransferOutBasicInfoModal',
   components: { VSelect },
@@ -68,6 +72,7 @@ export default {
     }
   },
   data () {
+    this.fetchUser = debounce(this.fetchUser, 800)
     return {
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
@@ -75,37 +80,57 @@ export default {
         wrapperCol: { span: 16 }
       },
       form: {
-        putPersonType: 'CUSTOMER',
-        putPersonSn: undefined,
-        putPersonName: '',
-        callOutType: undefined,
+        targetType: '1',
+        targetSn: undefined,
+        targetName: '',
+        allocateTypeSn: undefined,
         remark: ''
       },
       rules: {
-        putPersonType: [{ required: true, message: '请选择调往对象', trigger: 'change' }],
-        putPersonSn: [{ required: true, message: '请选择调往对象名称', trigger: 'change' }],
-        putPersonName: [{ required: true, message: '请输入调往对象名称', trigger: 'blur' }],
-        callOutType: [{ required: true, message: '请选择调拨类型', trigger: 'change' }]
+        targetType: [{ required: true, message: '请选择调往对象', trigger: 'change' }],
+        targetSn: [{ required: true, message: '请选择调往对象名称', trigger: 'change' }],
+        targetName: [{ required: true, message: '请输入调往对象名称', trigger: 'blur' }],
+        allocateTypeSn: [{ required: true, message: '请选择调拨类型', trigger: 'change' }]
       },
-      custData: [], //  调往对象  下拉数据
-      putPersonTypeList: [], //  调往对象类型
-      storeCallOutTypeList: [] //  调拨类型
+      fetching: false,
+      dealerData: [], //  经销商  下拉数据
+      targetTypeList: [], //  调往对象类型
+      allocateTypeList: [] //  调拨类型
     }
   },
   computed: {
-    // 当前所选调往对象是否为客户
-    isCustomer () {
-      return this.form.putPersonType == 'CUSTOMER'
+    // 当前所选调往对象是否为经销商
+    isDealer () {
+      return this.form.targetType == '1'
     }
   },
   methods: {
+    // 搜索经销商
+    fetchUser (value) {
+      console.log('fetching user', value)
+      this.fetching = true
+      dealerQueryList({ nameLike: value, pageNo: 1, pageSize: 20 }).then(res => {
+        if (res.status == 200) {
+          this.dealerData = res.data.list
+          this.fetching = false
+        } else {
+          this.dealerData = []
+          this.fetching = false
+        }
+      })
+    },
+    // 调往对象名称  change
+    handleChange (value) {
+      const ind = this.dealerData.findIndex(item => item.dealerSn == value)
+      this.form.targetName = this.dealerData[ind].dealerName
+    },
     //  保存
     handleSave () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
-          storeCallOutSave(form).then(res => {
+          allocateBillSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               setTimeout(() => {
@@ -121,54 +146,36 @@ export default {
       })
     },
     // 调往对象  change
-    putPersonTypeChange (e) {
+    targetTypeChange (e) {
       this.$refs.ruleForm.resetFields()
-      this.form.putPersonSn = undefined
-      this.form.putPersonName = ''
-      this.form.putPersonType = e.target.value
-    },
-    // 调往对象名称  change
-    putPersonChange (val) {
-      const ind = this.custData.findIndex(item => item.customerSn == val)
-      this.form.putPersonName = this.custData[ind].customerName
-    },
-    // 调往对象列表
-    getCustAllList () {
-      custAllList().then(res => {
-        if (res.status == 200) {
-          this.custData = res.data
-        } else {
-          this.custData = []
-        }
-      })
+      this.form.targetSn = undefined
+      this.form.targetName = ''
+      this.form.targetType = e.target.value
     },
     // 调往对象类型
-    getPutPersonTypeList () {
+    getTargetTypeList () {
       const _this = this
       getLookUpData({
         pageNo: 1,
         pageSize: 1000,
-        lookupCode: 'PUT_PERSON_TYPE'
+        lookupCode: 'TARGET_TYPE'
       }).then(res => {
         if (res.status == 200) {
-          _this.putPersonTypeList = res.data.list
+          _this.targetTypeList = res.data.list
         } else {
-          _this.putPersonTypeList = []
+          _this.targetTypeList = []
         }
       })
     },
     //  调拨类型
-    getStoreCallOutTypeAllList () {
-      storeCallOutTypeAllList().then(res => {
+    getAllocateTypeAllList () {
+      allocateTypeAllList().then(res => {
         if (res.status == 200) {
-          this.storeCallOutTypeList = res.data
+          this.allocateTypeList = res.data
         } else {
-          this.storeCallOutTypeList = []
+          this.allocateTypeList = []
         }
       })
-    },
-    filterOption (input, option) {
-      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     }
   },
   watch: {
@@ -182,9 +189,8 @@ export default {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
       } else {
-        this.getCustAllList()
-        this.getPutPersonTypeList()
-        this.getStoreCallOutTypeAllList()
+        this.getTargetTypeList()
+        this.getAllocateTypeAllList()
       }
     }
   }
@@ -192,7 +198,7 @@ export default {
 </script>
 
 <style lang="less">
-.storeTransferOut-basicInfo-modal {
+.allocateBill-basicInfo-modal {
 	.ant-modal-body {
 		padding: 40px 40px 24px;
 	}

+ 33 - 31
src/views/allocationManagement/transferOut/detail.vue

@@ -1,41 +1,40 @@
 <template>
-  <div class="storeTransferOutDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="storeTransferOutDetail-back" >
+  <div class="allocateBillDetail-wrap">
+    <a-page-header :ghost="false" :backIcon="false" class="allocateBillDetail-back" >
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
-        <a id="storeTransferOutDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        <a id="allocateBillDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         <a-button
           v-if="isEdit"
           type="primary"
           size="small"
           style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
-          id="storeTransferOutDetail-edit-btn"
+          id="allocateBillDetail-edit-btn"
           @click.stop="handleEdit">编辑</a-button>
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
-        <a-button key="2" id="storeTransferOutDetail-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="storeTransferOutDetail-print-btn">快速打印</a-button>
+        <a-button key="2" id="allocateBillDetail-preview-btn">打印预览</a-button>
+        <a-button key="1" type="primary" id="allocateBillDetail-print-btn">快速打印</a-button>
       </template>
     </a-page-header>
-    <a-card size="small" :bordered="false" class="storeTransferOutDetail-cont">
+    <a-card size="small" :bordered="false" class="allocateBillDetail-cont">
       <a-collapse :activeKey="['1']">
         <a-collapse-panel key="1" header="基础信息">
           <a-descriptions :column="3">
-            <a-descriptions-item label="调往对象名称">{{ (basicInfoData&&basicInfoData.putPersonName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="店内调出单号">{{ (basicInfoData&&basicInfoData.storeCallOutNo) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="调往对象">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="调拨单号">{{ (basicInfoData&&basicInfoData.allocateNo) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="调拨类型">{{ (basicInfoData&&basicInfoData.allocateTypeName) || '--' }}</a-descriptions-item>
             <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="财务状态">{{ (basicInfoData&&basicInfoData.settleStateDictValue) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="调拨类型">{{ (basicInfoData&&basicInfoData.callOutTypeName) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remark) || '--' }}</a-descriptions-item>
           </a-descriptions>
         </a-collapse-panel>
       </a-collapse>
     </a-card>
-    <a-card size="small" :bordered="false" class="storeTransferOutDetail-cont">
+    <a-card size="small" :bordered="false" class="allocateBillDetail-cont">
       <!-- 总计 -->
       <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
+        <div slot="message">总数量:<strong>{{ (productTotal&&productTotal.totalQty) || 0 }}</strong> ,总成本(¥):<strong>{{ (productTotal&&productTotal.totalCost) || 0 }}</strong> ,总售价(¥):<strong>{{ (productTotal&&productTotal.totalPrice) || 0 }}</strong></div>
       </a-alert>
       <!-- 列表 -->
       <s-table
@@ -45,7 +44,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 995 }"
+        :scroll="{ x: 1335 }"
         bordered>
       </s-table>
     </a-card>
@@ -55,7 +54,7 @@
 <script>
 import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
-import { storeCallOutDetailList, storeCallOutDetailCount, storeCallOutDetailSn } from '@/api/storeCallOut'
+import { allocateBillDetailList, allocateBillDetail, allocateBillDetailCount } from '@/api/allocateBill'
 export default {
   components: { STable, VSelect },
   data () {
@@ -63,23 +62,26 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
-        { title: '单位', dataIndex: 'productUnit', 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: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出数量', dataIndex: 'outQty', width: 100, align: 'center' },
-        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: 115, align: 'center' }
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: 115, align: 'center' },
+        { title: '售价小计(¥)', dataIndex: 'priceSubtotal', width: 100, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        return storeCallOutDetailList(Object.assign(parameter, { storeCallOutSn: this.$route.params.sn })).then(res => {
+        return allocateBillDetailList(Object.assign(parameter, { allocateSn: this.$route.params.sn })).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)
+            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].cost, data.list[i].qty)
+            data.list[i].priceSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
           }
           return data
         })
@@ -100,7 +102,7 @@ export default {
     },
     // 基本信息
     getDetail () {
-      storeCallOutDetailSn({ sn: this.$route.params.sn }).then(res => {
+      allocateBillDetail({ sn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data
         } else {
@@ -110,7 +112,7 @@ export default {
     },
     // 合计
     getDetailCount () {
-      storeCallOutDetailCount({ storeCallOutSn: this.$route.params.sn }).then(res => {
+      allocateBillDetailCount({ allocateSn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.productTotal = res.data
         } else {
@@ -120,7 +122,7 @@ export default {
     },
     //  编辑
     handleEdit () {
-      this.$router.push({ path: `/allocationManagement/transferOut/edit/${this.basicInfoData.id}/${this.basicInfoData.storeCallOutSn}` })
+      this.$router.push({ path: `/allocationManagement/transferOut/edit/${this.basicInfoData.id}/${this.basicInfoData.allocateSn}/${this.basicInfoData.targetName}` })
     }
   },
   beforeRouteEnter (to, from, next) {
@@ -133,11 +135,11 @@ export default {
 </script>
 
 <style lang="less">
-  .storeTransferOutDetail-wrap{
-    .storeTransferOutDetail-back{
+  .allocateBillDetail-wrap{
+    .allocateBillDetail-back{
       margin-bottom: 15px;
     }
-    .storeTransferOutDetail-cont{
+    .allocateBillDetail-cont{
       margin-bottom: 15px;
     }
   }

+ 88 - 195
src/views/allocationManagement/transferOut/edit.vue

@@ -1,19 +1,19 @@
 <template>
-  <div class="storeTransferOutEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="storeTransferOutEdit-back" >
+  <div class="allocateBillEdit-wrap">
+    <a-page-header :ghost="false" :backIcon="false" class="allocateBillEdit-back" >
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
-        <a id="storeTransferOutEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <span style="margin: 0 15px;color: #666;">调往对象名称:{{ (basicInfoData&&basicInfoData.putPersonName) || '--' }}</span>
+        <a id="allocateBillEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        <span style="margin: 0 15px;color: #666;">调往对象:{{ $route.params.name || '--' }}</span>
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
-        <a-button key="2" id="storeTransferOutEdit-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="storeTransferOutEdit-print-btn">快速打印</a-button>
+        <a-button key="2" id="allocateBillEdit-preview-btn">打印预览</a-button>
+        <a-button key="1" type="primary" id="allocateBillEdit-print-btn">快速打印</a-button>
       </template>
     </a-page-header>
     <!-- 选择产品 -->
-    <a-card size="small" :bordered="false" class="storeTransferOutEdit-cont">
+    <a-card size="small" :bordered="false" class="allocateBillEdit-cont">
       <a-collapse :activeKey="['1']">
         <a-collapse-panel key="1" header="选择产品">
           <!-- 筛选条件 -->
@@ -22,58 +22,22 @@
               <a-row :gutter="15">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="产品编码" prop="productCode">
-                    <a-input id="storeTransferOutEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+                    <a-input id="allocateBillEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
                   <a-form-item label="产品名称" prop="productName">
-                    <a-input id="storeTransferOutEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
+                    <a-input id="allocateBillEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
-                  <a-form-item label="仓库">
-                    <a-select id="storeTransferOutEdit-warehouseSn" placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
-                      <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-                    </a-select>
+                  <a-form-item label="原厂编码" prop="productOrigCode">
+                    <a-input id="allocateBillEdit-productOrigCode" v-model="queryParam.productOrigCode" placeholder="请输入原厂编码" allowClear />
                   </a-form-item>
                 </a-col>
-                <template v-if="advanced">
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="产品分类">
-                      <a-cascader
-                        @change="changeProductType"
-                        change-on-select
-                        v-model="productType"
-                        expand-trigger="hover"
-                        :options="productTypeList"
-                        :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                        id="storeTransferOutEdit-productType"
-                        placeholder="请选择产品分类"
-                        allowClear />
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="产品品牌">
-                      <a-select
-                        placeholder="请选择产品品牌"
-                        id="storeTransferOutEdit-brandSn"
-                        allowClear
-                        v-model="queryParam.brandSn"
-                        :showSearch="true"
-                        option-filter-prop="children"
-                        :filter-option="filterOption">
-                        <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-                      </a-select>
-                    </a-form-item>
-                  </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="storeTransferOutList-refresh">查询</a-button>
                   <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
-                  <a @click="advanced=!advanced" style="margin-left: 8px">
-                    {{ advanced ? '收起' : '展开' }}
-                    <a-icon :type="advanced ? 'up' : 'down'"/>
-                  </a>
                 </a-col>
               </a-row>
             </a-form>
@@ -83,43 +47,42 @@
             class="sTable"
             ref="table"
             size="small"
-            :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
+            :rowKey="(record) => record.stockSn"
             :columns="columns"
             :customRow="handleClickRow"
             :data="loadData"
-            :scroll="{ x: 1180, y: 300 }"
-            :defaultLoadData="false"
+            :scroll="{ x: 1240, y: 300 }"
             bordered>
             <!-- 操作 -->
             <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="storeTransferOutEdit-add-btn">添加</a-button>
+              <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="allocateBillEdit-add-btn">添加</a-button>
             </template>
           </s-table>
         </a-collapse-panel>
       </a-collapse>
     </a-card>
     <!-- 已选产品 -->
-    <a-card size="small" :bordered="false" class="storeTransferOutEdit-cont">
+    <a-card size="small" :bordered="false" class="allocateBillEdit-cont">
       <a-collapse :activeKey="['1']">
         <a-collapse-panel key="1" header="已选产品">
           <!-- 总计 -->
           <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
+            <div slot="message">总数量:<strong>{{ (productTotal&&productTotal.totalQty) || 0 }}</strong> ,总成本(¥):<strong>{{ (productTotal&&productTotal.totalCost) || 0 }}</strong> ,总售价(¥):<strong>{{ (productTotal&&productTotal.totalPrice) || 0 }}</strong></div>
           </a-alert>
           <!-- 筛选条件 -->
           <a-row :gutter="15">
-            <a-col :span="20">
+            <a-col :span="17">
               <div class="table-page-search-wrapper">
                 <a-form layout="inline" @keyup.enter.native="getChooseProductList(1)">
                   <a-row :gutter="15">
-                    <a-col :md="6" :sm="24">
+                    <a-col :md="9" :sm="24">
                       <a-form-item label="产品编码" prop="productCode">
-                        <a-input id="storeTransferOutEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                        <a-input id="allocateBillEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
                       </a-form-item>
                     </a-col>
-                    <a-col :md="6" :sm="24">
+                    <a-col :md="9" :sm="24">
                       <a-form-item label="产品名称" prop="productName">
-                        <a-input id="storeTransferOutEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                        <a-input id="allocateBillEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
                       </a-form-item>
                     </a-col>
                     <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
@@ -130,8 +93,9 @@
                 </a-form>
               </div>
             </a-col>
-            <a-col :span="4" style="text-align: right;">
-              <a-button size="small" id="storeTransferOutEdit-import-btn">导入明细</a-button>
+            <a-col :span="7" style="text-align: right;">
+              <a-button size="small" id="allocateBillEdit-import-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>
           <!-- 列表 -->
@@ -146,20 +110,20 @@
             :pagination="choosePaginationProps"
             bordered>
             <!-- 调出数量 -->
-            <template slot="outQty" slot-scope="text, record">
+            <template slot="qty" slot-scope="text, record">
               <a-input-number
-                id="storeTransferOutEdit-outQty"
-                v-model="record.outQty"
+                id="allocateBillEdit-qty"
+                v-model="record.qty"
                 :precision="0"
                 :min="1"
                 :max="999999"
                 placeholder="请输入"
-                @blur="e => outQtyBlur(e.target.value, record)"
+                @blur="e => qtyBlur(e.target.value, record)"
                 style="width: 100%;" />
             </template>
             <!-- 操作 -->
             <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="storeTransferOutEdit-del-btn">删除</a-button>
+              <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="allocateBillEdit-del-btn">删除</a-button>
             </template>
           </a-table>
         </a-collapse-panel>
@@ -169,7 +133,7 @@
       <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
         <a-button
           type="primary"
-          id="storeTransferOutEdit-submit"
+          id="allocateBillEdit-submit"
           size="large"
           class="button-primary"
           @click="handleSubmit"
@@ -181,12 +145,8 @@
 
 <script>
 import { STable, VSelect } from '@/components'
-import { getOperationalPrecision } from '@/libs/tools.js'
-import { storeCallOutDetailList, storeCallOutDetail, storeCallOutDetailCount, storeCallOutDetailSave, storeCallOutDetailDel, storeCallOutSubmit } from '@/api/storeCallOut'
-import { productBrandQuery } from '@/api/productBrand'
-import { productTypeList } from '@/api/productType'
-import { warehouseAllList } from '@/api/warehouse'
-import { productQuery } from '@/api/allocWarehouse'
+import { queryStockProductPage } from '@/api/stock'
+import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll } from '@/api/allocateBill'
 export default {
   components: { STable, VSelect },
   data () {
@@ -194,11 +154,7 @@ export default {
       queryParam: {
         productCode: '',
         productName: '',
-        warehouseSn: undefined,
-        brandSn: undefined,
-        productTypeSn1: undefined,
-        productTypeSn2: undefined,
-        productTypeSn3: undefined
+        productOrigCode: ''
       },
       chooseQueryParam: {
         productCode: '',
@@ -214,19 +170,19 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
-        { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本价(¥)', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', dataIndex: 'lastStockCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价', dataIndex: 'productPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存数量', dataIndex: 'currentStockQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return productQuery(Object.assign(parameter, this.queryParam)).then(res => {
+        return queryStockProductPage(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -239,14 +195,14 @@ export default {
       // 表头
       chooseColumns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
-        { title: '单位', dataIndex: 'productUnit', 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: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: 140, align: 'center' },
-        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: 115, align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存数量', dataIndex: 'currentStockQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出数量', scopedSlots: { customRender: 'qty' }, width: 140, align: 'center' },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       chooseLoadData: [],
@@ -259,7 +215,6 @@ export default {
         onShowSizeChange: (current, pageSize) => this.changeChoosePageSize(current, pageSize),
         onChange: (current) => this.changeChoosePage(current)
       },
-      basicInfoData: null, //  基本信息
       productTotal: null //  合计
     }
   },
@@ -268,11 +223,7 @@ export default {
     resetSearchForm () {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
-      this.queryParam.warehouseSn = undefined
-      this.queryParam.brandSn = undefined
-      this.queryParam.productTypeSn1 = undefined
-      this.queryParam.productTypeSn2 = undefined
-      this.queryParam.productTypeSn3 = undefined
+      this.queryParam.productOrigCode = ''
       this.$refs.table.refresh(true)
     },
     // 双击快速添加
@@ -291,41 +242,24 @@ export default {
       this.chooseQueryParam.productName = ''
       this.getChooseProductList(1)
     },
-    // 基本信息
-    getDetail () {
-      storeCallOutDetail({ id: this.$route.params.id }).then(res => {
-        if (res.status == 200) {
-          this.basicInfoData = res.data
-        } else {
-          this.basicInfoData = null
-        }
-      })
-    },
     //  添加/编辑
     handleAdd (row, isEdit) {
       const params = {
         id: isEdit ? row.id : undefined,
-        storeCallOutSn: this.$route.params.sn,
-        outCost: isEdit ? row.outCost : row.putCost,
-        outQty: isEdit ? row.outQty : 1, //  添加时调出数量默认为1
-        productSn: row.productSn,
-        productCode: row.productCode,
-        productOrigCode: row.productOrigCode || undefined,
-        productTypeSn1: row.productTypeSn1,
-        productTypeSn2: row.productTypeSn2,
-        productTypeSn3: row.productTypeSn3,
-        brandSn: row.brandSn,
-        warehouseSn: row.warehouseSn,
-        warehouseLocationSn: row.warehouseLocationSn
+        allocateSn: this.$route.params.sn,
+        cost: isEdit ? row.cost : row.lastStockCost,
+        price: isEdit ? row.price : row.productPrice,
+        qty: isEdit ? row.qty : 1, //  添加时调出数量默认为1
+        productSn: row.productSn
       }
       if (isEdit) { // 编辑
         // 清空数量时,值应保持未清空前的值,因数量不可为空
-        if (!row.outQty || row.outQty == row.outQtyBackups) {
-          row.outQty = row.outQtyBackups
+        if (!row.qty || row.qty == row.qtyBackups) {
+          row.qty = row.qtyBackups
           return
         }
       }
-      storeCallOutDetailSave(params).then(res => {
+      allocateBillDetailSave(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.$refs.table.refresh()
@@ -334,27 +268,38 @@ export default {
       })
     },
     //  删除
-    handleDel (row) {
+    handleDel (row, isAll) {
       const _this = this
+      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
-        content: '删除后不可恢复,确定要进行删除吗?',
+        content: content,
         centered: true,
         onOk () {
-          storeCallOutDetailDel({ id: row.id }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.getChooseProductList()
-            }
-          })
+          if (isAll) { //  整单删除
+            allocateBillDetailDelAll({ sn: _this.$route.params.sn }).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.$refs.table.refresh()
+                _this.getChooseProductList()
+              }
+            })
+          } else { //  单个删除
+            allocateBillDetailDel({ id: row.id }).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.$refs.table.refresh()
+                _this.getChooseProductList()
+              }
+            })
+          }
         }
       })
     },
     //  提交
     handleSubmit () {
       const _this = this
-      storeCallOutSubmit({ id: this.$route.params.id }).then(res => {
+      allocateBillSubmit({ sn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           setTimeout(() => {
@@ -365,7 +310,7 @@ export default {
     },
     // 合计
     getDetailCount (params) {
-      storeCallOutDetailCount(params).then(res => {
+      allocateBillDetailCount(params).then(res => {
         if (res.status == 200) {
           this.productTotal = res.data
         } else {
@@ -373,10 +318,6 @@ export default {
         }
       })
     },
-    //  导入明细
-    handleImport () {
-      console.log(333)
-    },
     //  返回列表
     handleBack () {
       this.$router.push({ path: '/allocationManagement/transferOut/list' })
@@ -399,9 +340,9 @@ export default {
       const params = {
         pageNo: this.choosePageNo,
         pageSize: this.choosePageSize,
-        storeCallOutSn: this.$route.params.sn
+        allocateSn: this.$route.params.sn
       }
-      storeCallOutDetailList(Object.assign(params, this.chooseQueryParam)).then(res => {
+      allocateBillDetailList(Object.assign(params, this.chooseQueryParam)).then(res => {
         if (res.status == 200) {
           //  合计
           this.getDetailCount(Object.assign(params, this.chooseQueryParam))
@@ -411,9 +352,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].outQtyBackups = data.list[i].outQty
-            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
+            data.list[i].qtyBackups = data.list[i].qty
           }
           this.chooseLoadData = data.list
           this.chooseDisabled = false
@@ -425,73 +364,27 @@ export default {
       })
     },
     // 已选产品 调出数量  blur
-    outQtyBlur (val, record) {
+    qtyBlur (val, record) {
       //  光标移出,值发生改变再调用编辑接口
-      if (val != record.outQtyBackups) {
+      if (val != record.qtyBackups) {
         this.handleAdd(record, 'edit')
       }
-    },
-    //  产品分类  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] : ''
-    },
-    //  产品品牌  列表
-    getProductBrand () {
-      // sysFlag不传,此处应查询所有产品
-      productBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
-    //  产品分类  列表
-    getProductType () {
-      productTypeList({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
-    // 仓库下拉数据
-    getWarehouseList (type) {
-      warehouseAllList({}).then(res => {
-        if (res.status == 200) {
-          this.warehouseList = res.data
-        } else {
-          this.warehouseList = []
-        }
-      })
-    },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.getDetail()
       vm.getChooseProductList(1)
-      vm.getWarehouseList()
-      vm.getProductBrand()
-      vm.getProductType()
     })
   }
 }
 </script>
 
 <style lang="less">
-  .storeTransferOutEdit-wrap{
-    .storeTransferOutEdit-back{
+  .allocateBillEdit-wrap{
+    .allocateBillEdit-back{
       margin-bottom: 15px;
     }
-    .storeTransferOutEdit-cont{
+    .allocateBillEdit-cont{
       margin-bottom: 15px;
       .sub-title{
         font-size: 12px;

+ 82 - 84
src/views/allocationManagement/transferOut/list.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-card size="small" :bordered="false" class="storeTransferOutList-wrap">
+  <a-card size="small" :bordered="false" class="allocateBillList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
@@ -8,7 +8,7 @@
             <a-form-item label="创建时间">
               <a-range-picker
                 style="width:100%"
-                id="storeTransferOutList-createDate"
+                id="allocateBillList-createDate"
                 :disabledDate="disabledDate"
                 v-model="createDate"
                 :format="dateFormat"
@@ -17,14 +17,14 @@
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="调往对象名称">
-              <a-input id="storeTransferOutList-putPersonName" v-model.trim="queryParam.putPersonName" allowClear placeholder="请输入调往对象名称"/>
+            <a-form-item label="调往对象">
+              <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="调拨类型">
-              <a-select id="storeTransferOutList-callOutType" v-model="queryParam.callOutType" placeholder="请选择调拨类型" allowClear >
-                <a-select-option v-for="item in storeCallOutTypeList" :key="item.storeCallOutTypeSn" :value="item.storeCallOutTypeSn">{{ item.name }}</a-select-option>
+              <a-select id="allocateBillList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择调拨类型" allowClear >
+                <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
@@ -34,29 +34,34 @@
                 <v-select
                   v-model="queryParam.state"
                   ref="state"
-                  id="storeTransferOutList-state"
-                  code="STORE_CALL_OUT_STATE"
+                  id="allocateBillList-state"
+                  code="ALLOCATE_STATUS"
                   placeholder="请选择业务状态"
                   allowClear
                 ></v-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="财务状态">
+              <a-form-item label="调拨单号">
+                <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="客户类型">
                 <v-select
-                  v-model="queryParam.settleState"
-                  ref="settleState"
-                  id="storeTransferOutList-settleState"
-                  code="FINANCIAL_RECEIVE_STATUS"
-                  placeholder="请选择财务状态"
+                  v-model="queryParam.state"
+                  ref="state"
+                  id="allocateBillList-state"
+                  code="BILL_STATUS"
+                  placeholder="请选择客户类型"
                   allowClear
                 ></v-select>
               </a-form-item>
             </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="storeTransferOutList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-reset">重置</a-button>
             <a @click="advanced=!advanced" style="margin-left: 8px">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -67,7 +72,7 @@
     </div>
     <!-- 操作按钮 -->
     <div class="table-operator">
-      <a-button id="storeTransferOutList-add" type="primary" class="button-error" @click="openModal=true">新增</a-button>
+      <a-button id="allocateBillList-add" type="primary" class="button-error" @click="openModal=true">新增</a-button>
     </div>
     <!-- 列表 -->
     <s-table
@@ -77,11 +82,11 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1500, y: tableHeight }"
+      :scroll="{ x: 1940, y: tableHeight }"
       bordered>
-      <!-- 店内调出单号 -->
-      <template slot="storeCallOutNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.storeCallOutNo }}</span>
+      <!-- 单号 -->
+      <template slot="allocateSn" slot-scope="text, record">
+        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.allocateSn }}</span>
       </template>
       <!-- 财务状态 -->
       <template slot="settleState" slot-scope="text, record">
@@ -95,29 +100,22 @@
           v-if="record.state == 'WAIT_AUDIT'"
           class="button-warning"
           @click="handleExamine(record)"
-          id="storeTransferOutList-examine-btn">审核</a-button>
+          id="allocateBillList-examine-btn">审核</a-button>
         <a-button
           size="small"
           type="link"
           v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')"
           class="button-info"
           @click="handleEdit(record)"
-          id="storeTransferOutList-edit-btn">编辑</a-button>
-        <a-button
-          size="small"
-          type="link"
-          v-if="record.state == 'WAIT_OUT_WAREHOUSE'"
-          class="button-primary"
-          @click="handleOut(record)"
-          id="storeTransferOutList-out-btn">出库</a-button>
+          id="allocateBillList-edit-btn">编辑</a-button>
         <a-button
           size="small"
           type="link"
-          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'WAIT_OUT_WAREHOUSE')"
+          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')"
           class="button-error"
           @click="handleDel(record)"
-          id="storeTransferOutList-del-btn">删除</a-button>
-        <span v-if="(record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT') && (record.state != 'WAIT_OUT_WAREHOUSE')">--</span>
+          id="allocateBillList-del-btn">删除</a-button>
+        <span v-if="(record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT')">--</span>
       </template>
     </s-table>
     <!-- 新增 -->
@@ -129,8 +127,8 @@
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
-import { storeCallOutList, storeCallOutAudit, storeCallOutDel, storeCallOutOut } from '@/api/storeCallOut'
-import { storeCallOutTypeAllList } from '@/api/storeCallOutType'
+import { allocateBillList, allocateBillDel, allocateBillAudit } from '@/api/allocateBill'
+import { allocateTypeAllList } from '@/api/allocateType'
 export default {
   components: { STable, VSelect, basicInfoModal },
   data () {
@@ -139,26 +137,29 @@ export default {
       tableHeight: 0,
       createDate: [], //  创建时间
       queryParam: { //  查询条件
-        putPersonName: undefined, //  调往对象
-        callOutType: undefined, //  调拨类型
+        targetName: '', //  调往对象
+        allocateTypeSn: undefined, //  调拨类型
         state: undefined, //  业务状态
-        settleState: undefined //  财务状态
+        allocateNo: '', //  调拨单号
+        stasste: undefined //  客户类型
       },
       disabled: false, //  查询、重置按钮是否可操作
       dateFormat: 'YYYY-MM-DD',
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '店内调出单号', scopedSlots: { customRender: 'storeCallOutNo' }, width: 220, align: 'center' },
-        { title: '调往对象名称', dataIndex: 'putPersonName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调拨类型', dataIndex: 'callOutTypeName', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总款数', dataIndex: 'productTotalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总数量', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调拨单号', scopedSlots: { customRender: 'allocateSn' }, align: 'center' },
+        { title: '调往对象', dataIndex: 'targetName', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户类型', dataIndex: 'callOutTypeName', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总成本', dataIndex: 'totalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总售价', dataIndex: 'totalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'stateDictValue', width: 110, align: 'center' },
-        { title: '财务状态', scopedSlots: { customRender: 'settleState' }, width: 110, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 250, align: 'center', fixed: 'right' }
+        { title: '调拨类型', dataIndex: 'allocateTypeName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '打印状态', dataIndex: 'printStateDictValue', width: 110, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '打印次数', dataIndex: 'printCount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 180, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -174,7 +175,7 @@ export default {
           this.queryParam.beginDate = undefined
           this.queryParam.endDate = undefined
         }
-        return storeCallOutList(Object.assign(parameter, this.queryParam)).then(res => {
+        return allocateBillList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -184,7 +185,7 @@ export default {
           return data
         })
       },
-      storeCallOutTypeList: [], //  调拨类型
+      allocateTypeList: [], //  调拨类型
       openModal: false, //  新增编辑  弹框
       itemId: '' //  当前品牌id
     }
@@ -196,16 +197,17 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.putPersonName = undefined
-      this.queryParam.callOutType = undefined
+      this.queryParam.targetName = ''
+      this.queryParam.allocateTypeSn = undefined
       this.queryParam.state = undefined
-      this.queryParam.settleState = undefined
-      this.createDate = undefined
+      this.queryParam.allocateNo = ''
+      this.queryParam.stasste = undefined
+      this.createDate = []
       this.$refs.table.refresh(true)
     },
     //  基本信息  保存
     handleOk (data) {
-      this.$router.push({ path: `/allocationManagement/transferOut/add/${data.id}/${data.storeCallOutSn}` })
+      this.$router.push({ path: `/allocationManagement/transferOut/add/${data.id}/${data.allocateSn}/${data.targetName}` })
     },
     //  删除
     handleDel (row) {
@@ -215,7 +217,7 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
-          storeCallOutDel({ id: row.id }).then(res => {
+          allocateBillDel({ sn: row.allocateSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
@@ -224,55 +226,51 @@ export default {
         }
       })
     },
-    //  出库
-    handleOut (row) {
+    //  审核
+    handleExamine (row) {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '确认要出库吗?',
+        content: '确认要审核通过吗?',
         centered: true,
+        okText: '审核通过',
+        cancelText: '审核不通过',
         onOk () {
-          storeCallOutOut({ storeCallOutSn: row.storeCallOutSn }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-            }
-          })
+          _this.auditOrder(row.allocateSn, 'FINISH')
+        },
+        onCancel (e) {
+          if (!e.triggerCancel) {
+            _this.auditOrder(row.allocateSn, 'AUDIT_REJECT')
+          }
+          _this.$destroyAll()
         }
       })
     },
-    //  审核
-    handleExamine (row) {
+    // 审核
+    auditOrder (sn, state) {
       const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确认要审核通过吗?',
-        centered: true,
-        onOk () {
-          storeCallOutAudit({ id: row.id }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-            }
-          })
+      allocateBillAudit({ sn: sn, state: state }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
         }
       })
     },
     //  详情
     handleDetail (row) {
-      this.$router.push({ path: `/allocationManagement/transferOut/detail/${row.storeCallOutSn}` })
+      this.$router.push({ path: `/allocationManagement/transferOut/detail/${row.allocateSn}` })
     },
     //  编辑
     handleEdit (row) {
-      this.$router.push({ path: `/allocationManagement/transferOut/edit/${row.id}/${row.storeCallOutSn}` })
+      this.$router.push({ path: `/allocationManagement/transferOut/edit/${row.id}/${row.allocateSn}/${row.targetName}` })
     },
     //  调拨类型
-    getStoreCallOutTypeAllList () {
-      storeCallOutTypeAllList().then(res => {
+    getAllocateTypeAllList () {
+      allocateTypeAllList().then(res => {
         if (res.status == 200) {
-          this.storeCallOutTypeList = res.data
+          this.allocateTypeList = res.data
         } else {
-          this.storeCallOutTypeList = []
+          this.allocateTypeList = []
         }
       })
     }
@@ -280,7 +278,7 @@ export default {
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.openModal = false
-      vm.getStoreCallOutTypeAllList()
+      vm.getAllocateTypeAllList()
     })
   }
 }

+ 25 - 24
src/views/basicData/warehouse/editModal.vue

@@ -22,13 +22,11 @@
           <a-input
             id="warehouseEdit-name"
             :maxLength="30"
-            v-model="form.name"
+            v-model.trim="form.name"
+            @change="filterEmpty"
             placeholder="请输入仓库名称(最多30个字符)"
             allowClear />
         </a-form-model-item>
-        <a-form-model-item label="排序" prop="sort">
-          <a-input-number v-model="form.sort" :min="0" :max="999999" :precision="0" :step="1" placeholder="请输入排序(0~999999)" style="width: 100%;" />
-        </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
         <a-button type="primary" id="warehouse-edit-modal-save" @click="handleSave">保存</a-button>
@@ -42,14 +40,14 @@
 import { STable } from '@/components'
 import { warehouseSave } from '@/api/warehouse'
 export default {
-  name: 'warehouseEditModal',
+  name: 'WarehouseEditModal',
   components: { STable },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
     },
-    itemId: {
+    itemSn: {
       type: [Number, String],
       default: ''
     },
@@ -60,7 +58,7 @@ export default {
   },
   computed: {
     modalTit () {
-      return (this.itemId ? '编辑' : '新增') + '仓库'
+      return (this.itemSn ? '编辑' : '新增') + '仓库'
     }
   },
   data () {
@@ -71,8 +69,7 @@ export default {
         wrapperCol: { span: 16 }
       },
       form: {
-        name: '', // 仓库名称
-        sort: ''  //  排序
+        name: '' // 仓库名称
       },
       rules: {
         name: [
@@ -82,33 +79,38 @@ export default {
     }
   },
   methods: {
+    filterEmpty () {
+      let str = this.form.name
+      str = str.replace(/\ +/g, '')
+      str = str.replace(/[ ]/g, '')
+      str = str.replace(/[\r\n]/g, '')
+      this.form.name = str
+    },
     //  详情
-    getDetail(){
+    getDetail () {
       this.form = {
-        name: this.nowData && this.nowData.name ? this.nowData.name : '',
-        sort: this.nowData && (this.nowData.sort || this.nowData.sort == 0) ? this.nowData.sort : ''
+        name: this.nowData && this.nowData.name ? this.nowData.name : ''
       }
     },
     //  保存
-    handleSave(){
+    handleSave () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const params = {
-            id: this.itemId ? this.itemId : undefined,
-            name: this.form.name,  //  仓库名称
-            sort: this.form.sort  //  排序
+            warehouseSn: this.itemSn ? this.itemSn : undefined,
+            name: this.form.name //  仓库名称
           }
           warehouseSave(params).then(res => {
-            if(res.status == 200){
+            if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('ok')
               setTimeout(function () {
                 _this.isShow = false
                 _this.$refs.ruleForm.resetFields()
               }, 300)
-            }else{
-              
+            } else {
+
             }
           })
         } else {
@@ -116,7 +118,7 @@ export default {
           return false
         }
       })
-    },
+    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -127,14 +129,13 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-      }else{
+      } else {
         this.form = {
-          name: '',
-          sort: ''
+          name: ''
         }
       }
     },
-    itemId (newValue, oldValue) {
+    itemSn (newValue, oldValue) {
       if (this.isShow && newValue) {
         this.getDetail()
       }

+ 30 - 15
src/views/basicData/warehouse/list.vue

@@ -18,7 +18,7 @@
     </div>
     <!-- 操作按钮 -->
     <div class="table-operator">
-	  <a-button id="warehouseList-add" type="primary" class="button-error" @click="handleEdit()">新增仓库</a-button>
+      <a-button id="warehouseList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
     </div>
     <!-- 列表 -->
     <s-table
@@ -28,18 +28,32 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
+      :scroll="{ y: tableHeight }"
       bordered>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="goStoringLocation(record)" id="warehouseList-storingLocation-btn">仓位管理</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleEdit(record)" id="warehouseList-edit-btn">编辑</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDel(record)" id="warehouseList-del-btn" style="margin-left: 10px;">删除</a-button>
+        <a-button
+          size="small"
+          type="link"
+          class="button-warning"
+          @click="goStoringLocation(record)"
+          id="warehouseList-storingLocation-btn">仓位管理</a-button>
+        <a-button
+          size="small"
+          type="link"
+          class="button-info"
+          @click="handleEdit(record)"
+          id="warehouseList-edit-btn">编辑</a-button>
+        <a-button
+          size="small"
+          type="link"
+          class="button-error"
+          @click="handleDel(record)"
+          id="warehouseList-del-btn">删除</a-button>
       </template>
     </s-table>
     <!-- 新增/编辑仓库 -->
-    <warehouse-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
+    <warehouse-edit-modal :openModal="openModal" :nowData="nowData" :itemSn="itemSn" @ok="handleOk" @close="closeModal" />
   </a-card>
 </template>
 
@@ -54,16 +68,19 @@ export default {
       queryParam: { //  查询条件
         name: '' //  仓库名称
       },
+      tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '仓库名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '排序', dataIndex: 'sort', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
         return warehouseList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -75,7 +92,7 @@ export default {
         })
       },
       openModal: false, //  新增编辑  弹框
-      itemId: '', //  当前id
+      itemSn: '', //  当前sn
       nowData: null //  当前记录数据
     }
   },
@@ -87,7 +104,7 @@ export default {
     },
     //  新增/编辑
     handleEdit (row) {
-      this.itemId = row ? row.id : null
+      this.itemSn = row ? row.warehouseSn : null
       this.nowData = row || null
       this.openModal = true
     },
@@ -97,7 +114,7 @@ export default {
     },
     //  关闭弹框
     closeModal () {
-      this.itemId = ''
+      this.itemSn = ''
       this.openModal = false
     },
     //  删除
@@ -109,7 +126,7 @@ export default {
         centered: true,
         onOk () {
           warehouseDel({
-            id: row.id
+            sn: row.warehouseSn
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
@@ -121,10 +138,8 @@ export default {
     },
     //  查看仓位
     goStoringLocation (row) {
-      this.$router.push({ path: `/inventoryManagement/storingLocation/${row.warehouseSn}`, query: { name: row.name } })
+      this.$router.push({ path: `/basicData/storingLocation/${row.warehouseSn}`, query: { name: row.name } })
     }
   }
 }
 </script>
-
-<style lang="less"></style>

+ 9 - 24
src/views/basicData/warehouse/storingLocation/editModal.vue

@@ -31,16 +31,6 @@
             <a-select-option v-for="item in warehouseList" :key="item.id" :value="item.warehouseSn">{{ item.name }}</a-select-option>
           </a-select>
         </a-form-model-item>
-        <a-form-model-item label="排序" prop="sort">
-          <a-input-number
-            v-model="form.sort"
-            :min="0"
-            :max="999999"
-            :precision="0"
-            :step="1"
-            placeholder="请输入排序(0~999999)"
-            style="width: 100%;" />
-        </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
         <a-button type="primary" id="storingLocation-edit-modal-save" @click="handleSave">保存</a-button>
@@ -61,7 +51,7 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: {
+    itemSn: {
       type: [Number, String],
       default: ''
     },
@@ -72,7 +62,7 @@ export default {
   },
   computed: {
     modalTit () {
-      return (this.itemId ? '编辑' : '新增') + '仓位'
+      return (this.itemSn ? '编辑' : '新增') + '仓位'
     }
   },
   data () {
@@ -84,8 +74,7 @@ export default {
       },
       form: {
         name: '', // 仓位名称
-        warehouseSn: undefined, //  所属仓库
-        sort: '' //  排序
+        warehouseSn: undefined //  所属仓库
       },
       rules: {
         name: [
@@ -113,8 +102,7 @@ export default {
     getDetail () {
       this.form = {
         name: this.nowData && this.nowData.name ? this.nowData.name : '',
-        warehouseSn: this.nowData && this.nowData.warehouseSn ? this.nowData.warehouseSn : '',
-        sort: this.nowData && (this.nowData.sort || this.nowData.sort == 0) ? this.nowData.sort : ''
+        warehouseSn: this.nowData && this.nowData.warehouseSn ? this.nowData.warehouseSn : ''
       }
     },
     //  保存
@@ -123,10 +111,9 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const params = {
-            id: this.itemId ? this.itemId : undefined,
+            warehouseLocationSn: this.itemSn ? this.itemSn : undefined,
             warehouseSn: this.form.warehouseSn, //  所属仓库
-            name: this.form.name, //  仓库名称
-            sort: this.form.sort //  排序
+            name: this.form.name //  仓库名称
           }
           warehouseLocSave(params).then(res => {
             if (res.status == 200) {
@@ -158,20 +145,18 @@ export default {
         this.$refs.ruleForm.resetFields()
         this.form = {
           name: '',
-          warehouseSn: '',
-          sort: ''
+          warehouseSn: ''
         }
         this.$emit('close')
       } else {
         this.getWarehouseList()
         this.form = {
           name: '',
-          warehouseSn: this.nowData && this.nowData.warehouseSn ? this.nowData.warehouseSn : '',
-          sort: ''
+          warehouseSn: this.nowData && this.nowData.warehouseSn ? this.nowData.warehouseSn : ''
         }
       }
     },
-    itemId (newValue, oldValue) {
+    itemSn (newValue, oldValue) {
       if (this.isShow && newValue) {
         this.getDetail()
       }

+ 31 - 24
src/views/basicData/warehouse/storingLocation/list.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="storingLocationList-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="storingLocationList-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="storingLocationList-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
-      </template>
-    </a-page-header>
     <a-card size="small" :bordered="false" class="storingLocationList-cont">
+      <!-- 操作按钮 -->
+      <div class="table-operator" style="display: flex;justify-content: space-between;border:0">
+        <a id="storingLocationList-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        <strong style="display: block;">所属仓库:{{ $route.query.name }}</strong>
+        <a-button id="storingLocationList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+      </div>
       <!-- 搜索条件 -->
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
@@ -23,11 +23,6 @@
           </a-row>
         </a-form>
       </div>
-      <!-- 操作按钮 -->
-      <div class="table-operator">
-        <a-button id="storingLocationList-add" type="primary" @click="handleEdit()">新增仓位</a-button>
-      </div>
-      <strong style="display: block;margin: 30px 0 20px;">所属仓库:{{ $route.query.name }}</strong>
       <!-- 列表 -->
       <s-table
         class="sTable"
@@ -36,17 +31,27 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
+        :scroll="{ y: tableHeight }"
         bordered>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
-          <a-button size="small" type="link" @click="handleEdit(record)" id="storingLocationList-edit-btn">编辑</a-button>
-          <a-divider type="vertical" style="margin: 0;" />
-          <a-button size="small" type="link" @click="handleDel(record)" id="storingLocationList-del-btn" style="margin-left: 10px;">删除</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            id="storingLocationList-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+            id="storingLocationList-del-btn">删除</a-button>
         </template>
       </s-table>
     </a-card>
     <!-- 新增/编辑仓位 -->
-    <storing-location-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
+    <storing-location-edit-modal :openModal="openModal" :nowData="nowData" :itemSn="itemSn" @ok="handleOk" @close="closeModal" />
   </div>
 </template>
 
@@ -58,6 +63,7 @@ export default {
   components: { STable, storingLocationEditModal },
   data () {
     return {
+      tableHeight: 0,
       queryParam: { //  查询条件
         warehouseSn: this.$route.params.sn, //  仓库sn
         name: '' //  仓位名称
@@ -66,12 +72,14 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '仓位名称', dataIndex: 'name', align: 'center', ellipsis: true },
-        { title: '排序', dataIndex: 'sort', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 160, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
         return warehouseLocList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -83,7 +91,7 @@ export default {
         })
       },
       openModal: false, //  新增编辑产品品牌  弹框
-      itemId: '', //  当前品牌id
+      itemSn: '', //  当前sn
       nowData: null //  当前记录数据
     }
   },
@@ -97,11 +105,11 @@ export default {
     //  新增/编辑
     handleEdit (row) {
       if (row) {
-        this.itemId = row.id
+        this.itemSn = row.warehouseLocationSn
         row.warehouseSn = this.$route.params.sn
         this.nowData = row
       } else {
-        this.itemId = null
+        this.itemSn = null
         this.nowData = { warehouseSn: this.$route.params.sn }
       }
       this.openModal = true
@@ -112,7 +120,7 @@ export default {
     },
     //  关闭弹框
     closeModal () {
-      this.itemId = ''
+      this.itemSn = ''
       this.openModal = false
     },
     //  删除
@@ -124,8 +132,7 @@ export default {
         centered: true,
         onOk () {
           warehouseLocDel({
-            id: row.id,
-            warehouseSn: _this.$route.params.sn
+            sn: row.warehouseLocationSn
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
@@ -137,7 +144,7 @@ export default {
     },
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/inventoryManagement/warehouse/list' })
+      this.$router.push({ path: '/basicData/warehouse/list' })
     }
   }
 }

+ 7 - 7
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -193,13 +193,13 @@ export default {
     },
     // 仓库下拉数据
     getWarehouseList (type) {
-      // warehouseAllList({}).then(res => {
-      //   if (res.status == 200) {
-      //     this.warehouseList = res.data
-      //   } else {
-      //     this.warehouseList = []
-      //   }
-      // })
+      warehouseAllList({}).then(res => {
+        if (res.status == 200) {
+          this.warehouseList = res.data
+        } else {
+          this.warehouseList = []
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {