chenrui 4 年之前
父節點
當前提交
a480823c2a

+ 5 - 5
src/api/spareParts.js

@@ -41,7 +41,7 @@ export const sparePartsDeleteDetail = (params) => {
 
 // 分页列表明细
 export const sparePartsDetailList = (params) => {
-  const url = `/spareParts/queryDetailPage/${params.sparePartsSn}/${params.pageNo}/${params.pageSize}`
+  const url = `/spareParts/queryDetailPage/${params.sn}/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -50,16 +50,16 @@ export const sparePartsDetailList = (params) => {
     method: 'post'
   })
 }
- 
+
 // 分页列表明细合计
 export const sparePartsPageCount = (params) => {
   return axios({
-    url: `/spareParts/queryDetailPageCount/${params.sparePartsSn}`,
+    url: `/spareParts/queryDetailPageCount/${params.sn}`,
     data: params,
     method: 'post'
   })
 }
- 
+
 // 保存
 export const sparePartsSave = (params) => {
   return axios({
@@ -76,4 +76,4 @@ export const sparePartsSaveDetail = (params) => {
     data: params,
     method: 'post'
   })
-}
+}

+ 1 - 3
src/api/stockOut.js

@@ -22,11 +22,9 @@ export const stockOutOut = (params) => {
 //  出库 详情
 export const stockOutDetail = (params) => {
   const url = `/stockOut/queryDetailHeadInfoBySn/${params.sn}`
-  delete params.pageNo
-  delete params.pageSize
   return axios({
     url: url,
-    data: params,
+    data: {},
     method: 'post'
   })
 }

+ 8 - 1
src/api/supplier.js

@@ -11,6 +11,13 @@ export const supplierList = (params) => {
     method: 'post'
   })
 }
+//  供应商 列表  无分页
+export const supplierAllList = (params) => {
+  return axios({
+    url: '/supplier/queryAll',
+    method: 'get'
+  })
+}
 //  供应商 详情
 export const supplierDetail = (params) => {
   return axios({
@@ -72,4 +79,4 @@ export const addProduct = (params) => {
     data: params,
     method: 'post'
   })
-}
+}

+ 9 - 0
src/api/warehouse.js

@@ -20,6 +20,15 @@ export const warehouseAllList = (params) => {
     method: 'post'
   })
 }
+//  仓库仓位  级联数据
+export const warehouseCascadeList = (params) => {
+  const url = '/warehouse/queryListWithExt'
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
 // 新增/编辑仓库
 export const warehouseSave = params => {
   return axios({

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

@@ -834,7 +834,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'detail/:id',
+                path: 'detail/:sn',
                 name: 'outboundOrderDetail',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/outboundOrder/detail.vue'),
                 meta: {
@@ -911,7 +911,7 @@ export const asyncRouterMap = [
                   hidden: true
                   // permission: 'M_salesReturnCheck'
                 }
-              },
+              }
             ]
           }
           // {

+ 1 - 1
src/views/financialManagement/warehousingConfirmation/list.vue

@@ -99,7 +99,7 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 380
         }
-        return stockPutList(Object.assign(parameter, this.queryParam)).then(res => {
+        return stockPutList(Object.assign(parameter, this.queryParam, { confirm: true })).then(res => {
           const data = res.data
           this.disabled = false
           return data

+ 26 - 49
src/views/purchasingManagement/bulkWarehousingOrder/basicInfoModal.vue

@@ -7,7 +7,7 @@
     title="新增散件入库单"
     v-model="isShow"
     @cancle="isShow=false"
-    width="80%">
+    :width="800">
     <a-form-model
       id="bulkWarehousingOrder-basicInfo-form"
       ref="ruleForm"
@@ -17,36 +17,38 @@
       :wrapper-col="formItemLayout.wrapperCol" >
       <a-form-model-item label="供应商" prop="supplierSn">
         <a-select
-          placeholder="请输入名称查询,如果没有请点击 '+' 新增"
+          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>
+          :filter-option="filterOption">
+          <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn" :disabled="item.enableFlag==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>
+        <v-select
+          v-model="form.sparePartsType"
+          ref="sparePartsType"
+          id="bulkWarehousingOrder-basicInfo-sparePartsType"
+          code="SPARE_PARTS_TYPE"
+          placeholder="请选择入库类型"
+          allowClear></v-select>
       </a-form-model-item>
-      <a-form-model-item label="关联单号" prop="remarks">
+      <a-form-model-item label="关联单号" prop="relationNo">
         <a-input
-          id="bulkWarehousingOrder-no"
+          id="bulkWarehousingOrder-relationNo"
           :maxLength="30"
-          v-model="form.remarks"
+          v-model="form.relationNo"
           placeholder="请输入关联单号(最多30个字符)"
           allowClear />
       </a-form-model-item>
-      <a-form-model-item label="入库备注" prop="remarks">
+      <a-form-model-item label="入库备注" prop="remark">
         <a-textarea
-          id="bulkWarehousingOrder-remarks"
-          :maxLength="200"
-          v-model="form.remarks"
-          placeholder="请输入备注(最多200个字符)"
+          id="bulkWarehousingOrder-remark"
+          :maxLength="30"
+          v-model="form.remark"
+          placeholder="请输入备注(最多30个字符)"
           allowClear />
       </a-form-model-item>
     </a-form-model>
@@ -54,17 +56,13 @@
       <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'
+import { supplierAllList } from '@/api/supplier'
+import { sparePartsSave } from '@/api/spareParts'
 export default {
   name: 'BulkWarehousingOrderBasicInfoModal',
   components: { VSelect },
@@ -78,13 +76,14 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
-        labelCol: { span: 6 },
+        labelCol: { span: 5 },
         wrapperCol: { span: 16 }
       },
       form: {
         supplierSn: undefined, // 供应商
         sparePartsType: undefined, //  散件类型
-        remarks: '' // 备注
+        relationNo: '', //  关联单号
+        remark: '' // 备注
       },
       rules: {
         supplierSn: [
@@ -94,9 +93,7 @@ export default {
           { required: true, message: '请选择入库类型', trigger: 'change' }
         ]
       },
-      supplierList: [], //  供应商  下拉数据
-      sparePartsPutTypeList: [], //  散件入库类型  下拉数据
-      openSupplierModal: false //  供应商 弹框
+      supplierList: [] //  供应商  下拉数据
     }
   },
   methods: {
@@ -106,7 +103,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
-          sparePartsPurSave(form).then(res => {
+          sparePartsSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               setTimeout(() => {
@@ -121,11 +118,6 @@ export default {
         }
       })
     },
-    // 新增供应商 成功
-    handleOk () {
-      //  获取供应商数据列表,并赋值
-      this.getSupplierList('val')
-    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
@@ -144,20 +136,6 @@ export default {
           this.supplierList = []
         }
       })
-    },
-    // 散件入库类型下拉数据
-    getSparePartsPutTypeList () {
-      sparePartsPutTypeAllList().then(res => {
-        if (res.status == 200) {
-          this.sparePartsPutTypeList = res.data
-        } else {
-          this.sparePartsPutTypeList = []
-        }
-      })
-    },
-    // 关闭供应商弹框
-    closeSupplierModal () {
-      this.openSupplierModal = false
     }
   },
   watch: {
@@ -172,7 +150,6 @@ export default {
         this.$refs.ruleForm.resetFields()
       } else {
         this.getSupplierList()
-        this.getSparePartsPutTypeList()
       }
     }
   }

+ 33 - 345
src/views/purchasingManagement/bulkWarehousingOrder/edit.vue

@@ -35,7 +35,7 @@
       </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></div>
+        <div slot="message">入库数量 <strong>{{ (productTotal&&productTotal.totalQty) || 0 }}</strong> ,入库金额 <strong>{{ (productTotal&&productTotal.totalPrice) || 0 }}</strong></div>
       </a-alert>
       <!-- 列表 -->
       <s-table
@@ -71,39 +71,21 @@
           size="large"
           class="button-primary"
           @click="handleSubmit"
-          style="padding: 0 60px;">提交</a-button>
+          style="padding: 0 60px;">保存并返回</a-button>
       </div>
     </a-affix>
-    <!-- 选择基本信息弹框 -->
-    <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
+    <spare-parts-product-modal :openModal="openModal" :itemSn="itemSn" @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'
+import sparePartsProductModal from './productModal.vue'
+import { sparePartsDetailList, sparePartsPageCount } from '@/api/spareParts'
 export default {
-  components: { STable, VSelect, basicInfoModal },
+  components: { STable, VSelect, sparePartsProductModal },
   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' },
@@ -115,93 +97,25 @@ export default {
         { title: '小计', dataIndex: 'origCode', width: 220, 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', 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)
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return sparePartsDetailList(Object.assign(parameter, { sn: 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
+          }
+          this.getDetailCount(Object.assign(parameter, { sn: this.$route.params.sn }))
+          return data
+        })
       },
       openModal: false, // 选择基本信息弹框是否显示
-      warehouseList: [], //  仓库  下拉数据
-      warehouseLocList: {}, //  仓位  下拉数据
-      defaultWarehouseCascade: [], //  默认仓库仓位
-      chooseWarehouseList: [], //  已选产品 仓库  下拉数据
-      chooseWarehouseLocList: {}, //  已选产品 仓位  下拉数据
       basicInfoData: null, //  基本信息
-      productTotal: null //  合计
+      productTotal: null, //  合计
+      itemSn: ''
     }
   },
   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 => {
@@ -212,58 +126,11 @@ export default {
         }
       })
     },
-    //  添加/编辑
-    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()
-        }
-      })
+    //  添加
+    handleAdd () {
+      this.openModal = true
     },
-    //  提交
+    //  保存
     handleSubmit () {
       const _this = this
       sparePartsPurSubmit({ id: this.$route.params.id }).then(res => {
@@ -286,7 +153,7 @@ export default {
           sparePartsPurDetailDel({ id: row.id }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              _this.getChooseDealerProductList()
+              _this.$refs.table.refresh()
             }
           })
         }
@@ -298,17 +165,13 @@ export default {
     },
     //  基本信息  保存
     handleOk () {},
-    //  导入明细
-    handleImport () {
-      console.log(333)
-    },
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/bulkManagement/bulkWarehousingOrder/list' })
+      this.$router.push({ path: '/purchasingManagement/bulkWarehousingOrder/list' })
     },
     // 合计
     getDetailCount (params) {
-      sparePartsPurDetailCount(params).then(res => {
+      sparePartsPageCount(params).then(res => {
         if (res.status == 200) {
           this.productTotal = res.data
         } else {
@@ -316,211 +179,36 @@ export default {
         }
       })
     },
-    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
+    getProductList (pageNo, sorter) {
       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'
+      const params = {
+        pageNo: this.pageNo,
+        pageSize: this.pageSize,
+        sn: this.$route.params.sn
       }
-      dealerProductList(params).then(res => {
+      sparePartsDetailList(params).then(res => {
         if (res.status == 200) {
+          this.getDetailCount(params)
           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()
     })
   }
 }

+ 14 - 14
src/views/purchasingManagement/bulkWarehousingOrder/list.vue

@@ -46,7 +46,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1360, y: tableHeight }"
+      :scroll="{ x: 1960, y: tableHeight }"
       bordered>
       <!-- 入库单号 -->
       <template slot="sparePartsNo" slot-scope="text, record">
@@ -61,18 +61,18 @@
         <a-button
           size="small"
           type="link"
-          v-if="record.state != 'FINISH'"
+          v-if="record.state == 'WAIT_AUDIT'"
           @click="handleEdit(record)"
           class="button-info"
           id="bulkWarehousingOrderList-edit-btn">编辑</a-button>
         <a-button
           size="small"
           type="link"
-          v-if="record.state != 'FINISH'"
+          v-if="record.state == 'WAIT_AUDIT'"
           @click="handleDel(record)"
           class="button-error"
           id="bulkWarehousingOrderList-del-btn">删除</a-button>
-        <span v-if="(record.state == 'FINISH') && (record.state != 'WAIT_PUT_WAREHOUSE')">--</span>
+        <span v-if="record.state != 'WAIT_AUDIT'">--</span>
       </template>
     </s-table>
     <!-- 选择基本信息弹框 -->
@@ -108,14 +108,14 @@ export default {
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
         { title: '入库单号', scopedSlots: { customRender: 'sparePartsNo' }, width: 220, 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 || '--' } },
-        { title: '关联单号', dataIndex: 'stateDictValueNo', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '金蝶单号', dataIndex: 'stateDictValuaseNo', width: 100, align: 'center', customRender: function (text) { return 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: 'sparePartsTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '关联单号', dataIndex: 'relationNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '金蝶单号', dataIndex: 'kingdeeNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '状态', dataIndex: 'stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'remark', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
+        { title: '备注', dataIndex: 'remark', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 130, align: 'center', fixed: 'right' }
       ],
       selectedRowKeys: [], // Check here to configure the default column
       selectedRows: [],
@@ -171,15 +171,15 @@ export default {
     },
     //  基本信息  保存
     handleOk (row) {
-      this.$router.push({ path: `/purchasingManagement/bulkWarehousingOrder/add/${row.id}/${row.sparePartsPurchaseSn}` })
+      this.$router.push({ path: `/purchasingManagement/bulkWarehousingOrder/add/${row.id}/${row.sparePartsSn}` })
     },
     //  编辑
     handleEdit (row) {
-      this.$router.push({ path: `/purchasingManagement/bulkWarehousingOrder/edit/${row.id}/${row.sparePartsPurchaseSn}` })
+      this.$router.push({ path: `/purchasingManagement/bulkWarehousingOrder/edit/${row.id}/${row.sparePartsSn}` })
     },
     //  详情
     handleDetail (row) {
-      this.$router.push({ path: `/purchasingManagement/bulkWarehousingOrder/detail/${row.id}/${row.sparePartsPurchaseSn}` })
+      this.$router.push({ path: `/purchasingManagement/bulkWarehousingOrder/detail/${row.id}/${row.sparePartsSn}` })
     },
     //  删除
     handleDel (row) {

+ 191 - 0
src/views/purchasingManagement/bulkWarehousingOrder/productModal.vue

@@ -0,0 +1,191 @@
+<template>
+  <a-modal
+    centered
+    class="bulkWarehousingOrder-product-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="(itemSn ? '编辑' : '新增') + '产品'"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="800">
+    <a-form-model
+      id="bulkWarehousingOrder-product-form"
+      ref="ruleForm"
+      :model="form"
+      :rules="rules"
+      :label-col="formItemLayout.labelCol"
+      :wrapper-col="formItemLayout.wrapperCol" >
+      <a-form-model-item label="供应商" prop="supplierSn">供应商名称</a-form-model-item>
+      <a-form-model-item label="产品名称" prop="supplierSn">供应商名称</a-form-model-item>
+      <a-form-model-item label="原厂编码" prop="supplierSn">供应商名称</a-form-model-item>
+      <a-form-model-item label="仓库仓位" prop="sparePartsType">
+        <a-cascader
+          @change="changeWarehouseCascade"
+          v-model="form.warehouseCascade"
+          expand-trigger="hover"
+          :allowClear="false"
+          :options="warehouseCascadeData"
+          :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
+          id="bulkWarehousingOrder-product-warehouseCascade"
+          placeholder="请选择仓库仓位"
+          style="width: 100%;" />
+      </a-form-model-item>
+      <a-form-model-item label="成本价" prop="relationNo">
+        <a-input-number
+          id="bulkWarehousingOrder-product-packQty"
+          v-model="form.packQty"
+          :precision="2"
+          :min="0.1"
+          :max="999999"
+          placeholder="请输入"
+          style="width: 100%;" />
+      </a-form-model-item>
+      <a-form-model-item label="数量" prop="remark">
+        <a-input-number
+          id="bulkWarehousingOrder-product-packQty"
+          v-model="form.packQty"
+          :precision="0"
+          :min="1"
+          :max="999999"
+          placeholder="请输入"
+          style="width: 80%;" /><span>个</span>
+      </a-form-model-item>
+    </a-form-model>
+    <div class="btn-cont">
+      <a-button type="primary" id="bulkWarehousingOrder-product-modal-save" @click="handleSave">保存</a-button>
+      <a-button id="bulkWarehousingOrder-product-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+import { supplierAllList } from '@/api/supplier'
+import { warehouseCascadeList } from '@/api/warehouse'
+import { sparePartsSave } from '@/api/spareParts'
+export default {
+  name: 'BulkWarehousingOrderBasicInfoModal',
+  components: { VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 5 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        supplierSn: undefined, // 供应商
+        sparePartsType: undefined, //  散件类型
+        relationNo: '', //  关联单号
+        remark: '' // 备注
+      },
+      rules: {
+        supplierSn: [
+          { required: true, message: '请选择供应商', trigger: 'change' }
+        ],
+        sparePartsType: [
+          { required: true, message: '请选择入库类型', trigger: 'change' }
+        ]
+      },
+      warehouseCascadeData: [] //  仓库仓位  下拉数据
+    }
+  },
+  methods: {
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          sparePartsSave(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
+        }
+      })
+    },
+    changeWarehouseCascade (val) {
+      console.log(val)
+      // if (val.length < 2) {
+      //   this.$message.warning('当前仓库无仓位,请选择其他仓库')
+      //   const warehouseSnBackups = this.loadData[ind].warehouseSnBackups || undefined
+      //   const warehouseLocationSnBackups = this.loadData[ind].warehouseLocationSnBackups || undefined
+      //   this.loadData[ind].warehouseSn = warehouseSnBackups
+      //   this.loadData[ind].warehouseLocationSn = warehouseLocationSnBackups
+      //   if (warehouseSnBackups || warehouseLocationSnBackups) {
+      //     this.loadData[ind].warehouseCascade = [warehouseSnBackups, warehouseLocationSnBackups]
+      //   } else {
+      //     this.loadData[ind].warehouseCascade = undefined
+      //   }
+      // } else {
+      //   this.loadData[ind].warehouseSn = val[0] ? val[0] : ''
+      //   this.loadData[ind].warehouseLocationSn = val[1] ? val[1] : ''
+      //   this.handleAdd(this.loadData[ind])
+      // }
+    },
+    // 仓库仓位
+    getWarehouseCascade () {
+      warehouseCascadeList({}).then(res => {
+        if (res.status == 200) {
+          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 = []
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+      } else {
+        this.getWarehouseCascade()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .bulkWarehousingOrder-product-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 69 - 85
src/views/salesManagement/outboundOrder/detail.vue

@@ -1,41 +1,36 @@
 <template>
   <div class="outboundOrderDetail-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="outboundOrderDetail-cont">
+    <a-page-header :ghost="false" :backIcon="false" class="outboundOrderDetail-back" >
+      <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
-        <a href="javascript:;" @click="handleBack">返回列表</a>
-        <a-button size="small" id="outboundOrderDetail-ts-btn" style="margin-left:30px" key="0">订单推送</a-button>
-        <a-button size="small" id="outboundOrderDetail-export-btn" type="danger" style="margin-left:20px" key="1">销售导出</a-button>
+        <a id="outboundOrderDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
       </template>
+      <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
-        <span>打印字段:</span>
-        <a-select key="2" style="width:150px" id="sales-pritKey" placeholder="请选择打印字段" allowClear>
-          <a-select-option v-for="item in pritKey" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-        </a-select>
-        <span><i style="color: red;">*</i>打印模板:</span>
-        <a-select key="3" style="width:150px" id="sales-pritKey" placeholder="请选择打印模板" allowClear>
-          <a-select-option v-for="item in pritModal" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-        </a-select>
-        <a-button key="4" id="outboundOrderDetail-preview-btn">打印预览</a-button>
-        <a-button key="5" type="primary" id="outboundOrderDetail-print-btn">快速打印</a-button>
+        <a-button key="2" id="outboundOrderDetail-preview-btn">打印预览</a-button>
+        <a-button key="1" type="primary" id="outboundOrderDetail-print-btn">快速打印</a-button>
       </template>
     </a-page-header>
     <!-- 基础信息 -->
     <a-card size="small" :bordered="false" class="outboundOrderDetail-cont">
       <a-collapse :activeKey="['1']">
         <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions size="small" :column="3">
-            <a-descriptions-item label="客户名称">张三的</a-descriptions-item>
-            <a-descriptions-item label="客户地址">山西省太原市阿斯加德法律静安寺水电费</a-descriptions-item>
-            <a-descriptions-item label="支付方式">货到付款</a-descriptions-item>
-            <a-descriptions-item label="收款方式">现金</a-descriptions-item>
-            <a-descriptions-item label="联系手机">13709146191</a-descriptions-item>
-            <a-descriptions-item label="联系电话">13709146191</a-descriptions-item>
-            <a-descriptions-item label="备注">备注备注备注备注备注</a-descriptions-item>
-            <a-descriptions-item label="销售单号">34242sdf234234</a-descriptions-item>
-            <a-descriptions-item label="制单人">王明</a-descriptions-item>
-            <a-descriptions-item label="业务员">李四</a-descriptions-item>
-            <a-descriptions-item label="审核状态">未审核</a-descriptions-item>
-            <a-descriptions-item label="完结状态">未完结</a-descriptions-item>
+          <a-descriptions size="small" :column="2" v-if="detailData">
+            <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货地址">
+              <span v-if="(detailData.salesBillExtEntity) && (detailData.salesBillExtEntity.shippingAddrProvinceName || detailData.salesBillExtEntity.shippingAddrCityName || detailData.salesBillExtEntity.shippingAddrCountyName || detailData.salesBillExtEntity.shippingAddr)">
+                {{ detailData.salesBillExtEntity.shippingAddrProvinceName }}
+                {{ detailData.salesBillExtEntity.shippingAddrCityName }}
+                {{ detailData.salesBillExtEntity.shippingAddrCountyName }}
+                {{ detailData.salesBillExtEntity.shippingAddr }}
+              </span>
+              <span v-else>--</span>
+            </a-descriptions-item>
+            <a-descriptions-item label="收款方式">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.settleStyleSnDictValue || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货人">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货电话">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="备注">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.remarks || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
           </a-descriptions>
         </a-collapse-panel>
       </a-collapse>
@@ -44,19 +39,17 @@
       <!-- alert -->
       <a-alert type="info" style="margin-bottom: 10px;">
         <div slot="message">
-          总款数:<strong>12</strong>;总数量:<strong>12</strong>;总赠品数量:<strong>12</strong>;急件总款数:<strong>12</strong>;急件总数量:<strong>12</strong>;<br/>
-          总售价:<strong>12</strong>;总成本:<strong>12</strong>;总毛利:<strong>12</strong>;折后总售价:<strong>12</strong>;折扣:<strong>12%</strong>;折扣金额:<strong>12</strong>;
+          本次下推数量:<strong>{{ totalOutQty }}</strong>
         </div>
       </a-alert>
       <!-- 列表 -->
       <s-table
         class="sTable"
         ref="table"
-        size="default"
+        size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1660 }"
         bordered>
         <!-- 状态 -->
         <template slot="state" slot-scope="text, record">
@@ -68,87 +61,78 @@
 </template>
 
 <script>
-import { STable, VSelect } from '@/components'
+import { STable } from '@/components'
+import { stockOutDetail, stockOutDetailList, stockOutDetailCount } from '@/api/stockOut'
 export default {
-  name: 'SalesDetail',
-  components: {
-    STable,
-    VSelect
-  },
+  components: { STable },
   data () {
     return {
-      disabled: false,
-      pritKey: [
-        { id: 0, name: '打印促销' },
-        { id: 1, name: '打印支付方式' },
-        { id: 2, name: '打印收款方式' }
-      ],
-      pritModal: [
-        { id: 0, name: '普通模板一' },
-        { id: 1, name: '普通模板二' },
-        { id: 2, name: '仓库模板一' }
-      ],
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'salerNo', width: 140, align: 'center' },
-        { title: '产品名称', dataIndex: 'storeNo', align: 'center' },
-        { title: '原厂编码', dataIndex: 'custName', width: 140, align: 'center' },
-        { title: '成本价', dataIndex: 'totalP', width: 100, align: 'center' },
-        { title: '售价', dataIndex: 'totalNums', width: 100, align: 'center' },
-        { title: '折后售价', dataIndex: 'totalPrice', width: 100, align: 'center' },
-        { title: '销售数量', dataIndex: 'payType', width: 100, align: 'center' },
-        { title: '单位', dataIndex: 'mementPay', width: 100, align: 'center' },
-        { title: '辅助数量', dataIndex: 'shDate', width: 100, align: 'center' },
-        { title: '售价小计', dataIndex: 'isJj', width: 100, align: 'center' },
-        { title: '折后小计', dataIndex: 'status', width: 100, align: 'center' },
-        { title: '仓库', dataIndex: 'status', width: 100, align: 'center' },
-        { title: '仓位', dataIndex: 'status', width: 100, align: 'center' },
-        { title: '销售类型', dataIndex: 'status', width: 100, align: 'center' }
+        { title: '产品编码', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'unit', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '本次出库数', dataIndex: 'outQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( 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' }
-            ],
-            count: 10
-          }
+        return stockOutDetailList(Object.assign(parameter, this.queryParam, { sn: 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
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.getDetailCount()
+          return data
         })
-      }
+      },
+      detailData: null, //  详情数据
+      totalOutQty: 0 //  下推数量
     }
   },
   methods: {
-    //  返回
+    //  返回列表
     handleBack () {
       this.$router.push({ path: '/salesManagement/outboundOrder/list' })
+    },
+    //  获取详情
+    getDetail () {
+      stockOutDetail({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.detailData = res.data
+        } else {
+          this.detailData = null
+        }
+      })
+    },
+    // 合计
+    getDetailCount () {
+      stockOutDetailCount({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.totalOutQty = res.data.totalOutQty || 0
+        } else {
+          this.totalOutQty = 0
+        }
+      })
     }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getDetail()
+    })
   }
 }
 </script>
 
 <style lang="less">
   .outboundOrderDetail-wrap{
+    .outboundOrderDetail-back{
+      margin-bottom: 10px;
+    }
     .outboundOrderDetail-cont{
       margin-bottom: 10px;
     }

+ 162 - 0
src/views/salesManagement/outboundOrder/detailModal.vue

@@ -0,0 +1,162 @@
+<template>
+  <a-modal
+    centered
+    class="outboundOrderDetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="详情"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="1000">
+    <div style="padding: 0 12px;text-align: right;">
+      <a-button id="outboundOrderDetail-preview-btn" style="margin-right: 15px;">打印预览</a-button>
+      <a-button type="primary" id="outboundOrderDetail-print-btn">快速打印</a-button>
+    </div>
+    <!-- 基础信息 -->
+    <a-card size="small" :bordered="false" class="outboundOrderDetail-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1" header="基础信息">
+          <a-descriptions size="small" :column="2">
+            <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货地址" v-if="detailData">
+              <span v-if="(detailData&&detailData.salesBillExtEntity) && (detailData.salesBillExtEntity.shippingAddrProvinceName || detailData.salesBillExtEntity.shippingAddrCityName || detailData.salesBillExtEntity.shippingAddrCountyName || detailData.salesBillExtEntity.shippingAddr)">
+                {{ detailData.salesBillExtEntity.shippingAddrProvinceName }}
+                {{ detailData.salesBillExtEntity.shippingAddrCityName }}
+                {{ detailData.salesBillExtEntity.shippingAddrCountyName }}
+                {{ detailData.salesBillExtEntity.shippingAddr }}
+              </span>
+              <span v-else>--</span>
+            </a-descriptions-item>
+            <a-descriptions-item label="收款方式">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.settleStyleSnDictValue || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货人">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货电话">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="备注">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.remarks || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
+          </a-descriptions>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
+    <a-card size="small" :bordered="false" class="outboundOrderDetail-cont">
+      <!-- alert -->
+      <a-alert type="info" style="margin-bottom: 10px;">
+        <div slot="message">
+          本次下推数量:<strong>{{ totalOutQty }}</strong>
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        bordered>
+        <!-- 状态 -->
+        <template slot="state" slot-scope="text, record">
+          <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '已出库': '未出库' }}</a-tag>
+        </template>
+      </s-table>
+    </a-card>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { stockOutDetail, stockOutDetailList, stockOutDetailCount } from '@/api/stockOut'
+export default {
+  name: 'OutboundOrderDetailModal',
+  components: { STable },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      detailData: null, //  详情数据
+      // 表头
+      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 || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'unit', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '本次出库数', dataIndex: 'outQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        return stockOutDetailList(Object.assign(parameter, this.queryParam, { sn: this.itemSn })).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.getDetailCount()
+          return data
+        })
+      },
+      totalOutQty: 0 //  下推数量
+    }
+  },
+  methods: {
+    //  获取详情
+    getDetail () {
+      stockOutDetail({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          this.detailData = res.data
+        } else {
+          this.detailData = null
+        }
+      })
+    },
+    // 合计
+    getDetailCount () {
+      stockOutDetailCount({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          this.totalOutQty = res.data.totalOutQty || 0
+        } else {
+          this.totalOutQty = 0
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    },
+    itemSn (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .outboundOrderDetail-modal{
+    .ant-modal-body {
+      padding: 10px 10px 20px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 52 - 60
src/views/salesManagement/outboundOrder/list.vue

@@ -58,13 +58,13 @@
     </div>
     <!-- 列表 -->
     <!-- 暂不做 -->
-    <!-- <div style="margin-bottom: 15px">
-      <a-button type="primary" id="outboundOrder-export" :disabled="!hasSelected" :loading="loading" @click="handleOutbounds">批量出库</a-button>
+    <div style="margin-bottom: 15px">
+      <a-button type="primary" id="outboundOrder-export" :loading="loading" @click="handleOutbound()">批量出库</a-button>
       <span style="margin-left: 8px">
         <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
       </span>
-    </div> -->
-    <!-- <s-table
+    </div>
+    <s-table
       class="sTable"
       ref="table"
       size="default"
@@ -72,21 +72,11 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :showPagination="false"
       :scroll="{ x: 1710 }"
-      bordered> -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1720, y: tableHeight }"
       bordered>
       <!-- 单号 -->
-      <template slot="outBizNo" slot-scope="text, record">
-        <span v-if="record.outBizNo" style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.outBizNo }}</span>
+      <template slot="stockOutNo" slot-scope="text, record">
+        <span v-if="record.stockOutNo" style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.stockOutNo }}</span>
         <span v-else>--</span>
       </template>
       <!-- 操作 -->
@@ -98,17 +88,23 @@
           class="button-primary"
           @click="handleOutbound(record)"
           id="outboundOrderList-out-btn">出库</a-button>
+        <span v-else>--</span>
       </template>
     </s-table>
+    <!-- 详情 -->
+    <!-- <outbound-order-detail-modal :openModal="openModal" :itemSn="itemSn" @close="closeModal" /> -->
+    <!-- 调拨详情 -->
+    <!-- <transfer-out-detail-modal :openModal="openDetailModal" :itemSn="itemSn" @close="closeDetailModal" /> -->
   </a-card>
 </template>
 
 <script>
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import outboundOrderDetailModal from './detailModal.vue'
 import { stockOutList, stockOutOut } from '@/api/stockOut'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, outboundOrderDetailModal },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
@@ -122,10 +118,9 @@ export default {
       dateFormat: 'YYYY-MM-DD',
       time: [], //  审核时间
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '下推单号', scopedSlots: { customRender: 'outBizNo' }, width: 220, align: 'center' },
-        { title: '单号', dataIndex: 'stockOutNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库单号', scopedSlots: { customRender: 'stockOutNo' }, width: 220, align: 'center' },
+        { title: '业务单号', dataIndex: 'outBizNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '出库类型', dataIndex: 'outBizTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'demanderName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '数量', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -140,7 +135,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         if (this.tableHeight == 0) {
-          this.tableHeight = window.innerHeight - 260
+          this.tableHeight = window.innerHeight - 380
         }
         // 审核时间
         if (this.time && this.time.length > 0) {
@@ -159,7 +154,9 @@ export default {
           this.disabled = false
           return data
         })
-      }
+      },
+      itemSn: '',
+      openDetailModal: false
     }
   },
   computed: {
@@ -190,6 +187,11 @@ export default {
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
+    // 关闭 出库详情 弹框
+    closeDetailModal () {
+      this.itemSn = ''
+      this.openDetailModal = false
+    },
     //  重置
     resetSearchForm () {
       this.queryParam.demanderName = ''
@@ -201,39 +203,42 @@ export default {
     //  详情
     handleDetail (row) {
       //  根据出库类型跳转对应页面
-      // if (row.outBizType == 'PURCHASE_RETURN') { // 采购退货
-      //   this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.outBizSn}` })
-      // } else if (row.outBizType == 'SPARE_PARTS_RETURN') { // 散件退货
-      //   this.$message.warning('该出库类型对应页面未开发')
-      //   // this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.outBizSn}` })
-      // } else if (row.outBizType == 'SALES') { // 出库
-      //   this.$router.push({ path: `/salesManagement/salesQuery/detail/${row.outBizSn}` })
-      // } else if (row.outBizType == 'DISPATCH_DEDUCT') { // 急件冲减
-      //   this.$router.push({ path: `/salesManagement/urgentItemsOffset/detail/${row.outBizSn}` })
-      // } else if (row.outBizType == 'SHOP_CALL_OUT') { // 店内调出
-      //   this.$router.push({ path: `/allocationManagement/storeTransferOut/detail/${row.outBizSn}` })
-      // } else if (row.outBizType == 'CHECK_ORDER_OUT') { // 库存盘点盘亏
-      //   this.$message.warning('该出库类型对应页面未开发')
-      //   // this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.outBizSn}` })
-      // } else if (row.outBizType == 'LINKAGE_CALL_OUT') { // 连锁调出
-      //   this.$message.warning('该出库类型对应页面未开发')
-      //   // this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.outBizSn}` })
-      // } else if (row.outBizType == 'WAREHOUSE_CALL_OUT') { // 仓库调出
-      //   this.$router.push({ path: `/allocationManagement/warehouseAllocation/detail/${row.outBizSn}` })
-      // } else {
-      //   this.$message.warning('出库类型未知')
-      // }
+      if (row.outBizType == 'OUT_SALES') { //  销售出库
+        this.$router.push({ path: `/salesManagement/outboundOrder/detail/${row.stockOutSn}` })
+      } else if (row.outBizType == 'OUT_ALLOT') { //  调拨出库
+        this.$router.push({ path: `/allocationManagement/transferOut/detail/${row.outBizSn}` })
+      }
     },
