chenrui 4 years ago
parent
commit
e8528591d1

+ 131 - 60
src/config/router.config.js

@@ -473,7 +473,7 @@ export const asyncRouterMap = [
             name: 'rebateSettings',
             component: RouteView,
             meta: {
-              title: '返利设置',
+              title: '差价归属设置',
               icon: 'sketch'
               // permission: 'M_goodsManage_list'
             },
@@ -484,7 +484,7 @@ export const asyncRouterMap = [
                 name: 'rebateSettingsList',
                 component: () => import(/* webpackChunkName: "shop" */ '@/views/dealerManagement/rebateSettings/list.vue'),
                 meta: {
-                  title: '返利设置列表',
+                  title: '差价归属设置列表',
                   icon: 'sketch',
                   hidden: true
                   // permission: 'M_goodsManage_list'
@@ -579,6 +579,74 @@ export const asyncRouterMap = [
           }
         ]
       },
+      // 采购管理
+      {
+        path: '/purchasingManagement',
+        redirect: '/purchasingManagement/purchaseOrder',
+        component: PageView,
+        meta: {
+          title: '采购管理',
+          icon: 'gold',
+          permission: 'M_bulkWarehousing'
+        },
+        children: [
+          {
+            path: '/purchasingManagement/bulkWarehousingOrder',
+            redirect: '/purchasingManagement/bulkWarehousingOrder/list',
+            name: 'bulkWarehousingOrder',
+            component: RouteView,
+            meta: {
+              title: '散件入库',
+              icon: 'gold',
+              permission: 'M_bulkWarehousingOrder_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'bulkWarehousingOrderList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/bulkWarehousingOrder/list.vue'),
+                meta: {
+                  title: '散件入库单列表',
+                  icon: 'gold',
+                  hidden: true,
+                  permission: 'M_bulkWarehousingOrder_list'
+                }
+              },
+              {
+                path: 'add/:id/:sn',
+                name: 'bulkWarehousingOrderAdd',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/bulkWarehousingOrder/edit.vue'),
+                meta: {
+                  title: '新增散件入库单',
+                  icon: 'gold',
+                  hidden: true
+                }
+              },
+              {
+                path: 'edit/:id/:sn',
+                name: 'bulkWarehousingOrderEdit',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/bulkWarehousingOrder/edit.vue'),
+                meta: {
+                  title: '编辑散件入库单',
+                  icon: 'gold',
+                  hidden: true
+                }
+              },
+              {
+                path: 'detail/:id/:sn',
+                name: 'bulkWarehousingOrderDetail',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/bulkWarehousingOrder/detail.vue'),
+                meta: {
+                  title: '散件入库单详情',
+                  icon: 'gold',
+                  hidden: true
+                }
+              }
+            ]
+          }
+        ]
+      },
       // 销售管理
       {
         path: '/salesManagement',
@@ -684,6 +752,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/salesManagement/pushOrderManagement',
+            redirect: '/salesManagement/pushOrderManagement/list',
+            name: 'pushOrderManagement',
+            component: RouteView,
+            meta: {
+              title: '下推订单管理',
+              icon: 'export'
+              // permission: 'M_outboundList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'pushOrderManagementList',
+                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/pushOrderManagement/list.vue'),
+                meta: {
+                  title: '下推订单管理列表',
+                  icon: 'export',
+                  hidden: true
+                  // permission: 'M_outboundList'
+                }
+              }
+            ]
+          },
           {
             path: '/salesManagement/outboundOrder',
             redirect: '/salesManagement/outboundOrder/list',
@@ -921,64 +1014,6 @@ export const asyncRouterMap = [
               icon: 'alert'
               // permission: 'M_goodsShelves_0'
             }
-          },
-          {
-            path: '/inventoryManagement/warehouseAllocation',
-            redirect: '/inventoryManagement/warehouseAllocation/list',
-            name: 'warehouseAllocation',
-            component: RouteView,
-            meta: {
-              title: '仓库调拨',
-              icon: 'gateway'
-              // permission: 'M_goodsManage_list'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'warehouseAllocationList',
-                component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/warehouseAllocation/list.vue'),
-                meta: {
-                  title: '仓库调拨列表',
-                  icon: 'gateway',
-                  hidden: true
-                  // permission: 'M_goodsManage_list'
-                }
-              },
-              {
-                path: 'add',
-                name: 'warehouseAllocationAdd',
-                component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/warehouseAllocation/edit.vue'),
-                meta: {
-                  title: '新增仓库调拨',
-                  icon: 'gateway',
-                  hidden: true
-                  // permission: 'B_goodsManage_edit'
-                }
-              },
-              {
-                path: 'edit/:id',
-                name: 'warehouseAllocationEdit',
-                component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/warehouseAllocation/edit.vue'),
-                meta: {
-                  title: '编辑仓库调拨',
-                  icon: 'gateway',
-                  hidden: true
-                  // permission: 'B_goodsManage_edit'
-                }
-              },
-              {
-                path: 'detail/:id/:sn',
-                name: 'warehouseAllocationDetail',
-                component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/warehouseAllocation/detail.vue'),
-                meta: {
-                  title: '仓库调拨详情',
-                  icon: 'gateway',
-                  hidden: true
-                  // permission: 'B_goodsManage_edit'
-                }
-              }
-            ]
           }
           // 二期
           // {