-    // 单个出库
+    // 出库/批量出库
     handleOutbound (row) {
       const _this = this
+      let content = ''
+      let params = []
+      if (row) { //  单个出库
+        content = '确认要出库吗?'
+        params = [row.stockOutSn]
+      } else { //  批量出库
+        content = '确认要批量出库吗?'
+        if (this.selectedRowKeys.length < 1) {
+          this.$message.warning('请在列表勾选后再进行批量操作!')
+          return
+        }
+        params = this.selectedRowKeys
+      }
       this.$confirm({
         title: '提示',
-        content: '确认要出库吗?',
+        content: content,
         centered: true,
         onOk () {
-          stockOutOut(Object.assign(row, { outStockEnum: row.outBizType })).then(res => {
+          if (!row) { //  批量出库
+            _this.loading = true
+          }
+          stockOutOut(params).then(res => {
+            _this.loading = false
             if (res.status == 200) {
+              if (!row) { //  批量出库
+                _this.selectedRowKeys = []
+              }
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
             }
@@ -241,19 +246,6 @@ export default {
         }
       })
     },
-    // 批量出库
-    handleOutbounds () {
-      if (this.selectedRowKeys.length < 1) {
-        this.$message.warning('请在列表勾选后再进行批量操作!')
-        return
-      }
-      this.loading = true
-      // ajax request after empty completing
-      setTimeout(() => {
-        this.loading = false
-        this.selectedRowKeys = []
-      }, 1000)
-    },
     onSelectChange (selectedRowKeys) {
       console.log('selectedRowKeys changed: ', selectedRowKeys)
       this.selectedRowKeys = selectedRowKeys