@@ -1314,6 +1349,42 @@ export const asyncRouterMap = [
           //     }
           //   ]
           // },
+          {
+            path: '/financialManagement/warehousingConfirmation',
+            redirect: '/financialManagement/warehousingConfirmation/list',
+            name: 'warehousingConfirmation',
+            component: RouteView,
+            meta: {
+              title: '入库确认',
+              icon: 'pull-request'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'warehousingConfirmationList',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/warehousingConfirmation/list.vue'),
+                meta: {
+                  title: '入库确认列表',
+                  icon: 'pull-request',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              },
+              {
+                path: 'detail/:id',
+                name: 'warehousingConfirmationDetail',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/warehousingConfirmation/detail.vue'),
+                meta: {
+                  title: '入库确认详情',
+                  icon: 'pull-request',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              }
+            ]
+          },
           {
             path: '/financialManagement/returnConfirmation',
             redirect: '/financialManagement/returnConfirmation/list',

+ 86 - 0
src/views/dealerManagement/dealerAccountManagement/detailModal.vue

@@ -0,0 +1,86 @@
+<template>
+  <a-modal
+    centered
+    class="dealerAccountDetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="账号信息"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="800">
+    <div v-if="detailData">
+      <a-descriptions bordered size="default">
+        <a-descriptions-item label="经销商名称:">{{ detailData.productName || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="管理员姓名:">{{ detailData.productCode || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="管理员手机:">{{ detailData.origCode || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="管理员账号:">{{ detailData.origCode || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="最大可开通用户数(不含管理员账号):">{{ detailData.origCode || '--' }}</a-descriptions-item>
+      </a-descriptions>
+      <div class="btn-cont"><a-button id="dealerAccountDetail-modal-back" @click="isShow = false">关闭</a-button></div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+// import { dealerProductDetail } from '@/api/dealerProduct'
+export default {
+  name: 'DealerAccountDetailModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      detailData: null //  详情数据
+    }
+  },
+  methods: {
+    //  获取详情
+    getDetail () {
+      // dealerProductDetail({ id: this.itemId }).then(res => {
+      //   if (res.status == 200) {
+      //     this.detailsData = res.data
+      //   } else {
+      //     this.detailsData = null
+      //   }
+      // })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    },
+    itemId (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .dealerAccountDetail-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 191 - 0
src/views/dealerManagement/dealerAccountManagement/editModal.vue

@@ -0,0 +1,191 @@
+<template>
+  <a-modal
+    centered
+    class="dealerAccountEdit-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="账号信息"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="800">
+    <!-- 表单 -->
+    <div>
+      <a-form-model
+        id="dealerAccountEdit-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="经销商名称" prop="productBrandName">
+          <a-select
+            id="dealerAccountEdit-supplierSn"
+            placeholder="请选择经销商"
+            allowClear
+            v-model="form.supplierSn"
+            :showSearch="true"
+            option-filter-prop="children"
+            :filter-option="filterOption">
+            <a-select-option v-for="item in productBrandList" :key="item.supplierSn" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
+          </a-select>
+        </a-form-model-item>
+        <a-form-model-item label="管理员姓名" prop="productBrandName">
+          <a-input
+            id="dealerAccountEdit-productBrandName"
+            :maxLength="30"
+            v-model.trim="form.productBrandName"
+            placeholder="请输入管理员姓名(最多30个字符)"
+            allowClear />
+        </a-form-model-item>
+        <a-form-model-item label="管理员手机" prop="contactTel">
+          <a-input
+            id="dealerAccountEdit-contactTel"
+            :maxLength="11"
+            v-model.trim="form.contactTel"
+            placeholder="请输入管理员手机(最多11个字符)"
+            allowClear />
+        </a-form-model-item>
+        <a-form-model-item label="管理员账号" prop="account">
+          <a-input
+            id="dealerAccountEdit-account"
+            :maxLength="50"
+            v-model.trim="form.account"
+            placeholder="请输入管理员账号,字母/数字(最多50个字符)"
+            allowClear />
+        </a-form-model-item>
+        <a-form-model-item label="管理员密码" prop="password">
+          <a-input
+            id="dealerAccountEdit-password"
+            :maxLength="50"
+            type="password"
+            v-model.trim="form.password"
+            placeholder="请输入管理员密码,字母/数字(最多50个字符)"
+            allowClear />
+        </a-form-model-item>
+        <a-form-model-item label="最大可开通用户数" prop="password" extra="(不含管理员账号)">
+          <a-input-number
+            id="dealerAccountEdit-password"
+            v-model="form.password"
+            :precision="0"
+            :min="1"
+            :max="999999"
+            placeholder="请输入数量"
+            style="width: 100%;" />
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="dealerAccountEdit-save" @click="handleSave">保存</a-button>
+        <a-button id="dealerAccountEdit-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+// import { dealerProductBrandSave } from '@/api/dealerProductBrand'
+export default {
+  name: 'DealerAccountEditModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    },
+    nowData: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        productBrandName: '', // 产品品牌名称
+        contactTel: '',
+        desc: ''
+      },
+      rules: {
+        productBrandName: [
+          { required: true, message: '请输入产品品牌名称', trigger: 'blur' }
+        ],
+        contactTel: [{ required: true, message: '请输入联系电话', trigger: 'blur' }, { pattern: /^\d{11}$/, message: '请输入正确的手机号' }],
+        account: [{ required: true, message: '请输入管理员账号', trigger: 'blur' }, { pattern: /^[0-9a-zA-Z]+$/, message: '管理员账号由字母和数字组成' }],
+        password: [{ required: true, message: '请输入管理员密码', trigger: 'blur' }, { pattern: /^[0-9a-zA-Z]+$/, message: '管理员密码由字母和数字组成' }]
+      },
+      productBrandList: []
+    }
+  },
+  methods: {
+    //  保存
+    handleSave () {
+      const _this = this
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const formData = JSON.parse(JSON.stringify(_this.form))
+          formData.id = _this.itemId ? _this.itemId : undefined
+          dealerProductBrandSave(formData).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('ok')
+              _this.isShow = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .dealerAccountEdit-modal{
+    .ant-modal-body {
+    	padding: 40px 40px 24px;
+    }
+    .upload{
+      width: 100%!important;
+    }
+    //  商品图片描述
+    .upload-desc{
+      font-size: 12px;
+      color: #808695;
+    }
+    //  文本编辑器  工具栏样式换行
+    .dealerAccountEdit-editor{
+      .w-e-toolbar{
+        flex-wrap: wrap;
+      }
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 187 - 3
src/views/dealerManagement/dealerAccountManagement/list.vue

@@ -1,8 +1,192 @@
 <template>
+  <a-card size="small" :bordered="false" class="dealerAccountList-wrap">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="经销商名称">
+              <a-input id="dealerAccountList-productBrandName" v-model.trim="queryParam.productBrandName" allowClear placeholder="请输入经销商名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="管理员账号">
+              <a-input id="dealerAccountList-productBrandName" v-model.trim="queryParam.productBrandName" allowClear placeholder="请输入管理员账号"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="账号状态">
+              <v-select code="PRODUCT_STATUS" id="dealerAccountList-state" v-model="queryParam.state" allowClear placeholder="请选择账号状态"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="dealerAccountList-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="dealerAccountList-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 操作按钮 -->
+    <div class="table-operator">
+      <a-button id="dealerAccountList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+    </div>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ x: 1310, y: tableHeight }"
+      bordered>
+      <!-- 账号状态 -->
+      <template slot="enableAction" slot-scope="text, record">
+        <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model="record.enabledFlag" @change="changeFlagHandle(text, record)"/>
+      </template>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="dealerAccountList-edit-btn">编辑</a-button>
+        <a-button size="small" type="link" class="button-success" @click="handleDetail(record)" id="dealerAccountList-detail-btn">详情</a-button>
+        <a-button
+          size="small"
+          type="link"
+          class="button-warning"
+          @click="handleReset(record)"
+          id="dealerAccountList-reset-btn">重置密码</a-button>
+      </template>
+    </s-table>
+    <!-- 新增/编辑 -->
+    <dealer-account-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="$refs.table.refresh(true)" @close="closeModal" />
+    <!-- 查看 -->
+    <dealer-account-detail-modal :openModal="openDetailModal" :itemId="itemId" @close="closeDetailModal" />
+  </a-card>
 </template>
 
 <script>
+// import { dealerProductBrandList, dealerProductBrandUpdate } from '@/api/dealerProductBrand'
+import { STable, VSelect } from '@/components'
+import dealerAccountEditModal from './editModal.vue'
+import dealerAccountDetailModal from './detailModal.vue'
+export default {
+  components: { STable, VSelect, dealerAccountEditModal, dealerAccountDetailModal },
+  data () {
+    return {
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        productBrandName: '', //  品牌名称
+        enabledFlag: undefined //  状态
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '经销商名称', dataIndex: 'productBrandName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '管理员姓名', dataIndex: 'creatseDate', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '管理员账号', dataIndex: 'producstBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '授权用户数', dataIndex: 'productssBrandName', width: 140, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '状态', scopedSlots: { customRender: 'enableAction' }, width: 150, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        // return dealerProductBrandList(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++) {
+        //     data.list[i].no = no + i + 1
+        //   }
+        //   this.disabled = false
+        //   return data
+        // })
+        const _this = this
+        return new Promise(function (resolve, reject) {
+          const data = {
+            pageNo: 1,
+            pageSize: 10,
+            list: [
+              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
+            ]
+          }
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          _this.disabled = false
+          resolve(data)
+        })
+      },
+      openModal: false, //  新增编辑  弹框
+      openDetailModal: false, // 详情  弹框
+      itemId: '', //  当前id
+      nowData: null, //  当前记录数据
+      productBrandList: []
+    }
+  },
+  methods: {
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productBrandName = ''
+      this.queryParam.enabledFlag = undefined
+      this.$refs.table.refresh(true)
+    },
+    //  新增/编辑
+    handleEdit (row) {
+      this.itemId = row ? row.id : null
+      this.nowData = row || null
+      this.openModal = true
+    },
+    // 详情
+    handleDetail (row) {
+      this.itemId = row ? row.id : null
+      this.openDetailModal = true
+    },
+    //  关闭弹框
+    closeModal () {
+      this.itemId = ''
+      this.nowData = null
+      this.openModal = false
+    },
+    // 关闭详情弹框
+    closeDetailModal () {
+      this.itemId = ''
+      this.openDetailModal = false
+    },
+    // 重置密码
+    handleReset (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '重置密码后,新的密码会以短信形式发送到【管理员手机】,确定要重置吗?',
+        centered: true,
+        onOk () {
+          // salesDel({ id: row.id }).then(res => {
+          //   if (res.status == 200) {
+          //     _this.$message.success(res.message)
+          //     _this.$refs.table.refresh()
+          //   }
+          // })
+        }
+      })
+    },
+    // 修改状态
+    changeFlagHandle (text, record) {
+      const _data = {
+        id: record.id,
+        flag: record.enabledFlag ? '1' : '0'
+      }
+      updateEnableStatus(_data).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+        } else {
+          record.enabledFlag = !record.enabledFlag
+        }
+      })
+    }
+  }
+}
 </script>
-
-<style>
-</style>

+ 125 - 0
src/views/dealerManagement/userManagement/editModal.vue

@@ -0,0 +1,125 @@
+<template>
+  <a-modal
+    centered
+    class="userManagementEdit-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="分区设置"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="600">
+    <!-- 表单 -->
+    <div>
+      <a-form-model
+        id="userManagementEdit-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="用户姓名" prop="productBrandName">
+          张三丰
+        </a-form-model-item>
+        <a-form-model-item label="所属营销分区" prop="productBrandName">
+          <a-select placeholder="请选择所属营销分区" id="userManagementEdit-level" allowClear v-model="form.levels">
+            <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
+          </a-select>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="userManagementEdit-submit" @click="handleSubmit">确定</a-button>
+        <a-button id="userManagementEdit-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { STable, Upload } from '@/components'
+import Editor from '@/components/WEeditor'
+// import { dealerProductBrandSave } from '@/api/dealerProductBrand'
+export default {
+  name: 'UserManagementEditModal',
+  components: { STable, Upload, Editor },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    },
+    nowData: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        productBrandName: '', // 产品品牌名称
+        image: '',
+        desc: ''
+      },
+      rules: {
+        productBrandName: [
+          { required: true, message: '请输入产品品牌名称', trigger: 'blur' }
+        ]
+      },
+      productBrandList: []
+    }
+  },
+  methods: {
+    //  确定
+    handleSubmit () {
+      const _this = this
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const formData = JSON.parse(JSON.stringify(_this.form))
+          formData.id = _this.itemId ? _this.itemId : undefined
+          dealerProductBrandSave(formData).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('ok')
+              _this.isShow = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .userManagementEdit-modal{
+    .ant-modal-body {
+    	padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 149 - 3
src/views/dealerManagement/userManagement/list.vue

@@ -1,8 +1,154 @@
 <template>
+  <a-card size="small" :bordered="false" class="userManagementList-wrap">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="用户姓名">
+              <a-input id="userManagementList-productBrandName" v-model.trim="queryParam.productBrandName" allowClear placeholder="请输入用户姓名"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="用户账号">
+              <a-input id="userManagementList-productBrandName" v-model.trim="queryParam.productBrandName" allowClear placeholder="请输入用户账号"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="账号状态">
+              <v-select code="PRODUCT_STATUS" id="userManagementList-state" v-model="queryParam.state" allowClear placeholder="请选择账号状态"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="userManagementList-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="userManagementList-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          size="small"
+          type="link"
+          class="button-primary"
+          @click="handleSet(record)"
+          id="userManagementList-set-btn">分区设置</a-button>
+        <a-button
+          size="small"
+          type="link"
+          class="button-warning"
+          @click="handleReset(record)"
+          id="userManagementList-reset-btn">重置密码</a-button>
+      </template>
+    </s-table>
+    <!-- 分区设置 -->
+    <user-management-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="$refs.table.refresh(true)" @close="closeModal" />
+  </a-card>
 </template>
 
 <script>
+// import { dealerProductBrandList, dealerProductBrandUpdate } from '@/api/dealerProductBrand'
+import { STable, VSelect } from '@/components'
+import userManagementEditModal from './editModal.vue'
+export default {
+  components: { STable, VSelect, userManagementEditModal },
+  data () {
+    return {
+      queryParam: { //  查询条件
+        productBrandName: '', //  品牌名称
+        enabledFlag: undefined //  状态
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '用户角色', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '用户姓名', dataIndex: 'productBrandName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '用户账号', dataIndex: 'producstBrandName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '所属营销分区', dataIndex: 'productssBrandName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '账号状态', dataIndex: 'firstChar', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        // return dealerProductBrandList(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++) {
+        //     data.list[i].no = no + i + 1
+        //   }
+        //   this.disabled = false
+        //   return data
+        // })
+        const _this = this
+        return new Promise(function (resolve, reject) {
+          const data = {
+            pageNo: 1,
+            pageSize: 10,
+            list: [
+              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productPic: ['https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg', 'https://qn.antdv.com/vue.png'], productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
+            ]
+          }
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          _this.disabled = false
+          resolve(data)
+        })
+      },
+      openModal: false, //  分区设置  弹框
+      itemId: '', //  当前id
+      nowData: null, //  当前记录数据
+      productBrandList: []
+    }
+  },
+  methods: {
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productBrandName = ''
+      this.queryParam.enabledFlag = undefined
+      this.$refs.table.refresh(true)
+    },
+    // 分区设置
+    handleSet (row) {
+      this.itemId = row ? row.id : null
+      this.nowData = row || null
+      this.openModal = true
+    },
+    //  关闭弹框
+    closeModal () {
+      this.itemId = ''
+      this.nowData = null
+      this.openModal = false
+    },
+    // 重置密码
+    handleReset (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '重置密码后,新的密码会以短信形式发送到【管理员手机】,确定要重置吗?',
+        centered: true,
+        onOk () {
+          // salesDel({ id: row.id }).then(res => {
+          //   if (res.status == 200) {
+          //     _this.$message.success(res.message)
+          //     _this.$refs.table.refresh()
+          //   }
+          // })
+        }
+      })
+    }
+  }
+}
 </script>
-
-<style>
-</style>

+ 8 - 0
src/views/financialManagement/warehousingConfirmation/detail.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 8 - 0
src/views/financialManagement/warehousingConfirmation/list.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 0 - 141
src/views/inventoryManagement/warehouseAllocation/basicInfoModal.vue

@@ -1,141 +0,0 @@
-<template>
-  <a-modal
-    centered
-    class="warehouseAllocation-basicInfo-modal"
-    :footer="null"
-    :maskClosable="false"
-    title="新增"
-    v-model="isShow"
-    @cancle="isShow = false"
-    width="80%">
-    <a-form-model
-      id="warehouseAllocation-basicInfo-form"
-      ref="ruleForm"
-      :model="form"
-      :rules="rules"
-      :label-col="formItemLayout.labelCol"
-      :wrapper-col="formItemLayout.wrapperCol" >
-      <a-form-model-item required label="调出仓库" prop="outWarehouseSn">
-        <a-select id="warehouseAllocation-basicInfo-outWarehouseSn" allowClear placeholder="请选择调出仓库" v-model="form.outWarehouseSn" >
-          <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">
-            {{ item.name }}
-          </a-select-option>
-        </a-select>
-      </a-form-model-item>
-      <a-form-model-item required label="调入仓库" prop="putWarehouseSn">
-        <a-select id="warehouseAllocation-basicInfo-putWarehouseSn" allowClear placeholder="请选择调入仓库" v-model="form.putWarehouseSn" >
-          <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">
-            {{ item.name }}
-          </a-select-option>
-        </a-select>
-      </a-form-model-item>
-      <a-form-model-item label="关联单号" prop="relevanceNo">
-        <a-input id="warehouseAllocation-basicInfo-relevanceNo" :maxLength="50" v-model="form.relevanceNo" placeholder="请输入关联单号(最多50个字符)" allowClear />
-      </a-form-model-item>
-      <a-form-model-item label="备注" prop="remark">
-        <a-textarea id="warehouseAllocation-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="warehouseAllocation-basicInfo-modal-save" @click="handleSave">保存</a-button>
-      <a-button id="warehouseAllocation-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
-    </div>
-  </a-modal>
-</template>
-
-<script>
-import { VSelect } from '@/components'
-import { warehouseAllList } from '@/api/warehouse.js'
-import { allocWarehouseSave } from '@/api/allocWarehouse.js'
-export default {
-  name: 'WarehouseAllocationBasicInfoModal',
-  components: { VSelect },
-  props: {
-    openModal: {
-      //  弹框显示状态
-      type: Boolean,
-      default: false
-    }
-  },
-  watch: {
-    //  父页面传过来的弹框状态
-    openModal (newValue, oldValue) {
-      this.isShow = newValue
-    },
-    //  重定义的弹框状态
-    isShow (newValue, oldValue) {
-      if (!newValue) {
-        this.$emit('close')
-      } else {
-		  this.getWarehouseList()
-	  }
-    }
-  },
-  data () {
-    return {
-      isShow: this.openModal, //  是否打开弹框
-      formItemLayout: {
-        labelCol: { span: 6 },
-        wrapperCol: { span: 16 }
-      },
-      form: {
-        outWarehouseSn: undefined, // 调出仓库
-        putWarehouseSn: undefined, // 调入仓库
-        relevanceNo: '', // 关联单据号
-        remark: '' // 备注
-      },
-      rules: {
-        putWarehouseSn: [{ required: true, message: '请选择调入仓库', trigger: 'blur' }],
-        outWarehouseSn: [{ required: true, message: '请选择调出仓库', trigger: 'blur' }]
-      },
-	  warehouseList: [], // 仓库列表
-      brandData: [] //  供应商  下拉数据
-    }
-  },
-  methods: {
-    // 获取仓库列表
-    getWarehouseList () {
-      warehouseAllList({}).then(res => {
-		  console.log(res, '-----仓库----')
-        if (res.status == 200) {
-          this.warehouseList = res.data || []
-        } else {
-          this.warehouseList = []
-        }
-      })
-    },
-    //  保存
-    handleSave () {
-	  this.$refs['ruleForm'].validate(valid => {
-        if (valid) {
-		  allocWarehouseSave(this.form).then(res => {
-		    if (res.status == 200) {
-		      this.isShow = false
-		      this.$emit('ok', res.data)
-		    }
-		  })
-        } else {
-		  console.log('error submit!!')
-		  return false
-        }
-	  })
-    },
-    filterOption (input, option) {
-      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-    }
-  }
-
-}
-</script>
-
-<style lang="less">
-.warehouseAllocation-basicInfo-modal {
-	.ant-modal-body {
-		padding: 40px 40px 24px;
-	}
-	.btn-cont {
-		text-align: center;
-		margin: 35px 0 10px;
-	}
-}
-</style>

+ 0 - 190
src/views/inventoryManagement/warehouseAllocation/detail.vue

@@ -1,190 +0,0 @@
-<template>
-  <div class="warehouseAllocationDetail-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="warehouseAllocationDetail-back" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="warehouseAllocationDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <a-button
-          v-if="warehouse&&warehouse.stateDictValue!='已完结'"
-          type="primary"
-          size="small"
-          style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
-          id="warehouseAllocationEdit-btn"
-          @click.stop="handleEdit">
-          编辑
-        </a-button>
-        <!-- <a id="warehouseAllocationDetail-back-edit" style="color: #1890ff;margin-left: 20px;" href="javascript:;" @click="handleBack">编辑</a> -->
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-button key="2" id="warehouseAllocationDetail-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="warehouseAllocationDetail-print-btn">快速打印</a-button>
-        <a-button key="3" type="danger" @click="handleExport" :loading="exportLoading" id="warehouseAllocationDetail-export-btn">导出</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="warehouseAllocationDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="调出仓库">{{ warehouse?warehouse.outWarehouseName:'--' }}</a-descriptions-item>
-            <a-descriptions-item label="调入仓库">{{ warehouse?warehouse.putWarehouseName:'--' }}</a-descriptions-item>
-            <a-descriptions-item label="调拨单号">{{ warehouse?warehouse.allocationWarehouseNo:'--' }}</a-descriptions-item>
-            <a-descriptions-item label="关联单号">{{ warehouse?warehouse.relevanceNo ||'--':'--' }}</a-descriptions-item>
-            <a-descriptions-item label="单据状态">{{ warehouse?warehouse.stateDictValue ||'--':'--' }}</a-descriptions-item>
-            <a-descriptions-item label="备注">{{ warehouse?warehouse.remark ||'--':'--' }}</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="warehouseAllocationDetail-cont">
-      <!-- 总计 -->
-      <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">总款数: <strong>{{ productTotalCategory }}</strong> ,总数量: <strong>{{ productTotalQty }}</strong> ,总成本:¥<strong>{{ productTotalCost }}</strong></div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 1335 }"
-        bordered>
-        <!-- 产品类别 -->
-        <template slot="productType" slot-scope="text, record">
-          <a-tooltip placement="top">
-            <template slot="title">
-              <span>{{ record.productTypeName }}</span>
-            </template>
-            {{ record.productTypeName3 }}
-          </a-tooltip>
-        </template>
-        <!-- 成本小计 -->
-        <template slot="totalCost" slot-scope="text, record">
-          <span>{{ (record.allocationCost * record.allocationQty) || 0 }}</span>
-        </template>
-      </s-table>
-    </a-card>
-  </div>
-</template>
-
-<script>
-import moment from 'moment'
-import { STable, VSelect } from '@/components'
-import { allocWarehouseDetailSn, allocWarehouseDetailCount, allocWarehouseDetailList } from '@/api/allocWarehouse.js'
-export default {
-  components: { STable, VSelect },
-  data () {
-    return {
-      exportLoading: false, // 导出loading
-      queryParam: {
-        allocationWarehouseSn: this.$route.params.sn
-      },
-      id: this.$route.params.id, // 单据id
-      productTotalCost: 0, // 总成本
-      productTotalQty: 0, // 总数量
-      productTotalCategory: 0, // 总款项
-      warehouse: null, // 基础信息
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '类别', scopedSlots: { customRender: 'productType' }, width: 160, align: 'center' },
-        { title: '数量', dataIndex: 'allocationQty', width: 100, align: 'center' },
-        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本小计(¥)', scopedSlots: { customRender: 'totalCost' }, width: 135, align: 'center' },
-        { title: '调出仓位', dataIndex: 'outWarehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调入仓位', dataIndex: 'putWarehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        return allocWarehouseDetailList(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++) {
-            data.list[i].no = no + i + 1
-          }
-          this.getProduceTotal()
-          this.disabled = false
-          return data
-        })
-      }
-    }
-  },
-  methods: {
-    //  返回列表
-    handleBack () {
-      this.$router.push({ path: '/allocationManagement/warehouseAllocation/list' })
-    },
-    //  新增/编辑
-    handleEdit () {
-      this.$router.push({ path: `/allocationManagement/warehouseAllocation/edit/${this.warehouse.id}/${this.warehouse.allocationWarehouseSn}` })
-    },
-    // 查询基础信息
-    getHouse () {
-      allocWarehouseDetailSn({ sn: this.$route.params.sn }).then(res => {
-        if (res.status == 200) {
-          this.warehouse = res.data
-          this.queryParam.outWarehouseSn = res.data.outWarehouseSn
-        } else {
-          this.warehouse = null
-        }
-      })
-    },
-    // 已选产品总计查询
-    getProduceTotal () {
-      allocWarehouseDetailCount(this.queryParam).then(res => {
-        if (res.status == 200) {
-          this.productTotalCost = res.data.productTotalCost || 0
-          this.productTotalQty = res.data.productTotalQty || 0
-          this.productTotalCategory = res.data.productTotalCategory || 0
-        } else {
-          this.productTotalCost = 0
-          this.productTotalQty = 0
-          this.productTotalCategory = 0
-        }
-      })
-    },
-    //  导出
-    handleExport () {
-      const params = this.queryParam
-      this.exportLoading = true
-      // customerBundleExportDelay(params).then(res => {
-      //   this.exportLoading = false
-      //   this.download(res)
-      // })
-    },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '仓库调拨' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      // vm.getProductBrand()
-      // vm.getProductType()
-      vm.getHouse()
-      console.log(vm.id, vm.$route.params, 'vm.id')
-    })
-  }
-}
-</script>
-
-<style lang="less">
-  .warehouseAllocationDetail-cont, .warehouseAllocationDetail-back{
-    margin-bottom: 15px;
-  }
-</style>

+ 0 - 622
src/views/inventoryManagement/warehouseAllocation/edit.vue

@@ -1,622 +0,0 @@
-<template>
-  <div class="warehouseAllocationEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="warehouseAllocationEdit-back" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="warehouseAllocationEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-        <span style="margin: 0 15px;color: #666;">调出仓库:{{ (basicInfoData&&basicInfoData.outWarehouseName) || '--' }}</span>
-        <span style="margin: 0 15px;color: #666;">调入仓库:{{ (basicInfoData&&basicInfoData.putWarehouseName) || '--' }}</span>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-button key="2" id="warehouseAllocationEdit-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="warehouseAllocationEdit-print-btn">快速打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 选择产品 -->
-    <a-card size="small" :bordered="false" class="warehouseAllocationEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="选择产品">
-          <!-- 筛选条件 -->
-          <div class="table-page-search-wrapper">
-            <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">
-                    <a-input id="warehouseAllocationEdit-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="warehouseAllocationEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="原厂编码" prop="productOrigCode">
-                    <a-input id="warehouseAllocationEdit-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-select
-                        placeholder="请选择产品品牌"
-                        id="warehouseAllocationEdit-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>
-                  <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="warehouseAllocationEdit-productType"
-                        placeholder="请选择产品分类"
-                        allowClear />
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="调出仓位" prop="warehouseLocationSn">
-                      <a-select id="warehouseAllocationEdit-warehouseLocationSn" placeholder="请选择" allowClear v-model="queryParam.warehouseLocationSn" style="width: 100%;">
-                        <a-select-option v-for="item in warehouseOutLocData" :key="item.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</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="getProductList(1)" :disabled="disabled" id="warehouseAllocationList-refresh">查询</a-button>
-                  <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-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>
-          </div>
-          <!-- 列表 -->
-          <a-table
-            class="sTable"
-            ref="table"
-            size="small"
-            :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
-            :columns="columns"
-            :customRow="handleClickRow"
-            :dataSource="loadData"
-            :scroll="{ x: 1880, y: 300 }"
-            :pagination="paginationProps"
-            bordered>
-            <!-- 产品分类 -->
-            <template slot="productType" slot-scope="text, record">
-              <span v-if="record.dealerProduct.productTypeName2 || record.dealerProduct.productTypeName3">{{ record.dealerProduct.productTypeName2 }} {{ record.dealerProduct.productTypeName3 ? '>' : '' }} {{ record.dealerProduct.productTypeName3 }}</span>
-              <span v-else>--</span>
-            </template>
-            <!-- 调入仓位 -->
-            <template slot="putWarehouseLocationSn" slot-scope="text, record">
-              <a-select id="warehouseAllocationEdit-putWarehouseLocationSn" placeholder="请选择" v-model="record.putWarehouseLocationSn" style="width: 100%;">
-                <a-select-option v-for="item in warehousePutLocData" :key="item.warehouseLocationSn" :disabled="item.warehouseLocationSn==record.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </template>
-            <!-- 调出数量 -->
-            <template slot="outQty" slot-scope="text, record">
-              <a-input-number
-                id="warehouseAllocationEdit-outQty"
-                v-model="record.outQty"
-                :precision="0"
-                :min="1"
-                :max="record.currentQty"
-                placeholder="请输入"
-                style="width: 100%;" />
-            </template>
-            <!-- 操作 -->
-            <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="warehouseAllocationEdit-add-btn">添加</a-button>
-            </template>
-            </s-table>
-          </a-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 已选产品 -->
-    <a-card size="small" :bordered="false" class="warehouseAllocationEdit-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>
-          </a-alert>
-          <!-- 筛选条件 -->
-          <a-row :gutter="15" justify="space-between">
-            <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="9" :sm="24">
-                      <a-form-item label="产品编码" prop="productCode">
-                        <a-input id="warehouseAllocationEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
-                      </a-form-item>
-                    </a-col>
-                    <a-col :md="9" :sm="24">
-                      <a-form-item label="产品名称" prop="productName">
-                        <a-input id="warehouseAllocationEdit-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="getChooseProductList(1)" :disabled="chooseDisabled" id="warehouseAllocationList-refresh">查询</a-button>
-                      <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="warehouseAllocationList-reset">重置</a-button>
-                    </a-col>
-                  </a-row>
-                </a-form>
-              </div>
-            </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" @click.stop="handleDel('', 'all')" id="warehouseAllocationEdit-del-all-btn">整单删除</a-button>
-            </a-col>
-          </a-row>
-          <!-- 列表 -->
-          <a-table
-            class="sTable"
-            ref="chooseTable"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="chooseColumns"
-            :dataSource="chooseLoadData"
-            :scroll="{ x: 1680, y: 300 }"
-            :pagination="choosePaginationProps"
-            bordered>
-            <!-- 产品分类 -->
-            <template slot="productType" slot-scope="text, record">
-              <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
-              <span v-else>--</span>
-            </template>
-            <!-- 调入仓位 -->
-            <template slot="putWarehouseLocationSn" slot-scope="text, record">
-              <a-select
-                id="warehouseAllocationEdit-putWarehouseLocationSn"
-                @change="chooseWarehouseLocChange(record)"
-                placeholder="请选择"
-                v-model="record.putWarehouseLocationSn"
-                style="width: 100%;">
-                <a-select-option v-for="item in warehousePutLocData" :key="item.warehouseLocationSn" :disabled="item.warehouseLocationSn==record.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </template>
-            <!-- 调出数量 -->
-            <template slot="outQty" slot-scope="text, record">
-              <a-input-number
-                id="warehouseAllocationEdit-outQty"
-                v-model="record.outQty"
-                :precision="0"
-                :min="1"
-                :max="999999"
-                placeholder="请输入"
-                @blur="e => outQtyBlur(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="warehouseAllocationEdit-del-btn">删除</a-button>
-            </template>
-          </a-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button
-          type="primary"
-          id="warehouseAllocationEdit-submit"
-          size="large"
-          class="button-primary"
-          @click="handleSubmit"
-          style="padding: 0 60px;">提交</a-button>
-      </div>
-    </a-affix>
-  </div>
-</template>
-
-<script>
-import { STable, VSelect } from '@/components'
-import { allocWarehouseDetailList, allocWarehouseDetail, productQuery, allocWarehouseDetailCount, allocWarehouseDetailSave, allocWarehouseDetailDel, allocWarehouseSubmit } from '@/api/allocWarehouse'
-// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
-// import { dealerProductTypeList } from '@/api/dealerProductType'
-import { warehouseLocAllList } from '@/api/warehouse'
-
-export default {
-  components: { STable, VSelect },
-  data () {
-    return {
-      queryParam: {
-        productCode: '',
-        productName: '',
-        productOrigCode: '', // 原厂编码
-        brandSn: undefined,
-        productTypeSn1: undefined,
-        productTypeSn2: undefined,
-        productTypeSn3: undefined,
-        warehouseLocationSn: undefined // 调出仓位
-      },
-      chooseQueryParam: {
-        productCode: '',
-        productName: ''
-      },
-      disabled: false, //  查询、重置按钮是否可操作
-      chooseDisabled: false, //  查询、重置按钮是否可操作
-      advanced: false, // 高级搜索 展开/关闭
-      productBrandList: [], //  产品品牌  下拉数据
-      productTypeList: [], //  产品分类  下拉数据
-      productType: [],
-      warehousePutLocData: [], //  调入仓位  下拉数据
-      warehouseOutLocData: [], //  调出仓位  下拉数据
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'brandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center', ellipsis: true },
-        { title: '调出仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调入仓位', scopedSlots: { customRender: 'putWarehouseLocationSn' }, width: 140, align: 'center' },
-        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: 140, align: 'center' },
-        { title: '可用库存数', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '冻结库存数', dataIndex: 'freezeQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
-      ],
-      loadData: [],
-      pageNo: 1, //  分页页码
-      pageSize: 10, //  分页 每页多少条
-      paginationProps: {
-        showSizeChanger: true, //  是否可以改变 pageSize
-        total: 0, //  分页总条数
-        current: 1,
-        onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
-        onChange: (current) => this.changePage(current)
-      },
-      // 表头
-      chooseColumns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'brandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center', ellipsis: true },
-        { title: '调出仓位', dataIndex: 'outWarehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调入仓位', scopedSlots: { customRender: 'putWarehouseLocationSn' }, width: 140, align: 'center' },
-        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: 140, align: 'center' },
-        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
-      ],
-      chooseLoadData: [],
-      choosePageNo: 1, //  分页页码
-      choosePageSize: 10, //  分页 每页多少条
-      choosePaginationProps: {
-        showSizeChanger: true, //  是否可以改变 pageSize
-        total: 0, //  分页总条数
-        current: 1,
-        onShowSizeChange: (current, pageSize) => this.changeChoosePageSize(current, pageSize),
-        onChange: (current) => this.changeChoosePage(current)
-      },
-      basicInfoData: null, //  基本信息
-      productTotal: null //  合计
-    }
-  },
-  methods: {
-    //  重置
-    resetSearchForm () {
-      this.queryParam.productCode = ''
-      this.queryParam.productName = ''
-      this.queryParam.productOrigCode = ''
-      this.queryParam.brandSn = undefined
-      this.queryParam.productTypeSn1 = undefined
-      this.queryParam.productTypeSn2 = undefined
-      this.queryParam.productTypeSn3 = undefined
-      this.queryParam.warehouseLocationSn = undefined
-      this.productType = []
-      this.getProductList(1)
-    },
-    // 双击快速添加
-    handleClickRow (record) {
-      return {
-        on: {
-          dblclick: (event) => {
-            this.handleAdd(record)
-          }
-        }
-      }
-    },
-    // 已选产品  重置
-    chooseResetSearchForm () {
-      this.chooseQueryParam.productCode = ''
-      this.chooseQueryParam.productName = ''
-      this.getChooseProductList(1)
-    },
-    // 基本信息
-    getDetail () {
-      allocWarehouseDetail({ id: this.$route.params.id }).then(res => {
-        if (res.status == 200) {
-          this.basicInfoData = res.data
-          this.getWarehouseLoc(res.data.putWarehouseSn, 'put')
-          this.getWarehouseLoc(res.data.outWarehouseSn, 'out')
-        } else {
-          this.basicInfoData = null
-        }
-      })
-    },
-    //  添加/编辑
-    handleAdd (row, isEdit) {
-      if (!isEdit && !row.putWarehouseLocationSn) {
-        this.$message.warning('请选择调入仓位后再添加!')
-        return
-      }
-      if (!isEdit && !row.outQty) {
-        this.$message.warning('请输入调出数量后再添加!')
-        return
-      }
-      const params = {
-        id: isEdit ? row.id : undefined,
-        allocationWarehouseSn: this.$route.params.sn,
-        allocationCost: isEdit ? row.allocationCost : row.putCost,
-        allocationQty: row.outQty,
-        brandSn: row.brandSn,
-        outWarehouseLocationSn: isEdit ? row.outWarehouseLocationSn : row.warehouseLocationSn,
-        productCode: row.productCode,
-        productOrigCode: row.productOrigCode || undefined,
-        productSn: row.productSn,
-        productTypeSn1: row.productTypeSn1,
-        productTypeSn2: row.productTypeSn2,
-        productTypeSn3: row.productTypeSn3,
-        putWarehouseLocationSn: row.putWarehouseLocationSn
-      }
-      if (isEdit) { // 编辑
-        // 清空数量时,值应保持未清空前的值,因数量不可为空
-        if (!row.outQty || row.outQty == row.outQtyBackups) {
-          row.outQty = row.outQtyBackups
-          return
-        }
-      }
-      allocWarehouseDetailSave(params).then(res => {
-        if (res.status == 200) {
-          this.$message.success(res.message)
-          this.getProductList()
-          this.getChooseProductList()
-        }
-      })
-    },
-    //  删除
-    handleDel (row, isAll) {
-      const _this = this
-      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
-      this.$confirm({
-        title: '提示',
-        content: content,
-        centered: true,
-        onOk () {
-          let params
-          if (isAll) { //  整单删除
-            params = { allocationWarehouseSn: _this.$route.params.sn }
-          } else { //  单个删除
-            params = { id: row.id }
-          }
-          allocWarehouseDetailDel(params).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.getProductList()
-              _this.getChooseProductList()
-            }
-          })
-        }
-      })
-    },
-    //  提交
-    handleSubmit () {
-      const _this = this
-      allocWarehouseSubmit({ id: this.$route.params.id }).then(res => {
-        if (res.status == 200) {
-          this.$message.success(res.message)
-          setTimeout(() => {
-            _this.handleBack()
-          }, 1000)
-        }
-      })
-    },
-    // 合计
-    getDetailCount (params) {
-      allocWarehouseDetailCount(params).then(res => {
-        if (res.status == 200) {
-          this.productTotal = res.data
-        } else {
-          this.productTotal = null
-        }
-      })
-    },
-    //  导入明细
-    handleImport () {
-      console.log(333)
-    },
-    //  返回列表
-    handleBack () {
-      this.$router.push({ path: '/allocationManagement/warehouseAllocation/list' })
-    },
-    // 产品列表数据
-    getProductList (pageNo) {
-      this.disabled = true
-      this.pageNo = pageNo || this.pageNo
-      const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
-      params.enabledFlag = 1
-      productQuery(params).then(res => {
-        if (res.status == 200) {
-          const data = res.data
-          this.paginationProps.total = Number(res.data.count) || 0
-          this.paginationProps.current = this.pageNo
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-          }
-          this.loadData = data.list
-          this.disabled = false
-        } else {
-          this.paginationProps.total = 0
-          this.paginationProps.current = 1
-          this.loadData = []
-        }
-      })
-    },
-    //  分页  一页多少条change
-    changePageSize (current, pageSize) {
-      this.pageNo = current
-      this.pageSize = pageSize
-      this.getProductList()
-    },
-    //  分页 页码change
-    changePage (current) {
-      this.pageNo = current
-      this.getProductList()
-    },
-    //  已选产品 分页  一页多少条change
-    changeChoosePageSize (current, pageSize) {
-      this.choosePageNo = current
-      this.choosePageSize = pageSize
-      this.getChooseProductList()
-    },
-    //  已选产品 分页 页码change
-    changeChoosePage (current) {
-      this.choosePageNo = current
-      this.getChooseProductList()
-    },
-    // 已选产品列表数据
-    getChooseProductList (pageNo) {
-      this.choosePageNo = this.choosePageNo || pageNo
-      this.chooseDisabled = true
-      const params = {
-        pageNo: this.choosePageNo,
-        pageSize: this.choosePageSize,
-        allocationWarehouseSn: this.$route.params.sn
-      }
-      allocWarehouseDetailList(Object.assign(params, this.chooseQueryParam)).then(res => {
-        if (res.status == 200) {
-          //  合计
-          this.getDetailCount(Object.assign(params, this.chooseQueryParam))
-          const data = res.data
-          this.choosePaginationProps.total = Number(res.data.count) || 0
-          this.choosePaginationProps.current = data.pageNo
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = no + i + 1
-            data.list[i].outQty = data.list[i].allocationQty
-            data.list[i].outQtyBackups = data.list[i].allocationQty
-          }
-          this.chooseLoadData = data.list
-          this.chooseDisabled = false
-        } else {
-          this.choosePaginationProps.total = 0
-          this.choosePaginationProps.current = 1
-          this.chooseLoadData = []
-        }
-      })
-    },
-    // 已选产品 调出数量  blur
-    outQtyBlur (val, record) {
-      //  光标移出,值发生改变再调用编辑接口
-      if (val != record.outQtyBackups) {
-        this.handleAdd(record, 'edit')
-      }
-    },
-    // 已选产品 仓位  change
-    chooseWarehouseLocChange (record) {
-      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不传,此处应查询所有产品
-      dealerProductBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
-    //  产品分类  列表
-    getProductType () {
-      dealerProductTypeList({}).then(res => {
-        if (res.status == 200) {
-          this.productTypeList = res.data
-        } else {
-          this.productTypeList = []
-        }
-      })
-    },
-    // 获取仓库仓位
-    getWarehouseLoc (sn, type) {
-      warehouseLocAllList({ warehouseSn: sn }).then(res => {
-        if (type == 'put') {
-          this.warehousePutLocData = res.data || []
-        } else if (type == 'out') {
-          this.warehouseOutLocData = res.data || []
-        }
-      })
-    },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.getDetail()
-      vm.getProductList(1)
-      vm.getChooseProductList(1)
-      vm.getProductBrand()
-      vm.getProductType()
-    })
-  }
-}
-</script>
-
-<style lang="less">
-  .warehouseAllocationEdit-wrap{
-    .warehouseAllocationEdit-back{
-      margin-bottom: 15px;
-    }
-    .warehouseAllocationEdit-cont{
-      margin-bottom: 15px;
-      .sub-title{
-        font-size: 12px;
-        color: #808695;
-        margin-left: 10px;
-      }
-      .tag-txt{
-        font-size: 12px;
-        color: #ed1c24;
-      }
-      .edit-circle-btn{
-        margin-left: 15px;
-        i{
-          vertical-align: text-bottom;
-        }
-      }
-      .import-btn{
-        margin-left: 15px;
-      }
-    }
-  }
-</style>

+ 0 - 250
src/views/inventoryManagement/warehouseAllocation/list.vue

@@ -1,250 +0,0 @@
-<template>
-  <a-card size="small" :bordered="false" class="warehouseAllocationList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" ref="searchForm" :model="queryParam" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                id="warehouseAllocationList-createDate"
-                :disabledDate="disabledDate"
-                v-model="createDate"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调出仓库">
-              <a-select id="warehouseAllocation-basicInfo-outWarehouseSn" allowClear placeholder="请选择调出仓库" v-model="queryParam.outWarehouseSn">
-                <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调入仓库">
-              <a-select id="warehouseAllocation-basicInfo-putWarehouseSn" allowClear placeholder="请选择调入仓库" v-model="queryParam.putWarehouseSn">
-                <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <template v-if="advanced">
-            <a-col :md="6" :sm="24">
-              <a-form-item label="业务状态">
-                <v-select
-                  v-model="queryParam.state"
-                  ref="state"
-                  id="warehouseAllocationList-state"
-                  code="ALLOCATION_WAREHOUSE_STATE"
-                  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="warehouseAllocationList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-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>
-    </div>
-    <!-- 操作按钮 -->
-    <div class="table-operator">
-		<a-button id="warehouseAllocationList-add" type="primary" class="button-error" @click="openModal = true">新增</a-button>
-	</div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="record => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1500, y: tableHeight }"
-      bordered>
-      <!-- 单号 -->
-      <template slot="allocationWarehouseNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.allocationWarehouseNo }}</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          v-if="record.state == 'WAIT_AUDIT'"
-          size="small"
-          type="link"
-          class="button-warning"
-          @click="handleExamine(record)"
-          id="warehouseAllocationList-examine-btn">
-          审核
-        </a-button>
-        <a-button
-          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')"
-          size="small"
-          type="link"
-          class="button-info"
-          @click="handleEdit(record)"
-          id="warehouseAllocationList-edit-btn">
-          编辑
-        </a-button>
-        <a-button
-          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')"
-          size="small"
-          type="link"
-          class="button-error"
-          @click="handleDel(record)"
-          id="warehouseAllocationList-del-btn">
-          删除
-        </a-button>
-        <span v-if="(record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT')">--</span>
-      </template>
-    </s-table>
-    <!-- 新增/编辑 -->
-    <basic-info-modal :openModal="openModal" @ok="handleEdit" @close="openModal=false" />
-  </a-card>
-</template>
-
-<script>
-import { allocWarehouseList, allocWarehouseAudit, allocWarehouseDel } from '@/api/allocWarehouse'
-import { warehouseAllList } from '@/api/warehouse.js'
-import { STable, VSelect } from '@/components'
-import basicInfoModal from './basicInfoModal.vue'
-import moment from 'moment'
-export default {
-  components: { STable, VSelect, basicInfoModal },
-  data () {
-    return {
-      advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      createDate: undefined, //  创建时间
-      warehouseList: [], // 仓库列表
-      queryParam: { //  查询条件
-        outWarehouseSn: undefined, //  调出仓库
-        putWarehouseSn: undefined, //  调入仓库
-        state: 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: 'allocationWarehouseNo' }, align: 'center' },
-        { title: '调出仓库', dataIndex: 'outWarehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调入仓库', dataIndex: 'putWarehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { 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: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 380
-        }
-        // 创建时间
-        if (this.createDate && this.createDate.length > 0) {
-          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
-        return allocWarehouseList(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++) {
-            data.list[i].no = no + i + 1
-          }
-          this.disabled = false
-          return data
-        })
-      },
-      openModal: false //  新增编辑  弹框
-    }
-  },
-  methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
-    },
-    // 获取仓库列表
-    getWarehouseList () {
-      warehouseAllList({}).then(res => {
-        if (res.status == 200) {
-          this.warehouseList = res.data || []
-        } else {
-          this.warehouseList = []
-        }
-      })
-    },
-    //  重置
-    resetSearchForm () {
-      this.queryParam.outWarehouseSn = undefined
-      this.queryParam.putWarehouseSn = undefined
-      this.queryParam.state = undefined
-      this.createDate = undefined
-      this.$refs.table.refresh(true)
-    },
-    //  删除
-    handleDel (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '删除后不可恢复,确定要进行删除吗?',
-        centered: true,
-        onOk () {
-          allocWarehouseDel({ id: row.id }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-            }
-          })
-        }
-      })
-    },
-    //  审核
-    handleExamine (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确认要审核通过吗?',
-        centered: true,
-        onOk () {
-          allocWarehouseAudit({ allocationWarehouseSn: row.allocationWarehouseSn }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-            }
-          })
-        }
-      })
-    },
-    //  详情
-    handleDetail (row) {
-      this.$router.push({ path: `/allocationManagement/warehouseAllocation/detail/${row.allocationWarehouseSn}` })
-    },
-    //  新增/编辑
-    handleEdit (row) {
-      this.$router.push({ path: `/allocationManagement/warehouseAllocation/edit/${row.id}/${row.allocationWarehouseSn}` })
-    }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.queryParam.outWarehouseSn = undefined
-      vm.queryParam.putWarehouseSn = undefined
-      vm.queryParam.state = undefined
-      vm.createDate = undefined
-      vm.getWarehouseList()
-    })
-  }
-}
-</script>

+ 184 - 0
src/views/purchasingManagement/bulkWarehousingOrder/basicInfoModal.vue

@@ -0,0 +1,184 @@
+<template>
+  <a-modal
+    centered
+    class="bulkWarehousingOrder-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="新增散件入库单"
+    v-model="isShow"
+    @cancle="isShow=false"
+    width="80%">
+    <a-form-model
+      id="bulkWarehousingOrder-basicInfo-form"
+      ref="ruleForm"
+      :model="form"
+      :rules="rules"
+      :label-col="formItemLayout.labelCol"
+      :wrapper-col="formItemLayout.wrapperCol" >
+      <a-form-model-item label="供应商" prop="supplierSn">
+        <a-select
+          placeholder="请输入名称查询,如果没有请点击 '+' 新增"
+          allowClear
+          v-model="form.supplierSn"
+          :showSearch="true"
+          option-filter-prop="children"
+          :filter-option="filterOption"
+          style="width: 80%;">
+          <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn" :disabled="item.enabledFlag==0">{{ item.supplierName }}</a-select-option>
+        </a-select>
+        <a-button icon="plus" size="small" @click="openSupplierModal=true" id="bulkWarehousingOrder-basicInfo-add-btn" style="margin-left: 10px;"></a-button>
+      </a-form-model-item>
+      <a-form-model-item label="散件入库类型" prop="sparePartsType">
+        <a-select id="bulkWarehousingOrder-basicInfo-sparePartsType" placeholder="请选择散件入库类型" allowClear v-model="form.sparePartsType">
+          <a-select-option v-for="item in sparePartsPutTypeList" :key="item.sparePartsPutTypeSn" :value="item.sparePartsPutTypeSn">{{ item.name }}</a-select-option>
+        </a-select>
+      </a-form-model-item>
+      <a-form-model-item label="备注" prop="remarks">
+        <a-textarea
+          id="bulkWarehousingOrder-remarks"
+          :maxLength="200"
+          v-model="form.remarks"
+          placeholder="请输入备注(最多200个字符)"
+          allowClear />
+      </a-form-model-item>
+    </a-form-model>
+    <div class="btn-cont">
+      <a-button type="primary" id="bulkWarehousingOrder-basicInfo-modal-save" @click="handleSave">保存</a-button>
+      <a-button id="bulkWarehousingOrder-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+    </div>
+    <!-- 供应商 -->
+    <!-- <supplier-info-edit-modal :openModal="openSupplierModal" @close="closeSupplierModal" @ok="handleOk" :isState="false" /> -->
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+// import supplierInfoEditModal from '@/views/supplierManagement/supplierInfo/editModal.vue'
+// import { supplierAllList } from '@/api/supplier'
+// import { sparePartsPutTypeAllList } from '@/api/sparePartsPutType'
+// import { sparePartsPurSave } from '@/api/sparePartsPur'
+export default {
+  name: 'BulkWarehousingOrderBasicInfoModal',
+  components: { VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        supplierSn: undefined, // 供应商
+        sparePartsType: undefined, //  散件类型
+        remarks: '' // 备注
+      },
+      rules: {
+        supplierSn: [
+          { required: true, message: '请选择供应商', trigger: 'change' }
+        ],
+        sparePartsType: [
+          { required: true, message: '请选择散件入库类型', trigger: 'change' }
+        ]
+      },
+      supplierList: [], //  供应商  下拉数据
+      sparePartsPutTypeList: [], //  散件入库类型  下拉数据
+      openSupplierModal: false //  供应商 弹框
+    }
+  },
+  methods: {
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          sparePartsPurSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.isShow = false
+                _this.$emit('ok', res.data)
+              }, 1000)
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 新增供应商 成功
+    handleOk () {
+      //  获取供应商数据列表,并赋值
+      this.getSupplierList('val')
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    // 供应商下拉数据
+    getSupplierList (val) {
+      supplierAllList().then(res => {
+        if (res.status == 200) {
+          this.supplierList = res.data
+          if (val) { //  需将新增加的供应商回填,即不需要用户再选一下
+            this.form.supplierSn = this.supplierList[0].supplierSn
+            this.$refs.ruleForm.clearValidate('supplierSn')
+          }
+        } else {
+          this.supplierList = []
+        }
+      })
+    },
+    // 散件入库类型下拉数据
+    getSparePartsPutTypeList () {
+      sparePartsPutTypeAllList().then(res => {
+        if (res.status == 200) {
+          this.sparePartsPutTypeList = res.data
+        } else {
+          this.sparePartsPutTypeList = []
+        }
+      })
+    },
+    // 关闭供应商弹框
+    closeSupplierModal () {
+      this.openSupplierModal = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+      } else {
+        this.getSupplierList()
+        this.getSparePartsPutTypeList()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .bulkWarehousingOrder-basicInfo-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 183 - 0
src/views/purchasingManagement/bulkWarehousingOrder/detail.vue

@@ -0,0 +1,183 @@
+<template>
+  <div class="bulkWarehousingOrderDetail-wrap">
+    <a-page-header :ghost="false" :backIcon="false" class="bulkWarehousingOrderDetail-cont" >
+      <!-- 自定义的二级文字标题 -->
+      <template slot="subTitle">
+        <a id="bulkWarehousingOrderDetail-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="bulkWarehousingOrderDetail-edit-btn"
+          @click.stop="handleEdit">编辑</a-button>
+        <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseNo) || '--' }}</p>
+      </template>
+      <template slot="tags">
+        <a-tag color="red" v-if="basicInfoData&&basicInfoData.stateDictValue">{{ basicInfoData.stateDictValue }}</a-tag>
+        <a-tag color="orange" v-if="basicInfoData&&basicInfoData.settleStateDictValue">{{ basicInfoData.settleStateDictValue }}</a-tag>
+      </template>
+      <!-- 操作区,位于 title 行的行尾 -->
+      <template slot="extra">
+        <a-button key="2" id="bulkWarehousingOrderDetail-preview-btn">打印预览</a-button>
+        <a-button key="1" type="primary" id="bulkWarehousingOrderDetail-print-btn">快速打印</a-button>
+      </template>
+    </a-page-header>
+    <!-- 基础信息 -->
+    <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1" header="基础信息">
+          <a-descriptions :column="3">
+            <a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="散件入库类型">{{ (basicInfoData&&basicInfoData.sparePartsTypeName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="联系人">
+              {{ (basicInfoData&&basicInfoData.supplierContactPerson) || '--' }}
+              <span v-if="basicInfoData&&basicInfoData.supplierContactTel">({{ basicInfoData.supplierContactTel }})</span>
+            </a-descriptions-item>
+            <a-descriptions-item label="联系地址">
+              {{ (basicInfoData&&basicInfoData.supplierProvinceName) || '' }}
+              {{ (basicInfoData&&basicInfoData.supplierCityName) || '' }}
+              {{ (basicInfoData&&basicInfoData.supplierCountyName) || '' }}
+              {{ (basicInfoData&&basicInfoData.supplierAddress) || '' }}
+            </a-descriptions-item>
+          </a-descriptions>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
+    <!-- 产品详情 -->
+    <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-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>
+          </a-alert>
+          <!-- 列表 -->
+          <s-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.id"
+            :columns="columns"
+            :data="loadData"
+            :scroll="{ x: 1180 }"
+            bordered>
+          </s-table>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
+    <!-- 单据记录  二期 -->
+    <!-- <a-card size="small" :bordered="false" class="bulkWarehousingOrderDetail-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1" header="单据记录">
+          <a-timeline class="timeline-box">
+            <a-timeline-item>2021-02-01 15:22:38   王凯   审核通过</a-timeline-item>
+            <a-timeline-item>
+              <p>2021-02-01 15:22:38   王凯   审核通过</p>
+              <p class="auxiliary-txt">产品编号JA-11076P的采购数量,由【10】修改为【5】</p>
+              <p class="auxiliary-txt">产品编号JA-11076P的采购数量,由【10】修改为【5】</p>
+            </a-timeline-item>
+            <a-timeline-item>Technical testing 2015-09-01</a-timeline-item>
+            <a-timeline-item>Network problems being solved 2015-09-01</a-timeline-item>
+          </a-timeline>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card> -->
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { getOperationalPrecision } from '@/libs/tools.js'
+// import { sparePartsPurDetail, sparePartsPurDetailList, sparePartsPurDetailCount } from '@/api/sparePartsPur'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购单价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购数量', dataIndex: 'putQty', 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: '采购金额', dataIndex: 'purchaseAmount', 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 }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        return sparePartsPurDetailList(Object.assign(parameter, { sparePartsPurchaseSn: 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].purchaseAmount = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
+          }
+          this.disabled = false
+          return data
+        })
+      },
+      basicInfoData: null, //  基本信息
+      productTotal: null //  合计
+    }
+  },
+  computed: {
+    isEdit () {
+      return this.basicInfoData && this.basicInfoData.state != 'FINISH'
+    }
+  },
+  methods: {
+    //  返回列表
+    handleBack () {
+      this.$router.push({ path: '/bulkManagement/bulkWarehousingOrder/list' })
+    },
+    // 基本信息
+    getDetail () {
+      sparePartsPurDetail({ id: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
+    // 合计
+    getDetailCount () {
+      sparePartsPurDetailCount({ sparePartsPurchaseSn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = null
+        }
+      })
+    },
+    //  编辑
+    handleEdit () {
+      this.$router.push({ path: `/bulkManagement/bulkWarehousingOrder/edit/${this.basicInfoData.id}/${this.basicInfoData.sparePartsPurchaseSn}` })
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getDetail()
+      vm.getDetailCount()
+    })
+  }
+}
+</script>
+
+<style lang="less">
+  .bulkWarehousingOrderDetail-cont{
+    margin-bottom: 15px;
+    .timeline-box{
+      margin-top: 30px;
+      .auxiliary-txt{
+        color: #808695;
+      }
+    }
+  }
+</style>

+ 703 - 0
src/views/purchasingManagement/bulkWarehousingOrder/edit.vue

@@ -0,0 +1,703 @@
+<template>
+  <div class="bulkWarehousingOrderEdit-wrap">
+    <!-- 内容 -->
+    <a-page-header :ghost="false" :backIcon="false" class="bulkWarehousingOrderEdit-cont" >
+      <!-- 自定义的二级文字标题 -->
+      <template slot="subTitle">
+        <a id="bulkWarehousingOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseNo) || '' }}</p>
+      </template>
+      <!-- 操作区,位于 title 行的行尾 -->
+      <template slot="extra">
+        <a-button key="2" id="bulkWarehousingOrderEdit-preview-btn">打印预览</a-button>
+        <a-button key="1" type="primary" id="bulkWarehousingOrderEdit-print-btn">快速打印</a-button>
+      </template>
+    </a-page-header>
+    <!-- 基础信息 -->
+    <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1">
+          <template slot="header">
+            基础信息
+            <!-- <a-button type="primary" shape="circle" size="small" icon="edit" class="edit-circle-btn" id="bulkWarehousingOrderEdit-edit-circle-btn" @click.stop="handleEditInfo" /> -->
+          </template>
+          <a-descriptions :column="3">
+            <a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="散件入库类型">{{ (basicInfoData&&basicInfoData.sparePartsTypeName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
+          </a-descriptions>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
+    <!-- 选择产品 -->
+    <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1">
+          <template slot="header">
+            选择产品<span class="sub-title">①输入查询条件--->②查找到需要入库的配件--->③录入成本价、数量、仓库、仓位--->④点击“添加”</span>
+          </template>
+          <!-- 选择产品 -->
+          <div>
+            <!-- 搜索条件 -->
+            <div class="table-page-search-wrapper">
+              <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+                <a-row :gutter="15">
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="关键词">
+                      <a-input id="bulkWarehousingOrderEdit-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="产品名称/产品编码/原厂编码"/>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="产品品牌">
+                      <a-select
+                        placeholder="请选择产品品牌"
+                        id="bulkWarehousingOrderEdit-productBrandSn"
+                        allowClear
+                        v-model="queryParam.productBrandSn"
+                        :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>
+                  <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="productInfoList-productType"
+                        placeholder="请选择产品分类"
+                        allowClear />
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-button style="margin-bottom: 18px;" type="primary" @click="getDealerProductList(1)" :disabled="disabled" id="bulkWarehousingOrderEdit-refresh">查询</a-button>
+                    <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="bulkWarehousingOrderEdit-reset">重置</a-button>
+                  </a-col>
+                </a-row>
+              </a-form>
+            </div>
+            <!-- 列表 -->
+            <a-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="columns"
+              :customRow="handleClickRow"
+              :dataSource="loadData"
+              :scroll="{ x: 1600, y: 300 }"
+              :pagination="paginationProps"
+              @change="onTableChange"
+              bordered>
+              <!-- 成本价 -->
+              <template slot="putCost" slot-scope="text, record">
+                <a-input-number
+                  id="bulkWarehousingOrderEdit-putCost"
+                  v-model="record.putCost"
+                  :precision="2"
+                  :min="1"
+                  :max="999999"
+                  placeholder="请输入"
+                  style="width: 100%;" />
+              </template>
+              <!-- 数量 -->
+              <template slot="putQty" slot-scope="text, record">
+                <a-input-number
+                  id="bulkWarehousingOrderEdit-putQty"
+                  v-model="record.putQty"
+                  :precision="0"
+                  :min="1"
+                  :max="999999"
+                  placeholder="请输入"
+                  style="width: 100%;" />
+              </template>
+              <!-- 仓库仓位 -->
+              <template slot="warehouse" slot-scope="text, record, index">
+                <a-cascader
+                  @change="e => changeWarehouseCascade(e, record, index, 'dealerProduct')"
+                  v-model="record.warehouseCascade"
+                  expand-trigger="hover"
+                  :allowClear="false"
+                  :options="warehouseCascadeData"
+                  :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
+                  id="bulkWarehousingOrderEdit-warehouseCascade"
+                  placeholder="请选择仓库仓位"
+                  style="width: 100%;" />
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="bulkWarehousingOrderEdit-add-btn">添加</a-button>
+              </template>
+            </a-table>
+          </div>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
+    <!-- 已选产品 -->
+    <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1">
+          <template slot="header">
+            已选产品
+            <a-button size="small" class="import-btn" id="bulkWarehousingOrderEdit-import-btn" @click.stop="handleImport">导入明细</a-button>
+          </template>
+          <!-- 已选产品 -->
+          <div>
+            <!-- 总计 -->
+            <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>
+            </a-alert>
+            <!-- 列表 -->
+            <a-table
+              class="sTable"
+              ref="chooseTable"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="chooseColumns"
+              :dataSource="chooseLoadData"
+              :scroll="{ x: 1700, y: 300 }"
+              :pagination="choosePaginationProps"
+              @change="onChooseTableChange"
+              bordered>
+              <!-- 成本价 -->
+              <template slot="putCost" slot-scope="text, record">
+                <a-input-number
+                  id="bulkWarehousingOrderEdit-choose-putCost"
+                  v-model="record.putCost"
+                  :precision="2"
+                  :min="1"
+                  :max="999999"
+                  placeholder="请输入"
+                  @blur="e => putCostBlur(e.target.value, record)"
+                  style="width: 100%;" />
+              </template>
+              <!-- 数量 -->
+              <template slot="putQty" slot-scope="text, record">
+                <a-input-number
+                  id="bulkWarehousingOrderEdit-choose-putQty"
+                  v-model="record.putQty"
+                  :precision="0"
+                  :min="1"
+                  :max="999999"
+                  placeholder="请输入"
+                  @blur="e => putQtyBlur(e.target.value, record)"
+                  style="width: 100%;" />
+              </template>
+              <!-- 仓库仓位 -->
+              <template slot="warehouse" slot-scope="text, record, index">
+                <a-cascader
+                  @change="e => changeWarehouseCascade(e, record, index, 'sparePartsPurDetail')"
+                  v-model="record.warehouseCascade"
+                  expand-trigger="hover"
+                  :allowClear="false"
+                  :options="warehouseCascadeData"
+                  :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
+                  id="bulkWarehousingOrderEdit-choose-warehouseCascade"
+                  placeholder="请选择仓库仓位"
+                  style="width: 100%;" />
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="bulkWarehousingOrderEdit-del-btn">删除</a-button>
+              </template>
+            </a-table>
+          </div>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
+    <a-affix :offset-bottom="0">
+      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
+        <a-button
+          type="primary"
+          id="bulkWarehousingOrderEdit-submit"
+          size="large"
+          class="button-primary"
+          @click="handleSubmit"
+          style="padding: 0 60px;">提交</a-button>
+      </div>
+    </a-affix>
+    <!-- 选择基本信息弹框 -->
+    <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import basicInfoModal from './basicInfoModal.vue'
+import { getOperationalPrecision } from '@/libs/tools.js'
+// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+// import { dealerProductTypeList } from '@/api/dealerProductType'
+// import { sparePartsPurDetail, sparePartsPurDetailList, sparePartsPurDetailCount, sparePartsPurDetailSave, sparePartsPurDetailDel, sparePartsPurSubmit } from '@/api/sparePartsPur'
+// import { dealerProductList } from '@/api/dealerProduct'
+import { warehouseCascadeList } from '@/api/warehouse'
+export default {
+  components: { STable, VSelect, basicInfoModal },
+  data () {
+    return {
+      queryParam: {
+        queryWord: '',
+        productBrandSn: undefined,
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined
+      },
+      productBrandList: [], //  产品品牌  下拉数据
+      productTypeList: [], //  产品分类  下拉数据
+      productType: [],
+      warehouseCascadeData: [], //  仓库仓位
+      disabled: false, //  查询、重置按钮是否可操作
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productBrandName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', scopedSlots: { customRender: 'putCost' }, width: 140, align: 'center' },
+        { title: '数量', scopedSlots: { customRender: 'putQty' }, width: 140, align: 'center' },
+        { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: 200, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+      ],
+      loadData: [],
+      pageNo: 1, //  分页页码
+      pageSize: 10, //  分页 每页多少条
+      paginationProps: {
+        showSizeChanger: true, //  是否可以改变 pageSize
+        total: 0, //  分页总条数
+        current: 1,
+        onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
+        onChange: (current) => this.changePage(current)
+      },
+      // 表头
+      chooseColumns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', sorter: true },
+        { 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: 'brandName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', scopedSlots: { customRender: 'putCost' }, width: 140, align: 'center' },
+        { title: '数量', scopedSlots: { customRender: 'putQty' }, width: 140, align: 'center' },
+        { title: '成本小计', dataIndex: 'costSubtotal', width: 100, align: 'center' },
+        { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: 200, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+      ],
+      chooseLoadData: [],
+      choosePageNo: 1, //  分页页码
+      choosePageSize: 10, //  分页 每页多少条
+      choosePaginationProps: {
+        showSizeChanger: true, //  是否可以改变 pageSize
+        total: 0, //  分页总条数
+        current: 1,
+        onShowSizeChange: (current, pageSize) => this.changeChoosePageSize(current, pageSize),
+        onChange: (current) => this.changeChoosePage(current)
+      },
+      openModal: false, // 选择基本信息弹框是否显示
+      warehouseList: [], //  仓库  下拉数据
+      warehouseLocList: {}, //  仓位  下拉数据
+      defaultWarehouseCascade: [], //  默认仓库仓位
+      chooseWarehouseList: [], //  已选产品 仓库  下拉数据
+      chooseWarehouseLocList: {}, //  已选产品 仓位  下拉数据
+      basicInfoData: null, //  基本信息
+      productTotal: null //  合计
+    }
+  },
+  methods: {
+    //  重置
+    resetSearchForm () {
+      this.queryParam.queryWord = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.productType = []
+      this.getDealerProductList(1)
+    },
+    // 双击快速添加
+    handleClickRow (record) {
+      return {
+        on: {
+          dblclick: (event) => {
+            this.handleAdd(record)
+          }
+        }
+      }
+    },
+    //  分页  一页多少条change
+    changePageSize (current, pageSize) {
+      this.pageNo = current
+      this.pageSize = pageSize
+      this.getDealerProductList()
+    },
+    //  分页 页码change
+    changePage (current) {
+      this.pageNo = current
+      this.getDealerProductList()
+    },
+    //  已选产品 分页  一页多少条change
+    changeChoosePageSize (current, pageSize) {
+      this.choosePageNo = current
+      this.choosePageSize = pageSize
+      this.getChooseDealerProductList()
+    },
+    //  已选产品 分页 页码change
+    changeChoosePage (current) {
+      this.choosePageNo = current
+      this.getChooseDealerProductList()
+    },
+    // 基本信息
+    getDetail () {
+      sparePartsPurDetail({ id: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
+    //  添加/编辑
+    handleAdd (row, isEdit) {
+      if (!isEdit && !row.putCost) {
+        this.$message.warning('请输入成本价后再添加!')
+        return
+      }
+      if (!isEdit && !row.putQty) {
+        this.$message.warning('请输入数量后再添加!')
+        return
+      }
+      if (!isEdit && !row.warehouseSn) {
+        this.$message.warning('请选择仓库后再添加!')
+        return
+      }
+      if (!isEdit && !row.warehouseLocationSn) {
+        this.$message.warning('请选择仓位后再添加!')
+        return
+      }
+      const params = {
+        id: isEdit ? row.id : undefined,
+        sparePartsPurchaseSn: this.$route.params.sn,
+        putCost: row.putCost,
+        putQty: row.putQty,
+        productCode: isEdit ? row.productCode : row.code,
+        productOrigCode: (isEdit ? row.productOrigCode : row.origCode) || undefined,
+        productSn: row.productSn,
+        productTypeSn1: row.productTypeSn1,
+        productTypeSn2: row.productTypeSn2,
+        productTypeSn3: row.productTypeSn3,
+        brandSn: isEdit ? row.brandSn : row.productBrandSn,
+        warehouseLocationSn: row.warehouseLocationSn,
+        warehouseSn: row.warehouseSn
+      }
+      if (isEdit) { // 编辑
+        // 清空成本价或数量时,值应保持未清空前的值,因成本价和数量都不可为空
+        if (!row.putCost) {
+          row.putCost = row.putCostBackups
+          return
+        }
+        if (!row.putQty) {
+          row.putQty = row.putQtyBackups
+          return
+        }
+      }
+      sparePartsPurDetailSave(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.getChooseDealerProductList()
+        }
+      })
+    },
+    //  提交
+    handleSubmit () {
+      const _this = this
+      sparePartsPurSubmit({ id: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          setTimeout(() => {
+            _this.handleBack()
+          }, 1000)
+        }
+      })
+    },
+    //  删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除后不可恢复,确定要进行删除吗?',
+        centered: true,
+        onOk () {
+          sparePartsPurDetailDel({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.getChooseDealerProductList()
+            }
+          })
+        }
+      })
+    },
+    //  编辑基本信息
+    handleEditInfo () {
+      this.openModal = true
+    },
+    //  基本信息  保存
+    handleOk () {},
+    //  导入明细
+    handleImport () {
+      console.log(333)
+    },
+    //  返回列表
+    handleBack () {
+      this.$router.push({ path: '/bulkManagement/bulkWarehousingOrder/list' })
+    },
+    // 合计
+    getDetailCount (params) {
+      sparePartsPurDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = null
+        }
+      })
+    },
+    changeWarehouseCascade (val, opt, ind, type) {
+      let loadData
+      if (type == 'dealerProduct') { //  全部产品
+        loadData = this.loadData[ind]
+      } else if (type == 'sparePartsPurDetail') { //  已选产品
+        loadData = this.chooseLoadData[ind]
+      }
+      if (val.length < 2) {
+        this.$message.warning('当前仓库无仓位,请选择其他仓库')
+        const warehouseSnBackups = loadData.warehouseSnBackups || undefined
+        const warehouseLocationSnBackups = loadData.warehouseLocationSnBackups || undefined
+        loadData.warehouseSn = warehouseSnBackups
+        loadData.warehouseLocationSn = warehouseLocationSnBackups
+        if (warehouseSnBackups || warehouseLocationSnBackups) {
+          loadData.warehouseCascade = [warehouseSnBackups, warehouseLocationSnBackups]
+        } else {
+          loadData.warehouseCascade = undefined
+        }
+      } else {
+        loadData.warehouseSn = val[0] ? val[0] : ''
+        loadData.warehouseLocationSn = val[1] ? val[1] : ''
+        if (type == 'sparePartsPurDetail') { //  已选产品
+          loadData = this.chooseLoadData[ind]
+          this.handleAdd(loadData, 'edit')
+        }
+      }
+    },
+    // 已选产品 成本价  blur
+    putCostBlur (val, record) {
+      //  光标移出,值发生改变再调用编辑接口
+      if (val != record.putCostBackups) {
+        this.handleAdd(record, 'edit')
+      }
+    },
+    // 已选产品 数量  blur
+    putQtyBlur (val, record) {
+      if (val != record.putQtyBackups) {
+        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] : ''
+    },
+    // 产品列表数据
+    getDealerProductList (pageNo, sorter) {
+      this.disabled = true
+      this.pageNo = pageNo || this.pageNo
+      const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
+      params.enabledFlag = 1
+      params.sysFlag = 0
+      if (sorter) {
+        params.sortField = sorter.field
+        params.sortOrder = sorter.order
+        params.sortAlias = 'dp'
+      }
+      dealerProductList(params).then(res => {
+        if (res.status == 200) {
+          const data = res.data
+          this.paginationProps.total = Number(res.data.count) || 0
+          this.paginationProps.current = this.pageNo
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+            if (this.defaultWarehouseCascade.length > 0) {
+              data.list[i].warehouseCascade = this.defaultWarehouseCascade
+              data.list[i].warehouseSn = this.defaultWarehouseCascade[0]
+              data.list[i].warehouseLocationSn = this.defaultWarehouseCascade[1]
+            } else {
+              data.list[i].warehouseCascade = undefined
+            }
+          }
+          this.loadData = data.list
+          this.disabled = false
+        } else {
+          this.paginationProps.total = 0
+          this.paginationProps.current = 1
+          this.loadData = []
+        }
+      })
+    },
+    // 已选产品列表数据
+    getChooseDealerProductList (pageNo, sorter) {
+      this.choosePageNo = pageNo || this.choosePageNo
+      const params = {
+        pageNo: this.choosePageNo,
+        pageSize: this.choosePageSize,
+        sparePartsPurchaseSn: this.$route.params.sn
+      }
+      if (sorter) {
+        params.sortField = sorter.field == 'brandName' ? 'productBrandName' : 'productCode'
+        params.sortOrder = sorter.order
+        params.sortAlias = sorter.field == 'brandName' ? 'dp' : 'sppd'
+      }
+      sparePartsPurDetailList(params).then(res => {
+        if (res.status == 200) {
+          this.getDetailCount(params)
+          const data = res.data
+          this.choosePaginationProps.total = Number(res.data.count) || 0
+          this.choosePaginationProps.current = data.pageNo
+          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].putCostBackups = data.list[i].putCost
+            data.list[i].putQtyBackups = data.list[i].putQty
+            const warehouseSn = data.list[i].warehouseSn || undefined
+            const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
+            if (warehouseSn || warehouseLocationSn) {
+              data.list[i].warehouseSnBackups = warehouseSn
+              data.list[i].warehouseLocationSnBackups = warehouseLocationSn
+              data.list[i].warehouseCascade = [warehouseSn, warehouseLocationSn]
+            } else {
+              data.list[i].warehouseCascade = undefined
+            }
+            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
+          }
+          this.chooseLoadData = data.list
+        } else {
+          this.choosePaginationProps.total = 0
+          this.choosePaginationProps.current = 1
+          this.chooseLoadData = []
+        }
+      })
+    },
+    //  仓库仓位  级联  列表
+    getWarehouseCascade () {
+      const _this = this
+      warehouseCascadeList({}).then(res => {
+        if (res.status == 200) {
+          res.data.filter(item => {
+            // 过滤默认仓库
+            if (item.defaultFlag == 1 && item.wasteFlag == 0) { //  defaultFlag为1,且不是废品仓
+              _this.defaultWarehouseCascade[0] = item.id
+              // 过滤默认仓位
+              item.warehouseLocationList.filter(subItem => {
+                if (subItem.defaultFlag == 1 && subItem.wasteFlag == 0) {
+                  _this.defaultWarehouseCascade[1] = subItem.id
+                  _this.getDealerProductList(1)
+                  _this.getChooseDealerProductList(1)
+                }
+              })
+            }
+          })
+          res.data.map(item => {
+            item.sn = item.warehouseSn
+            if (item.warehouseLocationList) {
+              item.warehouseLocationList.map(subItem => {
+                subItem.sn = subItem.warehouseLocationSn
+              })
+            }
+          })
+          this.warehouseCascadeData = res.data
+        } else {
+          this.warehouseCascadeData = []
+        }
+      })
+    },
+    //  产品品牌  列表
+    getProductBrand () {
+      // sysFlag传0,表示只查自建产品
+      dealerProductBrandQuery({ 'sysFlag': '0' }).then(res => {
+        if (res.status == 200) {
+          this.productBrandList = res.data
+        } else {
+          this.productBrandList = []
+        }
+      })
+    },
+    //  产品分类  列表
+    getProductType () {
+      dealerProductTypeList({ 'sysFlag': '0' }).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    // 选择产品 表格  change
+    onTableChange (pagination, filters, sorter) {
+      console.log('-------------------------------')
+      console.log('params', pagination, filters, sorter)
+      this.getDealerProductList(this.pageNo, sorter)
+    },
+    // 已选产品 表格  change
+    onChooseTableChange (pagination, filters, sorter) {
+      console.log('++++++++++++++++++++++++++++++++++')
+      this.getChooseDealerProductList(this.choosePageNo, sorter)
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.openModal = false
+      vm.getWarehouseCascade()
+      vm.getDetail()
+      vm.getProductBrand()
+      vm.getProductType()
+    })
+  }
+}
+</script>
+
+<style lang="less">
+  .bulkWarehousingOrderEdit-wrap{
+    .bulkWarehousingOrderEdit-cont{
+      margin-bottom: 15px;
+      .sub-title{
+        font-size: 12px;
+        color: #808695;
+        margin-left: 10px;
+      }
+      .tag-txt{
+        font-size: 12px;
+        color: #ed1c24;
+      }
+      .edit-circle-btn{
+        margin-left: 15px;
+        i{
+          vertical-align: text-bottom;
+        }
+      }
+      .import-btn{
+        margin-left: 15px;
+      }
+    }
+  }
+</style>

+ 340 - 0
src/views/purchasingManagement/bulkWarehousingOrder/list.vue

@@ -0,0 +1,340 @@
+<template>
+  <a-card size="small" :bordered="false" class="bulkWarehousingOrderList-wrap">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="创建时间">
+              <a-range-picker
+                style="width:100%"
+                id="bulkWarehousingOrderList-createDate"
+                :disabledDate="disabledDate"
+                v-model="createDate"
+                :format="dateFormat"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="散件单号">
+              <a-input id="bulkWarehousingOrderList-sparePartsPurchaseNo" v-model.trim="queryParam.sparePartsPurchaseNo" allowClear placeholder="请输入散件单号"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="供应商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-select
+                id="bulkWarehousingOrderList-supplierSn"
+                placeholder="请选择供应商"
+                allowClear
+                v-model="queryParam.supplierSn"
+                :showSearch="true"
+                option-filter-prop="children"
+                :filter-option="filterOption">
+                <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="业务状态">
+                <v-select
+                  v-model="queryParam.state"
+                  ref="state"
+                  id="bulkWarehousingOrderList-state"
+                  code="SPARE_PARTS_PURCHASE"
+                  placeholder="请选择业务状态"
+                  allowClear
+                ></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="财务状态">
+                <v-select
+                  v-model="queryParam.settleState"
+                  ref="settleState"
+                  id="bulkWarehousingOrderList-settleState"
+                  code="FINANCIAL_PAY_STATUS"
+                  placeholder="请选择财务状态"
+                  allowClear
+                ></v-select>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24">
+            <span class="table-page-search-submitButtons" style="margin-top: 3px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="bulkWarehousingOrderList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="bulkWarehousingOrderList-reset">重置</a-button>
+              <!-- <a-button
+                style="margin-left: 8px"
+                type="danger"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="bulkWarehousingOrderList-export">导出</a-button> -->
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 操作按钮 -->
+    <div class="table-operator">
+      <a-button id="bulkWarehousingOrderList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
+    </div>
+    <!-- alert -->
+    <a-alert type="info" showIcon style="margin-bottom:15px">
+      <div slot="message">共 <strong>{{ dataTotalCount }}</strong> 条记录,总数量合计 <strong>{{ productTotal.productTotalQty }}</strong> ,总金额合计¥<strong>{{ productTotal.productTotalCost }}</strong> </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ x: 1360, y: tableHeight }"
+      bordered>
+      <!-- 散件单号 -->
+      <template slot="sparePartsPurchaseNo" slot-scope="text, record">
+        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.sparePartsPurchaseNo }}</span>
+      </template>
+      <!-- 财务状态 -->
+      <template slot="settleState" slot-scope="text, record">
+        <a-badge :color="text=='FINISH'?'#87d068':'gold'" :text="record.settleStateDictValue" />
+      </template>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state != 'FINISH'"
+          @click="handleEdit(record)"
+          class="button-info"
+          id="bulkWarehousingOrderList-edit-btn">编辑</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state == 'WAIT_PUT_WAREHOUSE'"
+          @click="handleWarehouse(record)"
+          class="button-primary"
+          id="bulkWarehousingOrderList-warehouse-btn">入库</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state != 'FINISH'"
+          @click="handleDel(record)"
+          class="button-error"
+          id="bulkWarehousingOrderList-del-btn">删除</a-button>
+        <span v-if="(record.state == 'FINISH') && (record.state != 'WAIT_PUT_WAREHOUSE')">--</span>
+      </template>
+    </s-table>
+    <!-- 选择基本信息弹框 -->
+    <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
+  </a-card>
+</template>
+
+<script>
+import moment from 'moment'
+import { STable, VSelect } from '@/components'
+import basicInfoModal from './basicInfoModal.vue'
+// import { sparePartsPurList, sparePartsPurCount, sparePartsPurDel, sparePartsPurPut } from '@/api/sparePartsPur'
+import { supplierAllList } from '@/api/supplier'
+export default {
+  components: { STable, VSelect, basicInfoModal },
+  data () {
+    return {
+      advanced: false, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      openModal: false, // 基本信息弹框是否显示
+      supplierList: [], //  供应商列表数据
+      createDate: [], //  创建时间
+      dateFormat: 'YYYY-MM-DD',
+      tableHeight: 0,
+      // 查询参数
+      queryParam: {
+        sparePartsPurchaseNo: '', //  散件单号
+        supplierSn: undefined, //  供应商
+        state: undefined, //  单据状态
+        settleState: undefined //  结算状态
+      },
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '散件单号', scopedSlots: { customRender: 'sparePartsPurchaseNo' }, width: 220, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '供应商', dataIndex: 'supplierName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { 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: '业务状态', dataIndex: 'stateDictValue', width: 100, align: 'center' },
+        { title: '财务状态', scopedSlots: { customRender: 'settleState' }, width: 100, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 440
+        }
+        // 创建时间
+        if (this.createDate && this.createDate.length > 0) {
+          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
+        return sparePartsPurList(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++) {
+            data.list[i].no = no + i + 1
+          }
+          this.disabled = false
+          this.dataTotalCount = data.count
+          this.getTotal(Object.assign(parameter, this.queryParam))
+          return data
+        })
+      },
+      productTotal: { // 合计信息
+        productTotalCost: '',
+        productTotalQty: ''
+      },
+      dataTotalCount: '' //  列表数据总条数
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    // 合计
+    getTotal (param) {
+      sparePartsPurCount(param).then(res => {
+        if (res.status == 200 && res.data) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = {
+            // 合计信息
+            productTotalCost: '',
+            productTotalQty: ''
+          }
+        }
+      })
+    },
+    //  新增
+    handleAdd () {
+      this.openModal = true
+    },
+    //  基本信息  保存
+    handleOk (row) {
+      this.$router.push({ path: `/bulkManagement/bulkWarehousingOrder/add/${row.id}/${row.sparePartsPurchaseSn}` })
+    },
+    //  编辑
+    handleEdit (row) {
+      this.$router.push({ path: `/bulkManagement/bulkWarehousingOrder/edit/${row.id}/${row.sparePartsPurchaseSn}` })
+    },
+    //  详情
+    handleDetail (row) {
+      this.$router.push({ path: `/bulkManagement/bulkWarehousingOrder/detail/${row.id}/${row.sparePartsPurchaseSn}` })
+    },
+    //  入库
+    handleWarehouse (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定要入库吗?',
+        centered: true,
+        onOk () {
+          sparePartsPurPut({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    //  删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除后不可恢复,确定要进行删除吗?',
+        centered: true,
+        onOk () {
+          sparePartsPurDel({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.sparePartsPurchaseNo = ''
+      this.queryParam.supplierSn = undefined
+      this.queryParam.state = undefined
+      this.queryParam.settleState = undefined
+      this.createDate = undefined
+      this.$refs.table.refresh(true)
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    //  导出
+    handleExport () {
+      const params = this.queryParam
+      this.exportLoading = true
+      // customerBundleExportDelay(params).then(res => {
+      //   this.exportLoading = false
+      //   this.download(res)
+      // })
+    },
+    download (data) {
+      if (!data) { return }
+      const url = window.URL.createObjectURL(new Blob([data]))
+      const link = document.createElement('a')
+      link.style.display = 'none'
+      link.href = url
+      const a = moment().format('YYYYMMDDHHmmss')
+      const fname = '散件入库单' + a
+      link.setAttribute('download', fname + '.xlsx')
+      document.body.appendChild(link)
+      link.click()
+    },
+    // 供应商下拉数据
+    getSupplierList () {
+      supplierAllList().then(res => {
+        if (res.status == 200) {
+          this.supplierList = res.data
+        } else {
+          this.supplierList = []
+        }
+      })
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.openModal = false
+      vm.getSupplierList()
+    })
+  }
+}
+</script>
+<style lang="less">
+  .bulkWarehousingOrderList-wrap{
+    .sTable{
+      margin-top: 15px;
+    }
+  }
+</style>

+ 8 - 0
src/views/salesManagement/pushOrderManagement/list.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>