chenrui vor 4 Jahren
Ursprung
Commit
ce9b809302
39 geänderte Dateien mit 3197 neuen und 2342 gelöschten Zeilen
  1. 1 1
      src/api/dealerProductBrand.js
  2. 4 4
      src/api/dealerProductType.js
  3. 39 2
      src/api/stock.js
  4. 13 0
      src/api/stockFlow.js
  5. 21 0
      src/api/stockWarn.js
  6. 101 0
      src/api/storeCallOut.js
  7. 39 0
      src/api/storeCallOutType.js
  8. 481 364
      src/config/router.config.js
  9. 0 101
      src/views/allocationManagement/chainTransferOut/basicInfoModal.vue
  10. 0 107
      src/views/allocationManagement/chainTransferOut/detail.vue
  11. 0 385
      src/views/allocationManagement/chainTransferOut/edit.vue
  12. 0 220
      src/views/allocationManagement/chainTransferOut/list.vue
  13. 204 0
      src/views/allocationManagement/transferOut/basicInfoModal.vue
  14. 144 0
      src/views/allocationManagement/transferOut/detail.vue
  15. 516 0
      src/views/allocationManagement/transferOut/edit.vue
  16. 287 0
      src/views/allocationManagement/transferOut/list.vue
  17. 8 0
      src/views/basicData/transferTypeManagement/list.vue
  18. 0 0
      src/views/basicData/warehouse/editModal.vue
  19. 0 0
      src/views/basicData/warehouse/list.vue
  20. 0 0
      src/views/basicData/warehouse/storingLocation/editModal.vue
  21. 0 0
      src/views/basicData/warehouse/storingLocation/list.vue
  22. 8 0
      src/views/chainItBackstage/chainGroupSetting/list.vue
  23. 8 0
      src/views/dealerManagement/dealerAccountManagement/list.vue
  24. 8 0
      src/views/dealerManagement/dealerRelationshipBinding/list.vue
  25. 8 0
      src/views/dealerManagement/rebateSettings/list.vue
  26. 8 0
      src/views/dealerManagement/userManagement/list.vue
  27. 8 0
      src/views/financialManagement/financialCollection/list.vue
  28. 0 161
      src/views/financialManagement/inventoryReview/detail.vue
  29. 0 174
      src/views/financialManagement/inventoryReview/list.vue
  30. 44 42
      src/views/inventoryManagement/inventoryQuery/detailModal.vue
  31. 159 57
      src/views/inventoryManagement/inventoryQuery/list.vue
  32. 108 69
      src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue
  33. 239 264
      src/views/inventoryManagement/inventoryWarning/list.vue
  34. 123 91
      src/views/inventoryManagement/warehouseAllocation/basicInfoModal.vue
  35. 69 20
      src/views/inventoryManagement/warehouseAllocation/detail.vue
  36. 420 196
      src/views/inventoryManagement/warehouseAllocation/edit.vue
  37. 113 84
      src/views/inventoryManagement/warehouseAllocation/list.vue
  38. 8 0
      src/views/setting/announcementManagement/list.vue
  39. 8 0
      src/views/supplierManagement/associatedProductDetails/list.vue

+ 1 - 1
src/api/dealerProductBrand.js

@@ -14,7 +14,7 @@ export const dealerProductBrandList = (params) => {
 
 //  产品品牌列表  无分页
 export const dealerProductBrandQuery = (params) => {
-  const url = `/dealerProductBrand/query`
+  const url = `/dealerProductBrand/queryList`
   return axios({
     url: url,
     data: params,

+ 4 - 4
src/api/dealerProductType.js

@@ -1,7 +1,7 @@
 import { axios } from '@/utils/request'
 
-//  产品类别列表  无分页
-export const dealerProductTypeQuery = (params) => {
+//  产品分类 列表  无分页
+export const dealerProductTypeList = (params) => {
   const url = `/dealerProductType/query`
   return axios({
     url: url,
@@ -10,7 +10,7 @@ export const dealerProductTypeQuery = (params) => {
   })
 }
 
-// 新增/编辑产品类
+// 新增/编辑 产品
 export const dealerProductTypeSave = params => {
   return axios({
     url: '/dealerProductType/save',
@@ -19,7 +19,7 @@ export const dealerProductTypeSave = params => {
   })
 }
 
-// 删除产品类
+// 删除 产品
 export const dealerProductTypeDel = params => {
   return axios({
     url: `/dealerProductType/delete/${params.id}`,

+ 39 - 2
src/api/stock.js

@@ -11,9 +11,17 @@ export const stockList = (params) => {
     method: 'post'
   })
 }
-//  库存详情列表  分页
+//  库存 列表 合计
+export const stockCount = (params) => {
+  return axios({
+    url: '/stock/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存 详情列表  分页
 export const stockDetailList = (params) => {
-  const url = `/stock/queryDetailPage/${params.pageNo}/${params.pageSize}`
+  const url = `/stock/detail/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -22,3 +30,32 @@ export const stockDetailList = (params) => {
     method: 'post'
   })
 }
+//  库存 详情列表 合计
+export const stockDetailCount = (params) => {
+  return axios({
+    url: '/stock/detail/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+
+//  库存 详情列表  分页
+export const querySumByProductLocation = (params) => {
+  const url = `/stock/detail/querySumByProductLocation/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  出入库明细  列表  合计
+export const stockByProductSn = (params) => {
+  const url = `/stock/findByProductSn/${params.productSn}`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 13 - 0
src/api/stockFlow.js

@@ -0,0 +1,13 @@
+import { axios } from '@/utils/request'
+
+//  库存流水(出入库明细) 列表  有分页
+export const stockFlowList = (params) => {
+  const url = `/stockFlow/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 21 - 0
src/api/stockWarn.js

@@ -0,0 +1,21 @@
+import { axios } from '@/utils/request'
+
+//  库存预警 列表  分页
+export const stockWarnList = (params) => {
+  const url = `/stockWarn/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  库存预警 保存
+export const stockWarnSaveBatch = (params) => {
+  return axios({
+    url: '/stockWarn/saveBatch',
+    data: params,
+    method: 'post'
+  })
+}

+ 101 - 0
src/api/storeCallOut.js

@@ -0,0 +1,101 @@
+import { axios } from '@/utils/request'
+
+//  店内调出 列表  分页
+export const storeCallOutList = (params) => {
+  const url = `/storeCallOut/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  店内调出 新增
+export const storeCallOutSave = (params) => {
+  return axios({
+    url: '/storeCallOut/save',
+    data: params,
+    method: 'post'
+  })
+}
+//  店内调出 审核
+export const storeCallOutAudit = (params) => {
+  return axios({
+    url: '/storeCallOut/audit',
+    data: params,
+    method: 'post'
+  })
+}
+//  店内调出 出库
+export const storeCallOutOut = (params) => {
+  return axios({
+    url: '/storeCallOut/out',
+    data: params,
+    method: 'post'
+  })
+}
+//  店内调出 删除
+export const storeCallOutDel = (params) => {
+  return axios({
+    url: `/storeCallOut/delete/${params.id}`,
+    method: 'get'
+  })
+}
+//  店内调出 详情
+export const storeCallOutDetail = (params) => {
+  return axios({
+    url: `/storeCallOut/findById/${params.id}`,
+    method: 'get'
+  })
+}
+//  店内调出 详情  根据sn查
+export const storeCallOutDetailSn = (params) => {
+  return axios({
+    url: `/storeCallOut/findBySn/${params.sn}`,
+    method: 'get'
+  })
+}
+//  店内调出  提交
+export const storeCallOutSubmit = (params) => {
+  return axios({
+    url: '/storeCallOut/submit',
+    data: params,
+    method: 'post'
+  })
+}
+//  店内调出详情 列表  分页
+export const storeCallOutDetailList = (params) => {
+  const url = `/storeCallOut/detail/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  店内调出详情 合计
+export const storeCallOutDetailCount = (params) => {
+  return axios({
+    url: '/storeCallOut/detail/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+//  店内调出详情 保存
+export const storeCallOutDetailSave = (params) => {
+  return axios({
+    url: '/storeCallOut/detail/save',
+    data: params,
+    method: 'post'
+  })
+}
+//  店内调出详情 删除
+export const storeCallOutDetailDel = (params) => {
+  return axios({
+    url: '/storeCallOut/detail/delete',
+    data: params,
+    method: 'post'
+  })
+}

+ 39 - 0
src/api/storeCallOutType.js

@@ -0,0 +1,39 @@
+import { axios } from '@/utils/request'
+
+//  店内调出类型 列表  分页
+export const storeCallOutTypeList = (params) => {
+  const url = `/storeCallOutType/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  店内调出类型 列表  不分页
+export const storeCallOutTypeAllList = (params) => {
+  return axios({
+    url: `/storeCallOutType/queryList`,
+    data: {},
+    method: 'post'
+  })
+}
+
+// 新增/编辑 店内调出类型
+export const storeCallOutTypeSave = params => {
+  return axios({
+    url: '/storeCallOutType/save',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 删除 店内调出类型
+export const storeCallOutTypeDel = params => {
+  return axios({
+    url: `/storeCallOutType/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 481 - 364
src/config/router.config.js


+ 0 - 101
src/views/allocationManagement/chainTransferOut/basicInfoModal.vue

@@ -1,101 +0,0 @@
-<template>
-	<a-modal centered class="chainTransferOut-basicInfo-modal" :footer="null" :maskClosable="false" title="新增连锁调出单" v-model="isShow" @cancle="isShow = false" width="80%">
-		<a-form-model
-			id="chainTransferOut-basicInfo-form"
-			ref="ruleForm"
-			:model="form"
-			:rules="rules"
-			:label-col="formItemLayout.labelCol"
-			:wrapper-col="formItemLayout.wrapperCol"
-		>
-			<a-form-model-item label="调出产品类型" prop="sort">
-				<v-select
-					v-model="form.billStatus"
-					ref="billStatus"
-					id="chainTransferOut-basicInfo-billStatus"
-					code="PAYMENT_TYPE"
-					placeholder="请选择调出产品类型"
-					allowClear
-				></v-select>
-			</a-form-model-item>
-			<a-form-model-item label="调往对象" prop="state">
-			  <a-select placeholder="请选择调往对象" allowClear v-model="form.dataSourceNo" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
-			  	<a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
-			  </a-select>
-			</a-form-model-item>
-			<a-form-model-item label="备注" prop="remarks">
-				<a-textarea id="chainTransferOut-basicInfo-remarks" :maxLength="500" v-model="form.remarks" placeholder="请输入备注(最多500个字符)" allowClear />
-			</a-form-model-item>
-		</a-form-model>
-		<div class="btn-cont">
-			<a-button type="primary" id="chainTransferOut-basicInfo-modal-save" @click="handleSave">保存</a-button>
-			<a-button id="chainTransferOut-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
-		</div>
-	</a-modal>
-</template>
-
-<script>
-import { VSelect } from '@/components';
-export default {
-	name: 'chainTransferOutBasicInfoModal',
-	components: { VSelect },
-	props: {
-		openModal: {
-			//  弹框显示状态
-			type: Boolean,
-			default: false
-		}
-	},
-	data() {
-		return {
-			isShow: this.openModal, //  是否打开弹框
-			formItemLayout: {
-				labelCol: { span: 6 },
-				wrapperCol: { span: 16 }
-			},
-			form: {
-				name: '', // 仓库名称
-				sort: '' //  排序
-			},
-			rules: {
-				name: [{ required: true, message: '请选择调出产品类型', trigger: 'change' }]
-			},
-			brandData: [] //  供应商  下拉数据
-		};
-	},
-	methods: {
-		//  保存
-		handleSave() {
-			this.isShow = false
-			this.$emit('ok')
-		},
-		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">
-.chainTransferOut-basicInfo-modal {
-	.ant-modal-body {
-		padding: 40px 40px 24px;
-	}
-	.btn-cont {
-		text-align: center;
-		margin: 35px 0 10px;
-	}
-}
-</style>

+ 0 - 107
src/views/allocationManagement/chainTransferOut/detail.vue

@@ -1,107 +0,0 @@
-<template>
-  <div class="chainTransferOutDetail-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="chainTransferOutDetail-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="chainTransferOutDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-button key="2" id="chainTransferOutDetail-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="chainTransferOutDetail-print-btn">快速打印</a-button>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="chainTransferOutDetail-cont">
-      <!-- 总计 -->
-      <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">审核状态: <strong>支持市级</strong>,完结状态: <strong>支持市级</strong>,调出对象: <strong>支持市级</strong>,调入单号: <strong>2121212</strong>,总成本:¥<strong>6.33</strong>,总数量: <strong>6</strong> </div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="default"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 1085 }"
-        bordered>
-        <!-- 成本小计 -->
-        <template slot="totalCost" slot-scope="text, record">
-          <span>{{ (record.outCost * record.outQty) || 0 }}</span>
-        </template>
-      </s-table>
-    </a-card>
-  </div>
-</template>
-
-<script>
-import { allocLinkageOutDetailList } from '@/api/allocLinkageOut'
-import { STable, VSelect } from '@/components'
-export default {
-  components: { STable, VSelect },
-  data () {
-    return {
-      queryParam: {
-        allocationLinkageOutSn: this.$route.params.sn
-      },
-      disabled: false, //  查询、重置按钮是否可操作
-      brandData: [], //  产品品牌  下拉数据
-      typeData: [], //  产品类别  下拉数据
-      // 表头
-      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', align: 'center', ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价(¥)', dataIndex: 'outCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出数量', dataIndex: 'outQty', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计(¥)', scopedSlots: { customRender: 'totalCost' }, width: 135, align: 'center' }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        return allocLinkageOutDetailList(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
-        })
-      }
-    }
-  },
-  methods: {
-    //  重置
-    resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
-      this.$refs.table.refresh(true)
-    },
-    //  提交
-    handleSubmit () {},
-    //  返回列表
-    handleBack () {
-      this.$router.push({ path: '/allocationManagement/chainTransferOut/list' })
-    }
-  }
-}
-</script>
-
-<style lang="less">
-  .chainTransferOutDetail-wrap{
-    .chainTransferOutDetail-back{
-      margin-bottom: 15px;
-    }
-    .chainTransferOutDetail-cont{
-      margin-bottom: 15px;
-    }
-  }
-</style>

+ 0 - 385
src/views/allocationManagement/chainTransferOut/edit.vue

@@ -1,385 +0,0 @@
-<template>
-  <div class="chainTransferOutEdit-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="chainTransferOutEdit-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="chainTransferOutEdit-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-button key="2" id="chainTransferOutEdit-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="chainTransferOutEdit-print-btn">快速打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 基础信息 -->
-    <a-card size="small" :bordered="false" class="chainTransferOutEdit-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="chainTransferOutEdit-circle-btn"
-              @click.stop="handleEditInfo" />
-          </template>
-          <a-descriptions :column="3">
-            <a-descriptions-item label="调往对象">箭冠营销中心</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 选择产品 -->
-    <a-card size="small" :bordered="false" class="chainTransferOutEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="选择产品">
-          <!-- 筛选条件 -->
-          <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="产品编码" prop="name">
-                    <a-input id="chainTransferOutEdit-name" v-model="queryParam.name" placeholder="请输入产品编码" allowClear />
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="产品名称" prop="name">
-                    <a-input id="chainTransferOutEdit-name" v-model="queryParam.name" placeholder="请输入产品名称" allowClear />
-                  </a-form-item>
-                </a-col>
-                <a-col :md="6" :sm="24">
-                  <a-form-item label="原厂编码" prop="name">
-                    <a-input id="chainTransferOutEdit-name" v-model="queryParam.name" 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="chainTransferOutEdit-state"
-                        allowClear
-                        v-model="queryParam.dataSourceNo"
-                        :showSearch="true"
-                        option-filter-prop="children"
-                        :filter-option="filterOption">
-                        <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
-                      </a-select>
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="产品类别">
-                      <a-cascader :options="typeData" id="chainTransferOutEdit-state" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="仓库">
-                      <v-select
-                        v-model="queryParam.billStatus"
-                        ref="billStatus"
-                        id="chainTransferOutEdit-billStatus"
-                        code="PAYMENT_TYPE"
-                        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="chainTransferOutEdit-refresh">查询</a-button>
-                  <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutEdit-reset">重置</a-button>
-                  <a @click="advanced=!advanced" style="margin-left: 8px">
-                    {{ advanced ? '收起' : '展开' }}
-                    <a-icon :type="advanced ? 'up' : 'down'"/>
-                  </a>
-                </a-col>
-              </a-row>
-            </a-form>
-          </div>
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="table"
-            size="default"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :data="loadData"
-            :scroll="{ x: 1530 }"
-            bordered>
-            <!-- 调出数量 -->
-            <template slot="transferOutQuantity" slot-scope="text, record">
-              <a-input-number
-                id="chainTransferOutEdit-storageQuantity"
-                :value="record.storageQuantity"
-                :precision="0"
-                :min="0"
-                :max="999999"
-                placeholder="请输入" />
-            </template>
-            <!-- 操作 -->
-            <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="link" @click="handleAdd(record)" id="chainTransferOutEdit-add-btn">添加</a-button>
-            </template>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 已选产品 -->
-    <a-card size="small" :bordered="false" class="chainTransferOutEdit-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="已选产品">
-          <!-- 总计 -->
-          <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">总成本:¥<strong>6.33</strong>,总数量: <strong>6</strong> ,总款数: <strong>6</strong> </div>
-          </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="$refs.chooseTable.refresh(true)">
-                  <a-row :gutter="15">
-                    <a-col :md="9" :sm="24">
-                      <a-form-item label="产品编码" prop="name">
-                        <a-input id="chainTransferOutEdit-name" v-model="queryParam.name" placeholder="请输入产品编码" allowClear />
-                      </a-form-item>
-                    </a-col>
-                    <a-col :md="9" :sm="24">
-                      <a-form-item label="产品名称" prop="name">
-                        <a-input id="chainTransferOutEdit-name" v-model="queryParam.name" placeholder="请输入产品名称" allowClear />
-                      </a-form-item>
-                    </a-col>
-                    <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
-                      <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="disabled" id="chainTransferOutList-refresh">查询</a-button>
-                      <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutList-reset">重置</a-button>
-                    </a-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" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
-            </a-col>
-          </a-row>
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="chooseTable"
-            size="default"
-            :rowKey="(record) => record.id"
-            :columns="chooseColumns"
-            :data="chooseLoadData"
-            :scroll="{ x: 1545 }"
-            bordered>
-            <!-- 调出数量 -->
-            <template slot="transferOutQuantity" slot-scope="text, record">
-              <a-input-number
-                id="chainTransferOutEdit-storageQuantity"
-                :value="record.storageQuantity"
-                :precision="0"
-                :min="0"
-                :max="999999"
-                placeholder="请输入" />
-            </template>
-            <!-- 操作 -->
-            <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="link" @click="handleDel(record)" id="chainTransferOutEdit-del-btn">删除</a-button>
-            </template>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-affix :offset-bottom="0">
-      <div style="text-align: center;width: 100%;background-color: #fff;padding: 30px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button type="primary" id="chainTransferOutEdit-submit" size="large" @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'
-export default {
-  components: { STable, VSelect, basicInfoModal },
-  data () {
-    return {
-      queryParam: {
-
-      },
-      brandData: [], //  产品品牌  下拉数据
-      typeData: [], //  产品类别  下拉数据
-      disabled: false, //  查询、重置按钮是否可操作
-      advanced: false, // 高级搜索 展开/关闭
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'creatDate', width: 140, align: 'center' },
-        { title: '产品名称', dataIndex: 'custNahme', align: 'center', ellipsis: true },
-        { title: '原厂编码', dataIndex: 'totalP', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'custsNsame', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'custsNdame', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'custsNafme', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价(¥)', dataIndex: 'storageQuantity', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存数量', dataIndex: 'custsNagme', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'custsNsagme', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出数量', scopedSlots: { customRender: 'transferOutQuantity' }, width: 150, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
-      ],
-      // 加载数据方法 必须为 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', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
-          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)
-        })
-      },
-      // 表头
-      chooseColumns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'creatDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'custNahme', align: 'center', ellipsis: true },
-        { title: '原厂编码', dataIndex: 'totalP', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'custsNsame', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'custsNdame', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'custsNafme', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价(¥)', dataIndex: 'storageQuantity', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'custsNsagme', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出数量', scopedSlots: { customRender: 'transferOutQuantity' }, width: 150, align: 'center' },
-        { title: '成本小计(¥)', dataIndex: 'custsNagme', width: 115, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      chooseLoadData: parameter => {
-        this.disabled = true
-        // return 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', purchaseNo: 'jgqp11111111111', custssName: 0, creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
-          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 // 选择基本信息弹框是否显示
-    }
-  },
-  methods: {
-    //  重置
-    resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
-      this.$refs.table.refresh(true)
-    },
-    //  添加
-    handleAdd (row) {},
-    //  删除
-    handleDel (row) {},
-    //  编辑基本信息
-    handleEditInfo () {
-      this.openModal = true
-    },
-    //  基本信息  保存
-    handleOk () {
-
-    },
-    //  提交
-    handleSubmit () {},
-    //  导入明细
-    handleImport () {
-      console.log(333)
-    },
-    //  返回列表
-    handleBack () {
-      this.$router.push({ path: '/allocationManagement/chainTransferOut/list' })
-    },
-    filterOption (input, option) {
-      	return (
-      		option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      	)
-    }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.openModal = false
-    })
-  }
-}
-</script>
-
-<style lang="less">
-  .chainTransferOutEdit-wrap{
-    .chainTransferOutEdit-back{
-      margin-bottom: 15px;
-    }
-    .chainTransferOutEdit-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 - 220
src/views/allocationManagement/chainTransferOut/list.vue

@@ -1,220 +0,0 @@
-<template>
-  <a-card size="small" :bordered="false" class="chainTransferOutList-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="chainTransferOutList-createDate"
-                :disabledDate="disabledDate"
-                v-model="createDate"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
-            </a-form-item>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调往对象">
-              <v-select
-                v-model="queryParam.putTenantName"
-                ref="putTenantName"
-                id="chainTransferOutList-putTenantName"
-                code="PAYMENT_TYPE"
-                placeholder="请选择调往对象"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="调出产品类型">
-              <v-select
-                v-model="queryParam.allocationType"
-                ref="allocationType"
-                id="chainTransferOutList-allocationType"
-                code="PAYMENT_TYPE"
-                placeholder="请选择调出产品类型"
-                allowClear></v-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="chainTransferOutList-state"
-                  code="PAYMENT_TYPE"
-                  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="chainTransferOutList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutList-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="chainTransferOutList-add" type="primary" @click="handleEdit()">新增调出单</a-button>
-    </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1500 }"
-      bordered>
-      <!-- 状态 -->
-      <template slot="state" slot-scope="text, record">
-        <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '待提交': '待审核' }}</a-tag>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="handleExamine(record)" id="chainTransferOutList-examine-btn">审核</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleEdit(record)" id="chainTransferOutList-edit-btn">编辑</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleOut(record)" id="chainTransferOutList-out-btn">出库</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDetail(record)" id="chainTransferOutList-detail-btn">详情</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDel(record)" id="chainTransferOutList-del-btn">删除</a-button>
-      </template>
-    </s-table>
-    <!-- 新增/编辑 -->
-    <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
-  </a-card>
-</template>
-
-<script>
-import { allocLinkageOutList } from '@/api/allocLinkageOut'
-import { STable, VSelect } from '@/components'
-import basicInfoModal from './basicInfoModal.vue'
-export default {
-  components: { STable, VSelect, basicInfoModal },
-  data () {
-    return {
-      advanced: false, // 高级搜索 展开/关闭
-      createDate: undefined, //  创建时间
-      queryParam: { //  查询条件
-        putTenantName: undefined, //  调往对象
-        allocationType: 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: '连锁调出单号', dataIndex: 'allocationLinkageOutNo', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调往对象', dataIndex: 'putTenantName', 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: 'allocationType', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', scopedSlots: { customRender: 'state' }, width: 100, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 260, align: 'center', fixed: 'right' }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.queryParam = {}
-        return allocLinkageOutList(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, //  新增编辑  弹框
-      itemId: '' //  当前品牌id
-    }
-  },
-  methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
-    },
-    //  重置
-    resetSearchForm () {
-      this.queryParam.putTenantName = undefined
-      this.queryParam.allocationType = undefined
-      this.queryParam.state = undefined
-      this.createDate = undefined
-      this.$refs.table.refresh(true)
-    },
-    //  基本信息  保存
-    handleOk () {
-      this.$router.push({ path: `/allocationManagement/chainTransferOut/add` })
-    },
-    //  删除
-    handleDel (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '删除后不可恢复,确定要进行删除吗?',
-        centered: true,
-        onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
-        }
-      })
-    },
-    //  出库
-    handleOut (row) {
-
-    },
-    //  审核
-    handleExamine () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确认要审核通过吗?',
-        centered: true,
-        onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
-        }
-      })
-    },
-    //  详情
-    handleDetail (row) {
-      this.$router.push({ path: `/allocationManagement/chainTransferOut/detail/${row.id}/${row.allocationLinkageOutSn}` })
-    },
-    //  新增/编辑
-    handleEdit (row) {
-      this.openModal = true
-    }
-  }
-}
-</script>

+ 204 - 0
src/views/allocationManagement/transferOut/basicInfoModal.vue

@@ -0,0 +1,204 @@
+<template>
+  <a-modal
+    centered
+    class="storeTransferOut-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="新增店内调出单"
+    v-model="isShow"
+    @cancle="isShow = false"
+    width="80%">
+    <a-form-model
+      id="storeTransferOut-basicInfo-form"
+      ref="ruleForm"
+      :model="form"
+      :rules="rules"
+      :label-col="formItemLayout.labelCol"
+      :wrapper-col="formItemLayout.wrapperCol"
+    >
+      <a-form-model-item label="调往对象" prop="putPersonType">
+        <a-radio-group v-model="form.putPersonType" @change="putPersonTypeChange">
+          <a-radio v-for="(item,index) in putPersonTypeList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
+        </a-radio-group>
+      </a-form-model-item>
+      <a-form-model-item label="调往对象名称" :prop="isCustomer ? 'putPersonSn' : 'putPersonName'">
+        <a-select
+          v-if="isCustomer"
+          v-model="form.putPersonSn"
+          placeholder="请选择"
+          allowClear
+          :showSearch="true"
+          option-filter-prop="children"
+          :filter-option="filterOption"
+          @change="putPersonChange">
+          <a-select-option v-for="item in custData" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</a-select-option>
+        </a-select>
+        <a-input v-if="!isCustomer" v-model="form.putPersonName" placeholder="请输入调往对象名称(最多30个字符)" allowClear :maxLength="30" />
+      </a-form-model-item>
+      <a-form-model-item label="调拨类型" prop="callOutType">
+        <a-select v-model="form.callOutType" placeholder="请选择调拨类型" allowClear >
+          <a-select-option v-for="item in storeCallOutTypeList" :key="item.storeCallOutTypeSn" :value="item.storeCallOutTypeSn">{{ item.name }}</a-select-option>
+        </a-select>
+      </a-form-model-item>
+      <a-form-model-item label="备注" prop="remark">
+        <a-textarea id="storeTransferOut-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
+      </a-form-model-item>
+    </a-form-model>
+    <div class="btn-cont">
+      <a-button type="primary" id="storeTransferOut-basicInfo-modal-save" @click="handleSave">保存</a-button>
+      <a-button id="storeTransferOut-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+import { storeCallOutSave } from '@/api/storeCallOut'
+import { custAllList } from '@/api/customer'
+import { getLookUpData } from '@/api/data'
+import { storeCallOutTypeAllList } from '@/api/storeCallOutType'
+export default {
+  name: 'StoreTransferOutBasicInfoModal',
+  components: { VSelect },
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        putPersonType: 'CUSTOMER',
+        putPersonSn: undefined,
+        putPersonName: '',
+        callOutType: undefined,
+        remark: ''
+      },
+      rules: {
+        putPersonType: [{ required: true, message: '请选择调往对象', trigger: 'change' }],
+        putPersonSn: [{ required: true, message: '请选择调往对象名称', trigger: 'change' }],
+        putPersonName: [{ required: true, message: '请输入调往对象名称', trigger: 'blur' }],
+        callOutType: [{ required: true, message: '请选择调拨类型', trigger: 'change' }]
+      },
+      custData: [], //  调往对象  下拉数据
+      putPersonTypeList: [], //  调往对象类型
+      storeCallOutTypeList: [] //  调拨类型
+    }
+  },
+  computed: {
+    // 当前所选调往对象是否为客户
+    isCustomer () {
+      return this.form.putPersonType == 'CUSTOMER'
+    }
+  },
+  methods: {
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          storeCallOutSave(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
+        }
+      })
+    },
+    // 调往对象  change
+    putPersonTypeChange (e) {
+      this.$refs.ruleForm.resetFields()
+      this.form.putPersonSn = undefined
+      this.form.putPersonName = ''
+      this.form.putPersonType = e.target.value
+    },
+    // 调往对象名称  change
+    putPersonChange (val) {
+      const ind = this.custData.findIndex(item => item.customerSn == val)
+      this.form.putPersonName = this.custData[ind].customerName
+    },
+    // 调往对象列表
+    getCustAllList () {
+      custAllList().then(res => {
+        if (res.status == 200) {
+          this.custData = res.data
+        } else {
+          this.custData = []
+        }
+      })
+    },
+    // 调往对象类型
+    getPutPersonTypeList () {
+      const _this = this
+      getLookUpData({
+        pageNo: 1,
+        pageSize: 1000,
+        lookupCode: 'PUT_PERSON_TYPE'
+      }).then(res => {
+        if (res.status == 200) {
+          _this.putPersonTypeList = res.data.list
+        } else {
+          _this.putPersonTypeList = []
+        }
+      })
+    },
+    //  调拨类型
+    getStoreCallOutTypeAllList () {
+      storeCallOutTypeAllList().then(res => {
+        if (res.status == 200) {
+          this.storeCallOutTypeList = res.data
+        } else {
+          this.storeCallOutTypeList = []
+        }
+      })
+    },
+    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')
+        this.$refs.ruleForm.resetFields()
+      } else {
+        this.getCustAllList()
+        this.getPutPersonTypeList()
+        this.getStoreCallOutTypeAllList()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.storeTransferOut-basicInfo-modal {
+	.ant-modal-body {
+		padding: 40px 40px 24px;
+	}
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 144 - 0
src/views/allocationManagement/transferOut/detail.vue

@@ -0,0 +1,144 @@
+<template>
+  <div class="storeTransferOutDetail-wrap">
+    <a-page-header :ghost="false" :backIcon="false" class="storeTransferOutDetail-back" >
+      <!-- 自定义的二级文字标题 -->
+      <template slot="subTitle">
+        <a id="storeTransferOutDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        <a-button
+          v-if="isEdit"
+          type="primary"
+          size="small"
+          style="background-color: #1890ff;margin-left: 20px;border: #1890ff;"
+          id="storeTransferOutDetail-edit-btn"
+          @click.stop="handleEdit">编辑</a-button>
+      </template>
+      <!-- 操作区,位于 title 行的行尾 -->
+      <template slot="extra">
+        <a-button key="2" id="storeTransferOutDetail-preview-btn">打印预览</a-button>
+        <a-button key="1" type="primary" id="storeTransferOutDetail-print-btn">快速打印</a-button>
+      </template>
+    </a-page-header>
+    <a-card size="small" :bordered="false" class="storeTransferOutDetail-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1" header="基础信息">
+          <a-descriptions :column="3">
+            <a-descriptions-item label="调往对象名称">{{ (basicInfoData&&basicInfoData.putPersonName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="店内调出单号">{{ (basicInfoData&&basicInfoData.storeCallOutNo) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="财务状态">{{ (basicInfoData&&basicInfoData.settleStateDictValue) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="调拨类型">{{ (basicInfoData&&basicInfoData.callOutTypeName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
+          </a-descriptions>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
+    <a-card size="small" :bordered="false" class="storeTransferOutDetail-cont">
+      <!-- 总计 -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 995 }"
+        bordered>
+      </s-table>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { getOperationalPrecision } from '@/libs/tools.js'
+import { storeCallOutDetailList, storeCallOutDetailCount, storeCallOutDetailSn } from '@/api/storeCallOut'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '产品编码', dataIndex: 'productCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
+        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价(¥)', dataIndex: 'outCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调出数量', dataIndex: 'outQty', width: 100, align: 'center' },
+        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: 115, align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return storeCallOutDetailList(Object.assign(parameter, { storeCallOutSn: this.$route.params.sn })).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
+          }
+          return data
+        })
+      },
+      basicInfoData: null, //  基本信息
+      productTotal: null //  合计
+    }
+  },
+  computed: {
+    isEdit () {
+      return (this.basicInfoData && this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData && this.basicInfoData.state == 'WAIT_AUDIT')
+    }
+  },
+  methods: {
+    //  返回列表
+    handleBack () {
+      this.$router.push({ path: '/allocationManagement/transferOut/list' })
+    },
+    // 基本信息
+    getDetail () {
+      storeCallOutDetailSn({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
+    // 合计
+    getDetailCount () {
+      storeCallOutDetailCount({ storeCallOutSn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = null
+        }
+      })
+    },
+    //  编辑
+    handleEdit () {
+      this.$router.push({ path: `/allocationManagement/transferOut/edit/${this.basicInfoData.id}/${this.basicInfoData.storeCallOutSn}` })
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getDetail()
+      vm.getDetailCount()
+    })
+  }
+}
+</script>
+
+<style lang="less">
+  .storeTransferOutDetail-wrap{
+    .storeTransferOutDetail-back{
+      margin-bottom: 15px;
+    }
+    .storeTransferOutDetail-cont{
+      margin-bottom: 15px;
+    }
+  }
+</style>

+ 516 - 0
src/views/allocationManagement/transferOut/edit.vue

@@ -0,0 +1,516 @@
+<template>
+  <div class="storeTransferOutEdit-wrap">
+    <a-page-header :ghost="false" :backIcon="false" class="storeTransferOutEdit-back" >
+      <!-- 自定义的二级文字标题 -->
+      <template slot="subTitle">
+        <a id="storeTransferOutEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        <span style="margin: 0 15px;color: #666;">调往对象名称:{{ (basicInfoData&&basicInfoData.putPersonName) || '--' }}</span>
+      </template>
+      <!-- 操作区,位于 title 行的行尾 -->
+      <template slot="extra">
+        <a-button key="2" id="storeTransferOutEdit-preview-btn">打印预览</a-button>
+        <a-button key="1" type="primary" id="storeTransferOutEdit-print-btn">快速打印</a-button>
+      </template>
+    </a-page-header>
+    <!-- 选择产品 -->
+    <a-card size="small" :bordered="false" class="storeTransferOutEdit-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1" header="选择产品">
+          <!-- 筛选条件 -->
+          <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="产品编码" prop="productCode">
+                    <a-input id="storeTransferOutEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="产品名称" prop="productName">
+                    <a-input id="storeTransferOutEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="仓库">
+                    <a-select id="storeTransferOutEdit-warehouseSn" placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
+                      <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-form-item>
+                </a-col>
+                <template v-if="advanced">
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="产品分类">
+                      <a-cascader
+                        @change="changeProductType"
+                        change-on-select
+                        v-model="productType"
+                        expand-trigger="hover"
+                        :options="productTypeList"
+                        :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                        id="storeTransferOutEdit-productType"
+                        placeholder="请选择产品分类"
+                        allowClear />
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="产品品牌">
+                      <a-select
+                        placeholder="请选择产品品牌"
+                        id="storeTransferOutEdit-brandSn"
+                        allowClear
+                        v-model="queryParam.brandSn"
+                        :showSearch="true"
+                        option-filter-prop="children"
+                        :filter-option="filterOption">
+                        <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
+                </template>
+                <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
+                  <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
+                  <a @click="advanced=!advanced" style="margin-left: 8px">
+                    {{ advanced ? '收起' : '展开' }}
+                    <a-icon :type="advanced ? 'up' : 'down'"/>
+                  </a>
+                </a-col>
+              </a-row>
+            </a-form>
+          </div>
+          <!-- 列表 -->
+          <s-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
+            :columns="columns"
+            :customRow="handleClickRow"
+            :data="loadData"
+            :scroll="{ x: 1180, y: 300 }"
+            :defaultLoadData="false"
+            bordered>
+            <!-- 操作 -->
+            <template slot="action" slot-scope="text, record">
+              <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="storeTransferOutEdit-add-btn">添加</a-button>
+            </template>
+          </s-table>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
+    <!-- 已选产品 -->
+    <a-card size="small" :bordered="false" class="storeTransferOutEdit-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">
+            <a-col :span="20">
+              <div class="table-page-search-wrapper">
+                <a-form layout="inline" @keyup.enter.native="getChooseProductList(1)">
+                  <a-row :gutter="15">
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品编码" prop="productCode">
+                        <a-input id="storeTransferOutEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                      </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="24">
+                      <a-form-item label="产品名称" prop="productName">
+                        <a-input id="storeTransferOutEdit-productName" v-model="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="storeTransferOutList-refresh">查询</a-button>
+                      <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
+                    </a-col>
+                  </a-row>
+                </a-form>
+              </div>
+            </a-col>
+            <a-col :span="4" style="text-align: right;">
+              <a-button size="small" id="storeTransferOutEdit-import-btn">导入明细</a-button>
+            </a-col>
+          </a-row>
+          <!-- 列表 -->
+          <a-table
+            class="sTable"
+            ref="chooseTable"
+            size="small"
+            :rowKey="(record) => record.id"
+            :columns="chooseColumns"
+            :dataSource="chooseLoadData"
+            :scroll="{ x: 1335, y: 300 }"
+            :pagination="choosePaginationProps"
+            bordered>
+            <!-- 调出数量 -->
+            <template slot="outQty" slot-scope="text, record">
+              <a-input-number
+                id="storeTransferOutEdit-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="storeTransferOutEdit-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="storeTransferOutEdit-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 { getOperationalPrecision } from '@/libs/tools.js'
+import { storeCallOutDetailList, storeCallOutDetail, storeCallOutDetailCount, storeCallOutDetailSave, storeCallOutDetailDel, storeCallOutSubmit } from '@/api/storeCallOut'
+import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+import { dealerProductTypeList } from '@/api/dealerProductType'
+import { warehouseAllList } from '@/api/warehouse'
+import { productQuery } from '@/api/allocWarehouse'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      queryParam: {
+        productCode: '',
+        productName: '',
+        warehouseSn: undefined,
+        brandSn: undefined,
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined
+      },
+      chooseQueryParam: {
+        productCode: '',
+        productName: ''
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      chooseDisabled: false, //  查询、重置按钮是否可操作
+      advanced: false, // 高级搜索 展开/关闭
+      productBrandList: [], //  产品品牌  下拉数据
+      productTypeList: [], //  产品分类  下拉数据
+      productType: [],
+      warehouseList: [], //  仓库  下拉数据
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center' },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
+        { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本价(¥)', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        return productQuery(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
+        })
+      },
+      // 表头
+      chooseColumns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
+        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价(¥)', dataIndex: 'outCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: 140, align: 'center' },
+        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: 115, align: 'center' },
+        { title: '操作', 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.warehouseSn = undefined
+      this.queryParam.brandSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.$refs.table.refresh(true)
+    },
+    // 双击快速添加
+    handleClickRow (record) {
+      return {
+        on: {
+          dblclick: (event) => {
+            this.handleAdd(record)
+          }
+        }
+      }
+    },
+    // 已选产品  重置
+    chooseResetSearchForm () {
+      this.chooseQueryParam.productCode = ''
+      this.chooseQueryParam.productName = ''
+      this.getChooseProductList(1)
+    },
+    // 基本信息
+    getDetail () {
+      storeCallOutDetail({ id: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
+    //  添加/编辑
+    handleAdd (row, isEdit) {
+      const params = {
+        id: isEdit ? row.id : undefined,
+        storeCallOutSn: this.$route.params.sn,
+        outCost: isEdit ? row.outCost : row.putCost,
+        outQty: isEdit ? row.outQty : 1, //  添加时调出数量默认为1
+        productSn: row.productSn,
+        productCode: row.productCode,
+        productOrigCode: row.productOrigCode || undefined,
+        productTypeSn1: row.productTypeSn1,
+        productTypeSn2: row.productTypeSn2,
+        productTypeSn3: row.productTypeSn3,
+        brandSn: row.brandSn,
+        warehouseSn: row.warehouseSn,
+        warehouseLocationSn: row.warehouseLocationSn
+      }
+      if (isEdit) { // 编辑
+        // 清空数量时,值应保持未清空前的值,因数量不可为空
+        if (!row.outQty || row.outQty == row.outQtyBackups) {
+          row.outQty = row.outQtyBackups
+          return
+        }
+      }
+      storeCallOutDetailSave(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.getChooseProductList()
+        }
+      })
+    },
+    //  删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除后不可恢复,确定要进行删除吗?',
+        centered: true,
+        onOk () {
+          storeCallOutDetailDel({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.getChooseProductList()
+            }
+          })
+        }
+      })
+    },
+    //  提交
+    handleSubmit () {
+      const _this = this
+      storeCallOutSubmit({ id: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          setTimeout(() => {
+            _this.handleBack()
+          }, 1000)
+        }
+      })
+    },
+    // 合计
+    getDetailCount (params) {
+      storeCallOutDetailCount(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/transferOut/list' })
+    },
+    //  已选产品 分页  一页多少条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,
+        storeCallOutSn: this.$route.params.sn
+      }
+      storeCallOutDetailList(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].outQtyBackups = data.list[i].outQty
+            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].outCost, data.list[i].outQty)
+          }
+          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
+    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 = []
+        }
+      })
+    },
+    // 仓库下拉数据
+    getWarehouseList (type) {
+      warehouseAllList({}).then(res => {
+        if (res.status == 200) {
+          this.warehouseList = res.data
+        } else {
+          this.warehouseList = []
+        }
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getDetail()
+      vm.getChooseProductList(1)
+      vm.getWarehouseList()
+      vm.getProductBrand()
+      vm.getProductType()
+    })
+  }
+}
+</script>
+
+<style lang="less">
+  .storeTransferOutEdit-wrap{
+    .storeTransferOutEdit-back{
+      margin-bottom: 15px;
+    }
+    .storeTransferOutEdit-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>

+ 287 - 0
src/views/allocationManagement/transferOut/list.vue

@@ -0,0 +1,287 @@
+<template>
+  <a-card size="small" :bordered="false" class="storeTransferOutList-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="storeTransferOutList-createDate"
+                :disabledDate="disabledDate"
+                v-model="createDate"
+                :format="dateFormat"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="调往对象名称">
+              <a-input id="storeTransferOutList-putPersonName" v-model.trim="queryParam.putPersonName" allowClear placeholder="请输入调往对象名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="调拨类型">
+              <a-select id="storeTransferOutList-callOutType" v-model="queryParam.callOutType" placeholder="请选择调拨类型" allowClear >
+                <a-select-option v-for="item in storeCallOutTypeList" :key="item.storeCallOutTypeSn" :value="item.storeCallOutTypeSn">{{ item.name }}</a-select-option>
+              </a-select>
+            </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="storeTransferOutList-state"
+                  code="STORE_CALL_OUT_STATE"
+                  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="storeTransferOutList-settleState"
+                  code="FINANCIAL_RECEIVE_STATUS"
+                  placeholder="请选择财务状态"
+                  allowClear
+                ></v-select>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
+            <a @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="storeTransferOutList-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="storeCallOutNo" slot-scope="text, record">
+        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.storeCallOutNo }}</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 == 'WAIT_AUDIT'"
+          class="button-warning"
+          @click="handleExamine(record)"
+          id="storeTransferOutList-examine-btn">审核</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT')"
+          class="button-info"
+          @click="handleEdit(record)"
+          id="storeTransferOutList-edit-btn">编辑</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="record.state == 'WAIT_OUT_WAREHOUSE'"
+          class="button-primary"
+          @click="handleOut(record)"
+          id="storeTransferOutList-out-btn">出库</a-button>
+        <a-button
+          size="small"
+          type="link"
+          v-if="(record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'WAIT_OUT_WAREHOUSE')"
+          class="button-error"
+          @click="handleDel(record)"
+          id="storeTransferOutList-del-btn">删除</a-button>
+        <span v-if="(record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT') && (record.state != 'WAIT_OUT_WAREHOUSE')">--</span>
+      </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 { storeCallOutList, storeCallOutAudit, storeCallOutDel, storeCallOutOut } from '@/api/storeCallOut'
+import { storeCallOutTypeAllList } from '@/api/storeCallOutType'
+export default {
+  components: { STable, VSelect, basicInfoModal },
+  data () {
+    return {
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      createDate: [], //  创建时间
+      queryParam: { //  查询条件
+        putPersonName: undefined, //  调往对象
+        callOutType: undefined, //  调拨类型
+        state: undefined, //  业务状态
+        settleState: undefined //  财务状态
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      dateFormat: 'YYYY-MM-DD',
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '店内调出单号', scopedSlots: { customRender: 'storeCallOutNo' }, width: 220, align: 'center' },
+        { title: '调往对象名称', dataIndex: 'putPersonName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调拨类型', dataIndex: 'callOutTypeName', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总款数', dataIndex: 'productTotalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总成本', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: 110, align: 'center' },
+        { title: '财务状态', scopedSlots: { customRender: 'settleState' }, width: 110, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 250, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 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 storeCallOutList(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
+        })
+      },
+      storeCallOutTypeList: [], //  调拨类型
+      openModal: false, //  新增编辑  弹框
+      itemId: '' //  当前品牌id
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.putPersonName = undefined
+      this.queryParam.callOutType = undefined
+      this.queryParam.state = undefined
+      this.queryParam.settleState = undefined
+      this.createDate = undefined
+      this.$refs.table.refresh(true)
+    },
+    //  基本信息  保存
+    handleOk (data) {
+      this.$router.push({ path: `/allocationManagement/transferOut/add/${data.id}/${data.storeCallOutSn}` })
+    },
+    //  删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除后不可恢复,确定要进行删除吗?',
+        centered: true,
+        onOk () {
+          storeCallOutDel({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    //  出库
+    handleOut (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要出库吗?',
+        centered: true,
+        onOk () {
+          storeCallOutOut({ storeCallOutSn: row.storeCallOutSn }).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 () {
+          storeCallOutAudit({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    //  详情
+    handleDetail (row) {
+      this.$router.push({ path: `/allocationManagement/transferOut/detail/${row.storeCallOutSn}` })
+    },
+    //  新增/编辑
+    handleEdit (row) {
+      this.$router.push({ path: `/allocationManagement/transferOut/edit/${row.id}/${row.storeCallOutSn}` })
+    },
+    //  调拨类型
+    getStoreCallOutTypeAllList () {
+      storeCallOutTypeAllList().then(res => {
+        if (res.status == 200) {
+          this.storeCallOutTypeList = res.data
+        } else {
+          this.storeCallOutTypeList = []
+        }
+      })
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.openModal = false
+      vm.getStoreCallOutTypeAllList()
+    })
+  }
+}
+</script>

+ 8 - 0
src/views/basicData/transferTypeManagement/list.vue

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

+ 0 - 0
src/views/inventoryManagement/warehouse/editModal.vue → src/views/basicData/warehouse/editModal.vue


+ 0 - 0
src/views/inventoryManagement/warehouse/list.vue → src/views/basicData/warehouse/list.vue


+ 0 - 0
src/views/inventoryManagement/warehouse/storingLocation/editModal.vue → src/views/basicData/warehouse/storingLocation/editModal.vue


+ 0 - 0
src/views/inventoryManagement/warehouse/storingLocation/list.vue → src/views/basicData/warehouse/storingLocation/list.vue


+ 8 - 0
src/views/chainItBackstage/chainGroupSetting/list.vue

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

+ 8 - 0
src/views/dealerManagement/dealerAccountManagement/list.vue

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

+ 8 - 0
src/views/dealerManagement/dealerRelationshipBinding/list.vue

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

+ 8 - 0
src/views/dealerManagement/rebateSettings/list.vue

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

+ 8 - 0
src/views/dealerManagement/userManagement/list.vue

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

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

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

+ 0 - 161
src/views/financialManagement/inventoryReview/detail.vue

@@ -1,161 +0,0 @@
-<template>
-  <div class="inventoryReviewDetail-wrap">
-    <a-page-header :ghost="false" @back="handleBack" >
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="inventoryReviewDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <a-button key="2" id="inventoryReviewDetail-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="inventoryReviewDetail-print-btn">快速打印</a-button>
-      </template>
-    </a-page-header>
-    <!-- 内容 -->
-    <a-page-header title="盘点单号:CG2021010100001" ></a-page-header>
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message"><strong class="red">红色代表盘盈</strong>,<strong class="green">绿色代表盈亏</strong></div>
-    </a-alert>
-    <!-- 盈亏统计 -->
-    <a-card size="small" :bordered="false" class="inventoryReviewDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="盈亏统计">
-          <a-descriptions :column="2" bordered>
-            <a-descriptions-item label="库存数量">2</a-descriptions-item>
-            <a-descriptions-item label="库存成本">20</a-descriptions-item>
-            <a-descriptions-item label="盘盈数量">¥120.36</a-descriptions-item>
-            <a-descriptions-item label="盘盈成本">3</a-descriptions-item>
-            <a-descriptions-item label="盘亏数量">4</a-descriptions-item>
-            <a-descriptions-item label="盘亏成本">¥11.2</a-descriptions-item>
-            <a-descriptions-item>
-              <template slot="label">
-                盈亏总数量
-                <a-popover>
-                  <template slot="content">
-                    盘盈数量与盘亏数量之和
-                  </template>
-                  <a-icon type="question-circle" theme="twoTone" />
-                </a-popover>
-              </template>
-              4
-            </a-descriptions-item>
-            <a-descriptions-item>
-              <template slot="label">
-                盈亏总成本
-                <a-popover>
-                  <template slot="content">
-                    盘盈成本与盘亏成本之和
-                  </template>
-                  <a-icon type="question-circle" theme="twoTone" />
-                </a-popover>
-              </template>
-              4
-            </a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <!-- 产品明细 -->
-    <a-card size="small" :bordered="false" class="inventoryReviewDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="产品明细">
-          <!-- 列表 -->
-          <s-table
-            class="sTable"
-            ref="table"
-            size="default"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :data="loadData"
-            :scroll="{ x: 1290 }"
-            bordered>
-            <!-- 采购数量 -->
-            <template slot="purchaseNum" slot-scope="text, record">
-              <span>{{ record.purchaseNum }}</span>
-            </template>
-            <!-- 缺货数量 -->
-            <template slot="outOfStockNum" slot-scope="text, record">
-              <span>{{ record.outOfStockNum }}</span>
-            </template>
-          </s-table>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-  </div>
-</template>
-
-<script>
-import { STable, VSelect } from '@/components'
-export default {
-  components: { STable, VSelect },
-  data () {
-    return {
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 160, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
-        { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center' },
-        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'qtsy', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存成本', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盘点数量', dataIndex: 'qtssy', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盘点盈亏数量', dataIndex: 'qtdsy', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盘点盈亏成本', dataIndex: 'prifce', width: 120, 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', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
-          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)
-        })
-      }
-    }
-  },
-  methods: {
-    //  返回列表
-    handleBack () {
-      this.$router.push({ path: '/financialManagement/inventoryReview/list' })
-    }
-  }
-}
-</script>
-
-<style lang="less">
-  .inventoryReviewDetail-wrap{
-    .inventoryReviewDetail-cont{
-      margin-bottom: 15px;
-    }
-    .green{
-      color: #19be6b;
-    }
-    .red{
-      color: #ed1c24;
-    }
-  }
-</style>

+ 0 - 174
src/views/financialManagement/inventoryReview/list.vue

@@ -1,174 +0,0 @@
-<template>
-  <a-card size="small" :bordered="false" class="inventoryReviewList-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="inventoryReviewList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入盘点单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="盘点审核时间">
-              <a-range-picker v-model="queryParam.creatDate" id="inventoryReviewList-creatDate"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="财务审核状态">
-              <v-select
-                v-model="queryParam.billStatus"
-                ref="billStatus"
-                id="inventoryReviewList-billStatus"
-                code="PAYMENT_TYPE"
-                placeholder="请选择财务审核状态"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <span class="table-page-search-submitButtons">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryReviewList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="inventoryReviewList-reset">重置</a-button>
-            </span>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- alert -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">共 <strong>6</strong> 条记录,其中待审核 <strong>14</strong> 条 </div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1300 }"
-      bordered>
-      <!-- 采购单号 -->
-      <template slot="purchaseNo" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;">{{record.purchaseNo}}</span>
-      </template>
-      <!-- 采购入库单号 -->
-      <template slot="purchaseNos" slot-scope="text, record">
-        <span style="color: #ed1c24;cursor: pointer;">{{record.purchaseNo}}</span>
-      </template>
-      <!-- 状态 -->
-      <template slot="state" slot-scope="text, record">
-        <span>{{record.state == 1 ? '已启用' : '已禁用'}}</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="handleExamine(record, 1)" id="inventoryReview-adopt-btn">通过</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleExamine(record, 2)" id="inventoryReview-unadopt-btn">不通过</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDetail(record)" id="inventoryReview-detail-btn">详情</a-button>
-      </template>
-    </s-table>
-  </a-card>
-</template>
-
-<script>
-import { STable, VSelect } from '@/components'
-// import { getRoleList, getServiceList } from '@/api/manage'
-export default {
-  components: { STable, VSelect },
-  data () {
-    return {
-      disabled: false, //  查询、重置按钮是否可操作
-      // 查询参数
-      queryParam: {},
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '盘点单号', scopedSlots: { customRender: 'purchaseBillNo' }, align: 'center' },
-        { title: '盘点产品款数', dataIndex: 'totalCategory', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存总成本', dataIndex: 'totalAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盘盈总数量', dataIndex: 'totalQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盘亏总数量', dataIndex: 'totalssQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盘点审核时间', dataIndex: 'sauditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '财务审核状态', scopedSlots: { customRender: 'auditStatus' }, width: 120, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 190, align: 'center', fixed: 'right' }
-      ],
-      // 加载数据方法 必须为 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', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
-          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)
-        })
-      },
-    }
-  },
-  methods: {
-    //  详情
-    handleDetail(row){
-      this.$router.push({ path: `/financialManagement/inventoryReview/detail/${row.id}`})
-    },
-    //  审核
-    handleExamine(row, type){
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '操作后不可恢复,确定要进行'+ (type==1 ? ' 通过 ' : ' 不通过 ') +'操作吗?',
-        centered: true,
-        onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
-        }
-      })
-    },
-    //  重置
-    resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
-      this.$refs.table.refresh(true)
-    },
-  }
-}
-</script>
-<style lang="less">
-  .inventoryReviewList-wrap{
-    .sTable{
-      margin-top: 15px;
-    }
-  }
-</style>

+ 44 - 42
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -10,18 +10,24 @@
     width="80%">
     <!-- 合计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">现有库存总数量(个):<strong>998</strong>;现有库存总成本(¥):<strong>2009.00</strong>。</div>
+      <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ currentStock.currentQty || 0 }}</strong>;现有库存总成本(¥):<strong>{{ currentStock.putCost || 0 }}</strong>。</div>
     </a-alert>
     <!-- 库存详情 -->
     <s-table
+      v-if="openModal"
       class="sTable"
       ref="table"
-      size="default"
+      size="small"
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1220 }"
+      :scroll="{ x: 1580 }"
       bordered>
+      <!-- 库存数量 -->
+      <template slot="currentQty" slot-scope="text, record">
+        {{ (record.currentQty + record.freezeQty) || 0 }}
+        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
+      </template>
     </s-table>
     <div class="btn-cont">
       <a-button id="inventoryQueryDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
@@ -31,6 +37,7 @@
 
 <script>
 import { STable } from '@/components'
+import { stockDetailList, stockDetailCount } from '@/api/stock'
 export default {
   name: 'InventoryQueryDetailModal',
   components: { STable },
@@ -55,49 +62,52 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productNum', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOldNum', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库时间', dataIndex: 'productBrand', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'productType', width: 100, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'productTypes', width: 100, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '入库类型', dataIndex: 'productTypess', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'inventoryNum', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本单价', dataIndex: 'inventoryMoney', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库时间', dataIndex: 'putTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量', scopedSlots: { customRender: 'currentQty' }, width: 180, align: 'center' },
+        { title: '成本单价', dataIndex: 'putCost', width: 100, 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' }
-            ]
-          }
+        return stockDetailList(Object.assign(parameter, { stockSn: this.itemId })).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.getTotal(Object.assign(parameter, { stockSn: this.itemId }))
+          console.log(data)
+          return data
         })
+      },
+      currentStock: { // 合计信息
+        currentQty: '',
+        putCost: ''
       }
     }
   },
   methods: {
-
+    // 合计
+    getTotal (param) {
+      stockDetailCount(param).then(res => {
+        if (res.status == 200 && res.data) {
+          this.currentStock = res.data
+        } else {
+          this.currentStock = { // 合计信息
+            currentQty: '',
+            putCost: ''
+          }
+        }
+      })
+    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -109,14 +119,6 @@ export default {
       if (!newValue) {
         this.$emit('close')
       }
-    },
-    itemId (newValue, oldValue) {
-      if (this.isShow && newValue) {
-        const _this = this
-        setTimeout(() => {
-          _this.$refs.table.refresh(true)
-        }, 100)
-      }
     }
   }
 }
@@ -125,8 +127,8 @@ export default {
 <style lang="less">
   .inventoryQueryDetail-modal{
     .btn-cont {
-    	text-align: center;
-    	margin: 35px 0 10px;
+      text-align: center;
+      margin: 35px 0 10px;
     }
   }
 </style>

+ 159 - 57
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -6,7 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="产品编码">
-              <a-input id="inventoryQueryList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              <a-input id="inventoryQueryList-productCode" v-model="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -14,7 +14,7 @@
               <a-input id="inventoryQueryList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="24">
+          <a-col :md="5" :sm="24">
             <a-form-item label="产品名称">
               <a-input id="inventoryQueryList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
             </a-form-item>
@@ -22,33 +22,49 @@
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品品牌">
-                <a-select id="inventoryQueryList-brandName" placeholder="请选择产品品牌" allowClear v-model="queryParam.brandName">
-                  <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
+                <a-select
+                  placeholder="请选择产品品牌"
+                  id="inventoryQueryList-brandSn"
+                  allowClear
+                  v-model="queryParam.brandSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in brandData" :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 :options="typeData" placeholder="请选择产品类别" allowClear v-model="queryParam.productTypeName" />
+              <a-form-item label="产品分类">
+                <a-cascader
+                  :options="typeData"
+                  expand-trigger="hover"
+                  :field-names="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                  placeholder="请选择产品分类"
+                  allowClear
+                  v-model="productTypeSn"
+                  @change="changeType" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="库存数量是否为0">
-                <a-switch checkedChildren="是" unCheckedChildren="否" id="inventoryQueryList-currentStockQty" v-model="queryParam.currentStockQty" />
+              <a-form-item label="库存情况">
+                <a-select placeholder="请选择库存情况" id="inventoryQueryList-zeroQtyFlag" allowClear v-model="queryParam.zeroQtyFlag">
+                  <a-select-option v-for="item in zeroQtyData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
           </template>
-          <a-col :md="6" :sm="24">
+          <a-col :md="7" :sm="24">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
             <a-button
-              style="margin-left: 8px"
-              type="danger"
+              type="primary"
+              class="button-warning"
               @click="handleExport"
               :disabled="disabled"
               :loading="exportLoading"
               id="inventoryQueryList-export">导出</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
+            <a @click="advanced=!advanced" style="margin-left: 5px">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
             </a>
@@ -58,7 +74,7 @@
     </div>
     <!-- 合计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">现有库存总数量(个):<strong>998</strong>;现有库存总成本(¥):<strong>2009.00</strong>。</div>
+      <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ currentStock.currentStockQty || 0 }}</strong>;现有库存总成本(¥):<strong>{{ currentStock.currentStockCost || 0 }}</strong>。</div>
     </a-alert>
     <!-- 列表 -->
     <s-table
@@ -68,13 +84,22 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1370 }"
+      :scroll="{ x: 1630, y: tableHeight }"
       bordered>
+      <!-- 产品分类 -->
+      <template slot="productTypeName" slot-scope="text, record">
+        <span v-if="record.productTypeName2">{{ record.productTypeName2 || '' }} ></span>
+        <span v-if="record.productTypeName3">{{ record.productTypeName3 || '' }}</span>
+      </template>
+      <!-- 现有库存数量 -->
+      <template slot="currentStockQty" slot-scope="text, record">
+        {{ (record.currentStockQty + record.freezeQty) || 0 }}
+        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
+      </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="goDetail(record)" id="inventoryQueryList-detail-btn">库存详情</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" style="margin-left: 8px" @click="goWarehouseDetail(record)" id="inventoryQueryList-warehouseDetail-btn">出入库明细</a-button>
+        <a-button size="small" type="link" class="button-success" @click="goDetail(record)" id="inventoryQueryList-detail-btn">库存详情</a-button>
+        <a-button size="small" type="link" class="button-warning" @click="goWarehouseDetail(record)" id="inventoryQueryList-warehouseDetail-btn">出入库明细</a-button>
       </template>
     </s-table>
     <!-- 库存详情 -->
@@ -84,85 +109,122 @@
 
 <script>
 import moment from 'moment'
-import { stockList } from '@/api/stock'
-import { STable } from '@/components'
+import { stockList, stockCount } from '@/api/stock'
+import { dealerProductTypeList } from '@/api/dealerProductType'
+import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+import { STable, VSelect } from '@/components'
 import inventoryQueryDetailModal from './detailModal.vue'
 export default {
-  components: { STable, inventoryQueryDetailModal },
+  components: { STable, VSelect, inventoryQueryDetailModal },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
         productCode: '', //  产品编码
-        productOrigCode: '', //  原厂编码
         productName: '', //  产品名称
-        brandName: undefined, //  产品品牌
-        productTypeName: undefined, //  产品类别
-        currentStockQty: false //  库存数量是否为0
+        productOrigCode: '', //  原厂编码
+        brandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品分类1
+        productTypeSn2: '', //  产品分类2
+        productTypeSn3: '', //  产品分类3
+        zeroQtyFlag: undefined //  库存数量是否为0
       },
+      productTypeSn: [],
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
       brandData: [], //  产品品牌下拉数据
-      typeData: [], //  产品类别下拉数据
+      typeData: [], //  产品分类下拉数据
+      zeroQtyData: [ //  库存情况
+        { name: '库存数量为0', id: '1' },
+        { name: '库存数量不为0', id: '0' }
+      ],
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '最后入库时间', dataIndex: 'productCosde', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'brandName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '库存数量', dataIndex: 'productType', width: 140, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '库存成本(¥)', dataIndex: 'currentStockCost', width: 165, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { 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: 'productTypeName' }, width: 240, align: 'center' },
+        { title: '现有库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: 165, align: 'center', sorter: true },
+        { title: '现有库存成本(¥)', dataIndex: 'currentStockCost', width: 165, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        this.queryParam = {}
-        // return stockList( 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' }
-            ]
-          }
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 370
+        }
+        // 排序
+        if (parameter.sortField == 'currentStockQty') {
+          parameter.sortField = 'qty'
+          parameter.sortAlias = ''
+        }
+        if (parameter.sortField == 'currentStockCost') {
+          parameter.sortField = 'currentStockCost'
+          parameter.sortAlias = 'stock'
+        }
+        return stockList(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
-          resolve(data)
+          this.disabled = false
+          // 总计
+          this.getTotal(Object.assign(parameter, this.queryParam))
+          // 产品分类
+          if (this.typeData.length == 0) {
+            this.getProductType()
+          }
+          // 产品品牌
+          if (this.brandData.length == 0) {
+            this.getProductBrand()
+          }
+          return data
         })
       },
       openModal: false, //  查看库存详情  弹框
-      itemId: '' //  当前库存记录id
+      itemId: '', //  当前库存记录id
+      currentStock: { // 合计信息
+        currentStockQty: '',
+        currentStockCost: ''
+      }
     }
   },
   methods: {
     //  重置
     resetSearchForm () {
+      this.queryParam.brandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
       this.queryParam.productCode = ''
       this.queryParam.productOrigCode = ''
       this.queryParam.productName = ''
       this.queryParam.brandName = undefined
       this.queryParam.productTypeName = undefined
-      this.queryParam.currentStockQty = false
+      this.queryParam.zeroQtyFlag = undefined
+      this.productTypeSn = []
       this.$refs.table.refresh(true)
     },
+    // 合计
+    getTotal (param) {
+      stockCount(param).then(res => {
+        if (res.status == 200 && res.data) {
+          this.currentStock = res.data
+        } else {
+          this.currentStock = { // 合计信息
+            currentStockQty: '',
+            currentStockCost: ''
+          }
+        }
+      })
+    },
     //  库存详情
     goDetail (row) {
-      this.itemId = row.id
+      this.itemId = row.stockSn
       this.openModal = true
     },
     //  关闭弹框
@@ -172,7 +234,7 @@ export default {
     },
     //  出入库明细
     goWarehouseDetail (row) {
-      this.$router.push({ path: `/inventoryManagement/inventoryQuery/warehouseDetail/${row.id}` })
+      this.$router.push({ path: `/inventoryManagement/inventoryQuery/warehouseDetail/${row.productSn}` })
     },
     //  导出
     handleExport () {
@@ -194,6 +256,46 @@ export default {
       link.setAttribute('download', fname + '.xlsx')
       document.body.appendChild(link)
       link.click()
+    },
+    getProductType () {
+      dealerProductTypeList({}).then(res => {
+        this.recursionFun(res.data)
+        this.typeData = res.data
+      })
+    },
+    //  递归函数
+    recursionFun (data) {
+      if (data) {
+        data.map((item, index) => {
+          if (item.children && item.children.length == 0) {
+            delete item.children
+          } else {
+            this.recursionFun(item.children)
+          }
+        })
+      }
+    },
+    // 分类  changeType
+    changeType (val, selectedOptions) {
+      console.log(val, selectedOptions)
+      for (let i = 0; i < val.length; i++) {
+        this.queryParam['productTypeSn' + (i + 1)] = val[i]
+      }
+    },
+    //  产品品牌  列表
+    getProductBrand () {
+      dealerProductBrandQuery({}).then(res => {
+        if (res.status == 200) {
+          this.brandData = res.data
+        } else {
+          this.brandData = []
+        }
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
     }
   }
 }

+ 108 - 69
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="inventoryQueryWarehouseDetail-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="inventoryQueryWarehouseDetail-back">
+    <a-page-header :ghost="false" :backIcon="false" class="inventoryQueryWarehouseDetail-back">
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
-        <a id="inventoryQueryWarehouseDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
+        <a id="inventoryQueryWarehouseDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
       </template>
     </a-page-header>
     <a-card size="small" :bordered="false" class="inventoryQueryWarehouseDetail-cont">
@@ -13,22 +13,30 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="变动类型">
-                <a-select id="inventoryQueryWarehouseDetail-bundleNames" placeholder="请选择产品品牌" allowClear v-model="queryParam.brand">
-                  <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
-                </a-select>
+                <v-select
+                  v-model="queryParam.flowType"
+                  ref="flowType"
+                  id="warehousingAuditList-flowType"
+                  code="STOCK_FLOW_TYPE"
+                  placeholder="请选择变动类型"
+                  allowClear></v-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="单据类型">
-                <a-select id="inventoryQueryWarehouseDetail-bundleNames" placeholder="请选择产品品牌" allowClear v-model="queryParam.brand">
-                  <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
-                </a-select>
+                <v-select
+                  v-model="queryParam.bizType"
+                  ref="bizType"
+                  id="inventoryQueryWarehouseDetail-bizType"
+                  code="STOCK_FLOW_BIZ_TYPE"
+                  placeholder="请选择单据类型"
+                  allowClear></v-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="仓库">
-                <a-select id="inventoryQueryWarehouseDetail-bundleNames" placeholder="请选择产品品牌" allowClear v-model="queryParam.brand">
-                  <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
+                <a-select id="inventoryQueryWarehouseDetail-warehouseSn" placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
+                  <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
@@ -37,9 +45,9 @@
                 <a-form-item label="单据审核时间">
                   <a-range-picker
                     style="width:100%"
-                    id="inventoryQueryWarehouseDetail-bundleNamesss"
+                    id="inventoryQueryWarehouseDetail-createDate"
                     :disabledDate="disabledDate"
-                    v-model="queryParam.brand"
+                    v-model="createDate"
                     :format="dateFormat"
                     :placeholder="['开始时间', '结束时间']" />
                 </a-form-item>
@@ -47,7 +55,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="单位名称">
-                  <a-input id="inventoryQueryWarehouseDetail-orderBundleNo" v-model.trim="queryParam.orderBundleNo" allowClear placeholder="请输入单位名称"/>
+                  <a-input id="inventoryQueryWarehouseDetail-unitName" v-model.trim="queryParam.unitName" allowClear placeholder="请输入单位名称"/>
                 </a-form-item>
               </a-col>
             </template>
@@ -64,7 +72,7 @@
       </div>
       <!-- 合计 -->
       <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div class="ftext" slot="message">当前库存总数量(个):<strong>998</strong>;当前库存总成本(¥):<strong>2009.00</strong>。</div>
+        <div class="ftext" slot="message">当前库存总数量(个):<strong>{{ productTotal.stockQty }}</strong>;当前库存总成本(¥):<strong>{{ productTotal.stockCost }}</strong>。</div>
       </a-alert>
       <!-- 列表 -->
       <s-table
@@ -74,12 +82,11 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :showPagination="false"
         :scroll="{ x: 1760 }"
         bordered>
         <!-- 数量 -->
-        <template slot="number" slot-scope="text, record">
-          <span :class="[record.type == 1 ? 'green' : 'red']">{{ record.type == 1 ? '+' : '-' }}{{ record.number }}</span>
+        <template slot="qty" slot-scope="text, record">
+          <span :class="record.flowType=='PUT' ? 'green':'red'">{{ record.flowType=='PUT' ? '+':'-' }}{{ record.qty }}</span>
         </template>
       </s-table>
     </a-card>
@@ -87,72 +94,74 @@
 </template>
 
 <script>
-// import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
-import { STable } from '@/components'
+import moment from 'moment'
+import { STable, VSelect } from '@/components'
+import { stockFlowList } from '@/api/stockFlow'
+import { stockByProductSn } from '@/api/stock'
+import { warehouseAllList } from '@/api/warehouse'
 export default {
-  components: { STable },
+  components: { STable, VSelect },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
-        orderBundleNo: '', //  订单编号
-        orderBundle: {
-          custMobile: '' //  客户手机
-        },
-        bundleName: '', //  套餐名称
-        itemName: '', //  服务名称
-        brand: undefined, //  产品品牌
-        inventoryNum: false //  库存数量是否为0
+        bizType: undefined,
+        flowType: undefined,
+        unitName: '',
+        warehouseSn: undefined
       },
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
-      brandData: [], //  产品品牌下拉数据
-      typeData: [], //  产品类别下拉数据
+      createDate: [],
       dateFormat: 'YYYY-MM-DD',
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productNum', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOldNum', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库批次时间', dataIndex: 'prodsuctBrand', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据类型', dataIndex: 'productBdrand', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据审核时间', dataIndex: 'prodfuctBrand', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位名称', dataIndex: 'produhctBrand', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'productBrangd', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'productBjrand', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '数量', scopedSlots: { customRender: 'number' }, width: 100, align: 'center' },
-        { title: '总成本', dataIndex: 'inventoryMoney', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'inventoryMoneys', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '产品编码', dataIndex: 'product.code', width: 140, align: 'center', fixed: 'left', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'product.origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库批次时间', dataIndex: 'stockBatchNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位名称', dataIndex: 'unitName', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '数量', scopedSlots: { customRender: 'qty' }, width: 100, align: 'center' },
+        { title: '总成本', dataIndex: 'totalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总售价', dataIndex: 'totalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 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' }
-            ]
-          }
+        // 入库时间
+        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
+        }
+        const params = Object.assign(parameter, this.queryParam, { productSn: this.$route.params.sn })
+        return stockFlowList(params).then(res => {
+          const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
+            if (data.list[i].flowType == 'PUT') {
+              data.list[i].qty = data.list[i].putQty
+            } else if (data.list[i].flowType == 'OUT') {
+              data.list[i].qty = data.list[i].outQty
+            }
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          this.getTotal(params)
+          return data
         })
-      }
+      },
+      warehouseList: [], //  仓库  下拉数据
+      productTotal: {
+        stockQty: 0,
+        stockCost: 0
+      } //  合计
     }
   },
   methods: {
@@ -160,20 +169,50 @@ export default {
     disabledDate (date, dateStrings) {
       return date && date.valueOf() > Date.now()
     },
+    // 合计
+    getTotal (param) {
+      stockByProductSn(param).then(res => {
+        if (res.status == 200 && res.data) {
+          this.productTotal = {
+            stockQty: (Number(res.data.currentStockQty) + Number(res.data.freezeQty)) || 0,
+            stockCost: (Number(res.data.currentStockCost) + Number(res.data.freezeCost)) || 0
+          }
+        } else {
+          this.productTotal = {
+            stockQty: 0,
+            stockCost: 0
+          }
+        }
+      })
+    },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.bizType = undefined
+      this.queryParam.flowType = undefined
+      this.queryParam.unitName = ''
+      this.queryParam.warehouseSn = undefined
+      this.createDate = []
       this.$refs.table.refresh(true)
     },
     //  返回列表
     handleBack () {
       this.$router.push({ path: '/inventoryManagement/inventoryQuery/list' })
+    },
+    // 仓库下拉数据
+    getWarehouseList (type) {
+      warehouseAllList({}).then(res => {
+        if (res.status == 200) {
+          this.warehouseList = res.data
+        } else {
+          this.warehouseList = []
+        }
+      })
     }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getWarehouseList()
+    })
   }
 }
 </script>

+ 239 - 264
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -2,46 +2,67 @@
   <a-card size="small" :bordered="false" class="inventoryWarningList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form layout="inline" @keyup.enter.native="pageInit(1)">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="产品编码">
-              <a-input id="inventoryWarningList-orderBundleNo" v-model.trim="queryParam.orderBundleNo" allowClear placeholder="请输入产品编码"/>
+              <a-input id="inventoryWarningList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="原厂编码">
-              <a-input id="inventoryWarningList-custMobile" v-model.trim="queryParam.orderBundle.custMobile" allowClear placeholder="请输入原厂编码"/>
+              <a-input id="inventoryWarningList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="产品名称">
-              <a-input id="inventoryWarningList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品名称"/>
+              <a-input id="inventoryWarningList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
             </a-form-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品品牌">
-                <a-select id="inventoryWarningList-bundleNames" placeholder="请选择产品品牌" allowClear v-model="queryParam.brand">
-                  <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
+                <a-select
+                  placeholder="请选择产品品牌"
+                  id="inventoryWarningList-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 :options="typeData" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
+              <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="inventoryWarningList-productType"
+                  placeholder="请选择产品分类"
+                  allowClear />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="预警提示">
-                <a-select id="inventoryWarningList-bundleNames" placeholder="请选择预警提示" allowClear v-model="queryParam.brand">
-                  <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
-                </a-select>
+                <v-select
+                  v-model="queryParam.warnTip"
+                  ref="warnTip"
+                  id="inventoryWarningList-warnTip"
+                  code="STOCK_WARN_TIP"
+                  placeholder="请选择预警提示"
+                  allowClear
+                ></v-select>
               </a-form-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryWarningList-refresh">查询</a-button>
+            <a-button type="primary" @click="pageInit(1)" :disabled="disabled" id="inventoryWarningList-refresh">查询</a-button>
             <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryWarningList-reset">重置</a-button>
             <a-button
               style="margin-left: 8px"
@@ -60,90 +81,77 @@
     </div>
     <!-- 操作按钮 -->
     <div class="table-operator">
-      <a-button id="inventoryWarningList-update" type="primary" @click="handleupdate">批量更新</a-button>
+      <a-button type="primary" id="inventoryWarningList-update" :loading="loading" @click="handleupdate">批量更新</a-button>
+      <span style="margin-left: 8px">
+        <template v-if="hasSelected">{{ `已选 ${selectedRowKeys.length} 项` }}</template>
+      </span>
     </div>
     <!-- 列表 -->
     <a-table
       class="sTable"
       ref="table"
       size="default"
-      :rowKey="record => record.id"
+      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+      :rowKey="(record) => record.id"
       :columns="columns"
       :dataSource="loadData"
+      :scroll="{ x: 2120, y: tableHeight }"
       :pagination="paginationProps"
-      :loading="loadingPage"
-      :scroll="{ x: 1940 }"
       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="stockQty" slot-scope="text, record">
+        {{ record.currentStockQty + record.freezeQty }}
+        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
+      </template>
       <!-- 预警提示 -->
-      <template slot="warningTips" slot-scope="text, record">
-        <!-- 库存溢满:总库存数>最大库存数 -->
-        <span v-if="record.inventoryTotal > record.maxInventory" class="yellow">库存溢满</span>
-        <!-- 库存不足:总库存数<最小库存数 -->
-        <span v-if="record.inventoryTotal < record.minInventory" class="red">库存不足</span>
-        <!-- 库存缺货:当前库存数为0 -->
-        <span v-if="record.inventoryRealTime < 1" class="blue">库存缺货</span>
-        <!-- 库存正常:最小库存数≤总库存数≤最大库存数 -->
-        <span v-if="record.minInventory <= record.inventoryTotal <= record.maxInventory" class="green">库存正常</span>
+      <template slot="warnTip" slot-scope="text, record">
+        <span v-if="record.warnTipDictValue" :class="[record.warnTip=='OVERFLOW'?'yellow':record.warnTip=='NOT_ENOUGH'?'red':record.warnTip=='LACK'?'blue':record.warnTip=='NORMAL'?'green':'']">{{ record.warnTipDictValue }}</span>
+        <span v-else>--</span>
       </template>
-      <!-- 需要编辑的字段 -->
       <!-- 在途数 -->
-      <template slot="onWayNum" slot-scope="text, record" >
+      <template slot="inTransit" slot-scope="text, record" >
         <div>
           <a-input-number
-            v-if="record.editable"
-            id="inventoryWarningList-onWayNum"
-            :value="record.onWayNum"
+            id="inventoryWarningList-inTransit"
+            v-model="record.inTransit"
             :precision="0"
             :min="0"
-            :max="record.inventoryTotal-record.inventoryRealTime"
-            placeholder="请输入在途数"
-            @change="e => handleChange(e, record.id, 'onWayNum')" />
-          <template v-else> {{ record.onWayNum }} </template>
+            :max="999999"
+            placeholder="请输入在途数" />
         </div>
       </template>
       <!-- 最大库存数 -->
-      <template slot="maxInventory" slot-scope="text, record" >
+      <template slot="upperLimit" slot-scope="text, record" >
         <div>
           <a-input-number
-            v-if="record.editable"
-            id="inventoryWarningList-maxInventory"
-            :value="record.maxInventory"
+            id="inventoryWarningList-upperLimit"
+            v-model="record.upperLimit"
             :precision="0"
             :min="0"
             :max="999999"
-            placeholder="请输入最大库存数"
-            @change="e => handleChange(e, record.id, 'maxInventory')" />
-          <template v-else> {{ record.maxInventory }} </template>
+            placeholder="请输入最大库存数" />
         </div>
       </template>
       <!-- 最小库存数 -->
-      <template slot="minInventory" slot-scope="text, record" >
+      <template slot="lowerLimit" slot-scope="text, record" >
         <div>
           <a-input-number
-            v-if="record.editable"
-            id="inventoryWarningList-minInventory"
-            :value="record.minInventory"
+            id="inventoryWarningList-lowerLimit"
+            v-model="record.lowerLimit"
             :precision="0"
             :min="0"
             :max="999999"
-            placeholder="请输入最小库存数"
-            @change="e => handleChange(e, record.id, 'minInventory')" />
-          <template v-else> {{ record.minInventory }} </template>
+            placeholder="请输入最小库存数" />
         </div>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <div class="editable-row-operations">
-          <span v-if="record.editable">
-            <a-button size="small" type="primary" @click="() => save(record.id, record.onWayNum, record.maxInventory, record.minInventory)" style="margin-right: 10px;">保存</a-button>
-            <a-popconfirm title="确定要取消吗" @confirm="() => cancel(record.id)">
-              <a-button size="small">取消</a-button>
-            </a-popconfirm>
-          </span>
-          <span v-else>
-            <a-button size="small" type="link" :disabled="editingId !== ''" @click="() => edit(record.id)">编辑</a-button type="primary">
-          </span>
-        </div>
+        <a-button type="primary" size="small" class="button-info" @click="handleSave(record)" id="inventoryWarningList-add-btn">保存</a-button>
       </template>
     </a-table>
   </a-card>
@@ -151,121 +159,48 @@
 
 <script>
 import moment from 'moment'
-// import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
-import { STable } from '@/components'
+import { STable, VSelect } from '@/components'
+import { stockWarnList, stockWarnSaveBatch } from '@/api/stockWarn'
+import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+import { dealerProductTypeList } from '@/api/dealerProductType'
 export default {
-  components: { STable },
+  components: { STable, VSelect },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
-        orderBundleNo: '', //  订单编号
-        orderBundle: {
-          custMobile: '' //  客户手机
-        },
-        bundleName: '', //  套餐名称
-        itemName: '', //  服务名称
-        brand: undefined, //  产品品牌
-        inventoryNum: false //  库存数量是否为0
+        productCode: '',
+        productName: '',
+        productOrigCode: '', // 原厂编码
+        productBrandSn: undefined,
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined,
+        warnTip: undefined
       },
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
-      brandData: [], //  产品品牌下拉数据
-      typeData: [], //  产品类别下拉数据
+      productBrandList: [], //  产品品牌下拉数据
+      productTypeList: [], //  产品类别下拉数据
+      productType: [],
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'productNum', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '级别', dataIndex: 'productNasme', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOldNum', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productBrand', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', dataIndex: 'productType', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '实时库存数(个)', dataIndex: 'inventoryRealTime', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '在途数(个)', scopedSlots: { customRender: 'onWayNum' }, width: 130, align: 'center' },
-        { title: '总库存数(个)', dataIndex: 'inventoryTotal', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '最大库存数(个)', scopedSlots: { customRender: 'maxInventory' }, width: 130, align: 'center' },
-        { title: '最小库存数(个)', scopedSlots: { customRender: 'minInventory' }, width: 130, align: 'center' },
-        { title: '差异数量', dataIndex: 'variabilityMeasures', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '预警提示', scopedSlots: { customRender: 'warningTips' }, width: 100, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'brandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
+        { title: '实时库存数(个)', scopedSlots: { customRender: 'stockQty' }, width: 180, align: 'center' },
+        { title: '在途数(个)', scopedSlots: { customRender: 'inTransit' }, width: 130, align: 'center' },
+        { title: '总库存数(个)', dataIndex: 'totalStockQty', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '最大库存数(个)', scopedSlots: { customRender: 'upperLimit' }, width: 130, align: 'center' },
+        { title: '最小库存数(个)', scopedSlots: { customRender: 'lowerLimit' }, width: 130, align: 'center' },
+        { title: '差异数量', dataIndex: 'differenceNum', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '预警提示', scopedSlots: { customRender: 'warnTip' }, width: 100, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
-      // 加载数据方法 必须为 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: [
-      //         {
-      //           key: '1',
-      //           id: '1',
-      //           productNum: 'jgqp11111111111',
-      //           productName: '产品1',
-      //           productOldNum: 'jgqp111123545',
-      //           productBrand: '箭冠品牌',
-      //           productType: '产品分类1',
-      //           inventoryRealTime: 0,
-      //           inventoryMoney: '122',
-      //           onWayNum: 2,
-      //           inventoryTotal: 5,
-      //           maxInventory: 7,
-      //           minInventory: 1,
-      //           variabilityMeasures: 2
-      //         }
-      //       ]
-      //     }
-      //     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)
-      //   })
-      // },
-      loadData: [
-        {
-          id: 1,
-          productNum: 'jgqp11111111111',
-          productName: '产品1',
-          productOldNum: 'jgqp111123545',
-          productBrand: '箭冠品牌',
-          productType: '产品分类1',
-          inventoryRealTime: 2,
-          inventoryMoney: '122',
-          onWayNum: 2,
-          inventoryTotal: 5,
-          maxInventory: 7,
-          minInventory: 1,
-          variabilityMeasures: 2
-        },
-        {
-          id: 2,
-          productNum: 'jgqp11111111111',
-          productName: '产品1',
-          productOldNum: 'jgqp111123545',
-          productBrand: '箭冠品牌',
-          productType: '产品分类1',
-          inventoryRealTime: 2,
-          inventoryMoney: '122',
-          onWayNum: 2,
-          inventoryTotal: 5,
-          maxInventory: 7,
-          minInventory: 1,
-          variabilityMeasures: 2
-        }
-      ], //  列表数据
-      loadingPage: false, //  加载中
+      loadData: [],
       pageNo: 1, //  分页页码
       pageSize: 10, //  分页 每页多少条
       paginationProps: {
@@ -275,148 +210,181 @@ export default {
         onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
         onChange: (current) => this.changePage(current)
       },
-      openModal: false, //  查看库存详情  弹框
-      itemId: '', //  当前库存记录id
-      editingId: ''
+      selectedRowKeys: [],
+      selectedRows: [],
+      loading: false
+    }
+  },
+  computed: {
+    hasSelected () {
+      return this.selectedRowKeys.length > 0
     }
   },
   methods: {
     //  分页  一页多少条change
     changePageSize (current, pageSize) {
-      this.editingId = ''
       this.pageNo = current
       this.pageSize = pageSize
       this.pageInit()
     },
     //  分页 页码change
     changePage (current) {
-      this.editingId = ''
       this.pageNo = current
       this.pageInit()
     },
     //  列表数据
-    pageInit (pageNo, pageSize) {
+    pageInit (pageNo) {
+      if (this.tableHeight == 0) {
+        this.tableHeight = window.innerHeight - 380
+      }
+      this.disabled = true
       this.pageNo = pageNo || this.pageNo
-      this.pageSize = pageSize || this.pageSize
-      this.editingId = ''
-      // const params = {
-      //   storeId: this.searchForm.storeId,
-      //   itemId: this.searchForm.itemId,
-      //   itemType: this.searchForm.itemType,
-      //   pageNo: this.pageNo,
-      //   pageSize: this.pageSize
-      // }
-      this.loadingPage = true
-      // storeItemPriceList(params).then(res => {
-      //   if (res.status == 200) {
-      //     const data = res.data
-      //     this.paginationProps.total = 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
-      //       data.list[i].editable = false
-      //     }
-      //     this.loadData = data.list
-      //   } else {
-      //     this.loadData = []
-      //   }
-      //   this.loadingPage = false
-      // })
+      const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
+      stockWarnList(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 = []
+        }
+      })
+    },
+    //  保存
+    handleSave (row, isBatch) {
+      const params = []
+      if (isBatch) { //  批量更新
+        const dataInd = []
+        this.selectedRows.map((item, index) => {
+          if ((!item.inTransit && item.inTransit != 0) || (!item.upperLimit && item.upperLimit != 0) || (!item.lowerLimit && item.lowerLimit != 0)) {
+            dataInd.push(item.no)
+          }
+          params.push({
+            id: item.id,
+            inTransit: item.inTransit,
+            upperLimit: item.upperLimit,
+            lowerLimit: item.lowerLimit
+          })
+        })
+        if (dataInd.length > 0) {
+          let str = ''
+          dataInd.map(item => {
+            str += item + '、'
+          })
+          str = str.substr(0, str.length - 1)
+          this.$message.warning('请完善第' + str + '行数据后再提交')
+          return
+        }
+      } else { //  单个保存
+        if (!row.inTransit && row.inTransit != 0) {
+          this.$message.warning('请输入在途数')
+          return
+        }
+        if (!row.upperLimit && row.upperLimit != 0) {
+          this.$message.warning('请输入最大库存数')
+          return
+        }
+        if (!row.lowerLimit && row.lowerLimit != 0) {
+          this.$message.warning('请输入最小库存数')
+          return
+        }
+        params.push({
+          id: row.id,
+          inTransit: row.inTransit,
+          upperLimit: row.upperLimit,
+          lowerLimit: row.lowerLimit
+        })
+      }
+      stockWarnSaveBatch(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.pageInit()
+          this.selectedRowKeys = []
+          this.selectedRows = []
+        }
+      })
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      console.log('selectedRowKeys changed: ', selectedRowKeys, selectedRows)
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.productOrigCode = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.queryParam.warnTip = undefined
       this.pageInit(1)
     },
     //  批量更新
     handleupdate () {
+      if (this.selectedRowKeys.length < 1) {
+        this.$message.warning('请在列表勾选后再进行批量操作!')
+        return
+      }
       const _this = this
       this.$confirm({
         title: '提示',
         content: '确定提交批量更新的内容吗?',
         centered: true,
         onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          _this.handleSave('', 'batch')
         }
       })
     },
-    //  change
-    handleChange (value, id, column) {
-      const newData = [...this.loadData]
-      const target = newData.filter(item => id === item.id)[0]
-      if (target) {
-        target[column] = value
-        this.loadData = newData
-      }
+    //  产品分类  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] : ''
     },
-    //  编辑
-    edit (id) {
-      const newData = [...this.loadData]
-      const target = newData.filter(item => id === item.id)[0]
-      this.editingId = id
-      if (target) {
-        target.editable = true
-        this.loadData = newData
-      }
+    //  产品品牌  列表
+    getProductBrand () {
+      // sysFlag不传,此处应查询所有产品
+      dealerProductBrandQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productBrandList = res.data
+        } else {
+          this.productBrandList = []
+        }
+      })
     },
-    //  保存
-    save (id, onWayNum, maxInventory, minInventory) {
-      //  更改后的值是否为空
-      if (!onWayNum) {
-        this.$message.warning('在途数不能为空')
-        return
-      }
-      if (!maxInventory) {
-        this.$message.warning('最大库存数不能为空')
-        return
-      }
-      if (!minInventory) {
-        this.$message.warning('最小库存数不能为空')
-        return
-      }
-      // saveStoreItemPrice({
-      //   id: id,
-      //   accountPrice: accountPrice
-      // }).then(res => {
-      //   if (res.status == 200) {
-      this.editingId = ''
-      this.pageInit()
-      //   } else {
-      //     this.$message.warning(res.message)
-      //   }
-      // })
+    //  产品分类  列表
+    getProductType () {
+      dealerProductTypeList({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
     },
-    //  取消
-    cancel (id) {
-      const newData = [...this.loadData]
-      const target = newData.filter(item => id === item.id)[0]
-      this.editingId = ''
-      if (target) {
-        this.pageInit()
-      }
+    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)
-      })
+      // customerBundleExportDelay(params).then(res => {
+      //   this.exportLoading = false
+      //   this.download(res)
+      // })
     },
     //  下载
     download (data) {
@@ -431,6 +399,13 @@ export default {
       document.body.appendChild(link)
       link.click()
     }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.pageInit(1)
+      vm.getProductType()
+      vm.getProductBrand()
+    })
   }
 }
 </script>

+ 123 - 91
src/views/inventoryManagement/warehouseAllocation/basicInfoModal.vue

@@ -1,99 +1,131 @@
 <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 label="调出仓库" prop="sort">
-				<v-select
-					v-model="form.billStatus"
-					ref="billStatus"
-					id="warehouseAllocation-basicInfo-billStatus"
-					code="PAYMENT_TYPE"
-					placeholder="请选择调出仓库"
-					allowClear
-				></v-select>
-			</a-form-model-item>
-			<a-form-model-item label="调入仓库" prop="sort">
-				<v-select
-					v-model="form.billStatus"
-					ref="billStatus"
-					id="warehouseAllocation-basicInfo-billStatus"
-					code="PAYMENT_TYPE"
-					placeholder="请选择调入仓库"
-					allowClear
-				></v-select>
-			</a-form-model-item>
-			<a-form-model-item label="关联单号" prop="address">
-				<a-input id="warehouseAllocation-basicInfo-address" :maxLength="30" v-model="form.address" placeholder="请输入关联单号(最多30个字符)" allowClear />
-			</a-form-model-item>
-			<a-form-model-item label="备注" prop="remarks">
-				<a-textarea id="warehouseAllocation-basicInfo-remarks" :maxLength="500" v-model="form.remarks" placeholder="请输入备注(最多500个字符)" 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>
+  <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 { 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
-		}
-	},
-	data() {
-		return {
-			isShow: this.openModal, //  是否打开弹框
-			formItemLayout: {
-				labelCol: { span: 6 },
-				wrapperCol: { span: 16 }
-			},
-			form: {
-				name: '', // 仓库名称
-				sort: '' //  排序
-			},
-			rules: {
-				name: [{ required: true, message: '请输入仓库名称', trigger: 'blur' }]
-			},
-			brandData: [] //  供应商  下拉数据
-		};
-	},
-	methods: {
-		//  保存
-		handleSave() {
-			this.isShow = false
-			this.$emit('ok')
-		},
-		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')
-			}
-		}
-	}
-};
+  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">

+ 69 - 20
src/views/inventoryManagement/warehouseAllocation/detail.vue

@@ -1,9 +1,19 @@
 <template>
   <div class="warehouseAllocationDetail-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="warehouseAllocationDetail-back">
+    <a-page-header :ghost="false" :backIcon="false" class="warehouseAllocationDetail-back" >
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
-        <a id="warehouseAllocationDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
+        <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">
@@ -17,13 +27,12 @@
       <a-collapse :activeKey="['1']">
         <a-collapse-panel key="1" header="基础信息">
           <a-descriptions :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="审核状态">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="完结状态">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="备注">箭冠营销中心</a-descriptions-item>
+            <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>
@@ -31,13 +40,13 @@
     <a-card size="small" :bordered="false" class="warehouseAllocationDetail-cont">
       <!-- 总计 -->
       <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">总款数: <strong>6</strong> ,总数量: <strong>6</strong> ,总成本:¥<strong>6.33</strong></div>
+        <div slot="message">总款数: <strong>{{ productTotalCategory }}</strong> ,总数量: <strong>{{ productTotalQty }}</strong> ,总成本:¥<strong>{{ productTotalCost }}</strong></div>
       </a-alert>
       <!-- 列表 -->
       <s-table
         class="sTable"
         ref="table"
-        size="default"
+        size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
@@ -62,8 +71,9 @@
 </template>
 
 <script>
-import { allocWarehouseDetailList } from '@/api/allocWarehouse'
+import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import { allocWarehouseDetailSn, allocWarehouseDetailCount, allocWarehouseDetailList } from '@/api/allocWarehouse.js'
 export default {
   components: { STable, VSelect },
   data () {
@@ -72,6 +82,11 @@ export default {
       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' },
@@ -93,11 +108,8 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
-            const productTypeName1 = data.list[i].productTypeName1 ? data.list[i].productTypeName1 : ''
-            const productTypeName2 = data.list[i].productTypeName2 ? ' > ' + data.list[i].productTypeName2 : ''
-            const productTypeName3 = data.list[i].productTypeName3 ? ' > ' + data.list[i].productTypeName3 : ''
-            data.list[i].productTypeName = productTypeName1 + productTypeName2 + productTypeName3
           }
+          this.getProduceTotal()
           this.disabled = false
           return data
         })
@@ -109,14 +121,43 @@ export default {
     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)
-      })
+      // customerBundleExportDelay(params).then(res => {
+      //   this.exportLoading = false
+      //   this.download(res)
+      // })
     },
     download (data) {
       if (!data) { return }
@@ -130,6 +171,14 @@ export default {
       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>

+ 420 - 196
src/views/inventoryManagement/warehouseAllocation/edit.vue

@@ -1,9 +1,11 @@
 <template>
   <div class="warehouseAllocationEdit-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="warehouseAllocationEdit-back">
+    <a-page-header :ghost="false" :backIcon="false" class="warehouseAllocationEdit-back" >
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
-        <a id="warehouseAllocationEdit-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
+        <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">
@@ -11,85 +13,68 @@
         <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">
-          <template slot="header">
-            基础信息
-            <a-button
-              type="primary"
-              shape="circle"
-              size="small"
-              icon="edit"
-              class="edit-circle-btn"
-              id="warehouseAllocationEdit-circle-btn"
-              @click.stop="handleEditInfo" />
-          </template>
-          <a-descriptions :column="3">
-            <a-descriptions-item label="调出仓库">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="调入仓库">箭冠营销中心</a-descriptions-item>
-          </a-descriptions>
-        </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="选择产品">
           <!-- 筛选条件 -->
           <div class="table-page-search-wrapper">
-            <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-form layout="inline" @keyup.enter.native="getProductList(1)">
               <a-row :gutter="15">
                 <a-col :md="6" :sm="24">
-                  <a-form-item label="产品编码" prop="name">
-                    <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入产品编码" allowClear />
+                  <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="name">
-                    <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入产品名称" allowClear />
+                  <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="name">
-                    <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入原厂编码" allowClear />
+                  <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-state"
+                        placeholder="请选择产品品牌"
+                        id="warehouseAllocationEdit-brandSn"
                         allowClear
-                        v-model="queryParam.dataSourceNo"
+                        v-model="queryParam.brandSn"
                         :showSearch="true"
                         option-filter-prop="children"
                         :filter-option="filterOption">
-                        <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+                        <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 :options="typeData" id="warehouseAllocationEdit-state" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
+                    <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="调出仓位">
-                      <v-select
-                        v-model="queryParam.billStatus"
-                        ref="billStatus"
-                        id="warehouseAllocationEdit-billStatus"
-                        code="PAYMENT_TYPE"
-                        placeholder="请选择调出仓位"
-                        allowClear></v-select>
+                    <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="$refs.table.refresh(true)" :disabled="disabled" id="warehouseAllocationList-refresh">查询</a-button>
+                  <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 ? '收起' : '展开' }}
@@ -100,36 +85,45 @@
             </a-form>
           </div>
           <!-- 列表 -->
-          <s-table
+          <a-table
             class="sTable"
             ref="table"
-            size="default"
-            :rowKey="(record) => record.id"
+            size="small"
+            :rowKey="(record) => record.stockSn+record.productSn+record.warehouseSn+record.warehouseLocationSn"
             :columns="columns"
-            :data="loadData"
-            :scroll="{ x: 1560 }"
+            :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="storageQuantity" slot-scope="text, record">
-              <a-select id="warehouseAllocationEdit-warehouse" placeholder="请选择" allowClear v-model="record.warehouse" style="width: 100%;">
-                <a-select-option v-for="item in typeData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+            <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="transferOutQuantity" slot-scope="text, record">
+            <template slot="outQty" slot-scope="text, record">
               <a-input-number
-                id="warehouseAllocationEdit-storageQuantity"
-                :value="record.storageQuantity"
+                id="warehouseAllocationEdit-outQty"
+                v-model="record.outQty"
                 :precision="0"
-                :min="0"
-                :max="999999"
-                placeholder="请输入" />
+                :min="1"
+                :max="record.currentQty"
+                placeholder="请输入"
+                style="width: 100%;" />
             </template>
             <!-- 操作 -->
             <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="link" @click="handleAdd(record)" id="warehouseAllocationEdit-add-btn">添加</a-button>
+              <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="warehouseAllocationEdit-add-btn">添加</a-button>
             </template>
-          </s-table>
+            </s-table>
+          </a-table>
         </a-collapse-panel>
       </a-collapse>
     </a-card>
@@ -139,213 +133,314 @@
         <a-collapse-panel key="1" header="已选产品">
           <!-- 总计 -->
           <a-alert type="info" showIcon style="margin-bottom:15px">
-            <div slot="message">总成本:¥<strong>6.33</strong>,总数量: <strong>6</strong> ,总款数: <strong>6</strong> </div>
+            <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
           </a-alert>
           <!-- 筛选条件 -->
           <a-row :gutter="15" justify="space-between">
             <a-col :span="17">
               <div class="table-page-search-wrapper">
-                <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
+                <a-form layout="inline" @keyup.enter.native="getChooseProductList(1)">
                   <a-row :gutter="15">
                     <a-col :md="9" :sm="24">
-                      <a-form-item label="产品编码" prop="name">
-                        <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入产品编码" allowClear />
+                      <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="name">
-                        <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入产品名称" allowClear />
+                      <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="$refs.chooseTable.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-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" type="primary" id="warehouseAllocationEdit-pladd-btn" style="margin-bottom: 8px;">批量添加</a-button>
-              <a-button size="small" id="warehouseAllocationEdit-import-btn" style="margin-left: 8px">导入明细</a-button>
-              <a-button size="small" type="danger" id="warehouseAllocationEdit-del-all-btn" style="margin: 0 0 8px 8px;">整单删除</a-button>
+              <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>
           <!-- 列表 -->
-          <s-table
+          <a-table
             class="sTable"
             ref="chooseTable"
-            size="default"
+            size="small"
             :rowKey="(record) => record.id"
             :columns="chooseColumns"
-            :data="chooseLoadData"
-            :scroll="{ x: 1460 }"
+            :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="storageQuantity" slot-scope="text, record">
-              <a-select id="warehouseAllocationEdit-warehouse" placeholder="请选择" allowClear v-model="record.warehouse" style="width: 100%;">
-                <a-select-option v-for="item in typeData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+            <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="transferOutQuantity" slot-scope="text, record">
+            <template slot="outQty" slot-scope="text, record">
               <a-input-number
-                id="warehouseAllocationEdit-storageQuantity"
-                :value="record.storageQuantity"
+                id="warehouseAllocationEdit-outQty"
+                v-model="record.outQty"
                 :precision="0"
-                :min="0"
+                :min="1"
                 :max="999999"
-                placeholder="请输入" />
+                placeholder="请输入"
+                @blur="e => outQtyBlur(e.target.value, record)"
+                style="width: 100%;" />
             </template>
             <!-- 操作 -->
             <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="link" @click="handleDel(record)" id="warehouseAllocationEdit-del-btn">删除</a-button>
+              <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="warehouseAllocationEdit-del-btn">删除</a-button>
             </template>
-          </s-table>
+          </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: 30px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button type="primary" id="warehouseAllocationEdit-submit" size="large" @click="handleSubmit" style="padding: 0 60px;">提交</a-button>
+      <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>
-    <!-- 选择基本信息弹框 -->
-    <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
   </div>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
-import basicInfoModal from './basicInfoModal.vue'
+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, basicInfoModal },
+  components: { STable, VSelect },
   data () {
     return {
       queryParam: {
-
+        productCode: '',
+        productName: '',
+        productOrigCode: '', // 原厂编码
+        brandSn: undefined,
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined,
+        warehouseLocationSn: undefined // 调出仓位
+      },
+      chooseQueryParam: {
+        productCode: '',
+        productName: ''
       },
-      brandData: [], //  产品品牌  下拉数据
-      typeData: [], //  产品类别  下拉数据
       disabled: false, //  查询、重置按钮是否可操作
+      chooseDisabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
+      productBrandList: [], //  产品品牌  下拉数据
+      productTypeList: [], //  产品分类  下拉数据
+      productType: [],
+      warehousePutLocData: [], //  调入仓位  下拉数据
+      warehouseOutLocData: [], //  调出仓位  下拉数据
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'creatDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'custNahme', width: 200, align: 'center', ellipsis: true },
-        { title: '原厂编码', dataIndex: 'totalP', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'custsNsame', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '类别', dataIndex: 'custsNdame', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出仓位', dataIndex: 'custsNafme', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调入仓位', scopedSlots: { customRender: 'storageQuantity' }, width: 140, align: 'center' },
-        { title: '库存数量', dataIndex: 'custsNagme', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'custsNsagme', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出数量', scopedSlots: { customRender: 'transferOutQuantity' }, width: 140, 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' }
       ],
-      // 加载数据方法 必须为 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', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
-          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)
-        })
+      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: 'creatDaite', width: 140, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'custNayme', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'custNdayme', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'mementPsay', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '类别', dataIndex: 'mementPay', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出仓位', scopedSlots: { customRender: 'storageQuantity' }, width: 140, align: 'center' },
-        { title: '调入仓位', dataIndex: 'custsNakme', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'custssNakme', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出数量', scopedSlots: { customRender: 'transferOutQuantity' }, width: 140, 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' }
       ],
-      // 加载数据方法 必须为 Promise 对象
-      chooseLoadData: 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', purchaseNo: 'jgqp11111111111', custssName: 0, creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
-          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)
-        })
+      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 // 选择基本信息弹框是否显示
+      basicInfoData: null, //  基本信息
+      productTotal: null //  合计
     }
   },
   methods: {
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
-      this.$refs.table.refresh(true)
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.productOrigCode = ''
+      this.queryParam.brandSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.queryParam.warehouseLocationSn = undefined
+      this.productType = []
+      this.getProductList(1)
     },
-    //  添加
-    handleAdd (row) {},
-    //  删除
-    handleDel (row) {},
-    //  编辑基本信息
-    handleEditInfo () {
-      this.openModal = true
+    // 双击快速添加
+    handleClickRow (record) {
+      return {
+        on: {
+          dblclick: (event) => {
+            this.handleAdd(record)
+          }
+        }
+      }
     },
-    //  基本信息  保存
-    handleOk () {
-
+    // 已选产品  重置
+    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 () {},
+    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)
@@ -354,15 +449,144 @@ export default {
     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
-      	)
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.openModal = false
+      vm.getDetail()
+      vm.getProductList(1)
+      vm.getChooseProductList(1)
+      vm.getProductBrand()
+      vm.getProductType()
     })
   }
 }

+ 113 - 84
src/views/inventoryManagement/warehouseAllocation/list.vue

@@ -2,113 +2,129 @@
   <a-card size="small" :bordered="false" class="warehouseAllocationList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <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-creatDate"
+                id="warehouseAllocationList-createDate"
                 :disabledDate="disabledDate"
-                v-model="creatDate"
+                v-model="createDate"
                 :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
-            </a-form-item>
+                :placeholder="['开始时间', '结束时间']"
+              />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="调出仓库">
-              <v-select
-                v-model="queryParam.outWarehouseName"
-                ref="outWarehouseName"
-                id="warehouseAllocationList-outWarehouseName"
-                code="PAYMENT_TYPE"
-                placeholder="请选择调出仓库"
-                allowClear></v-select>
+              <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="调入仓库">
-              <v-select
-                v-model="queryParam.putWarehouseName"
-                ref="putWarehouseName"
-                id="warehouseAllocationList-putWarehouseName"
-                code="PAYMENT_TYPE"
-                placeholder="请选择调入仓库"
-                allowClear></v-select>
+              <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="单据状态">
+              <a-form-item label="业务状态">
                 <v-select
                   v-model="queryParam.state"
                   ref="state"
                   id="warehouseAllocationList-state"
-                  code="PAYMENT_TYPE"
-                  placeholder="请选择单据状态"
-                  allowClear></v-select>
+                  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">
+            <a @click="advanced = !advanced" style="margin-left: 8px">
               {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
+              <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" @click="handleEdit()">新增仓库调拨单</a-button>
-    </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"
+      :rowKey="record => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1435 }"
+      :scroll="{ x: 1500, y: tableHeight }"
       bordered>
-      <!-- 状态 -->
-      <template slot="state" slot-scope="text, record">
-        <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '待提交': '待审核' }}</a-tag>
+      <!-- 单号 -->
+      <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 size="small" type="link" @click="handleExamine(record)" id="warehouseAllocationList-examine-btn">审核</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleEdit(record)" id="warehouseAllocationList-edit-btn">编辑</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDetail(record)" id="warehouseAllocationList-detail-btn">详情</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDel(record)" id="warehouseAllocationList-del-btn">删除</a-button>
+        <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="handleOk" @close="openModal=false" />
+    <basic-info-modal :openModal="openModal" @ok="handleEdit" @close="openModal=false" />
   </a-card>
 </template>
 
 <script>
-import { allocWarehouseList } from '@/api/allocWarehouse'
+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, // 高级搜索 展开/关闭
-      creatDate: undefined, //  创建时间
+      tableHeight: 0,
+      createDate: undefined, //  创建时间
+      warehouseList: [], // 仓库列表
       queryParam: { //  查询条件
-        outWarehouseName: undefined, //  调出仓库
-        putWarehouseName: undefined, //  调入仓库
+        outWarehouseSn: undefined, //  调出仓库
+        putWarehouseSn: undefined, //  调入仓库
         state: undefined //  审核状态
       },
       disabled: false, //  查询、重置按钮是否可操作
@@ -116,20 +132,30 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '单号', dataIndex: 'allocationWarehouseNo', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { 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: '状态', scopedSlots: { customRender: 'state' }, width: 100, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 215, align: 'center', fixed: 'right' }
+        { 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
-        this.queryParam = {}
+        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
@@ -140,8 +166,7 @@ export default {
           return data
         })
       },
-      openModal: false, //  新增编辑  弹框
-      itemId: '' //  当前品牌id
+      openModal: false //  新增编辑  弹框
     }
   },
   methods: {
@@ -149,18 +174,24 @@ export default {
     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.outWarehouseName = undefined
-      this.queryParam.putWarehouseName = undefined
+      this.queryParam.outWarehouseSn = undefined
+      this.queryParam.putWarehouseSn = undefined
       this.queryParam.state = undefined
-      this.creatDate = undefined
+      this.createDate = undefined
       this.$refs.table.refresh(true)
     },
-    //  基本信息  保存
-    handleOk () {
-      this.$router.push({ path: `/allocationManagement/warehouseAllocation/add` })
-    },
     //  删除
     handleDel (row) {
       const _this = this
@@ -169,51 +200,49 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          allocWarehouseDel({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
     },
     //  审核
-    handleExamine () {
+    handleExamine (row) {
       const _this = this
       this.$confirm({
         title: '提示',
         content: '确认要审核通过吗?',
         centered: true,
         onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          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.id}/${row.allocationWarehouseSn}` })
+      this.$router.push({ path: `/allocationManagement/warehouseAllocation/detail/${row.allocationWarehouseSn}` })
     },
     //  新增/编辑
     handleEdit (row) {
-      // if(row){  //  编辑
-      //   this.$router.push({ path: `/allocationManagement/warehouseAllocation/edit/${row.id}` })
-      // }else{  //  新增
-      //   this.$router.push({ path: '/allocationManagement/warehouseAllocation/add' })
-      // }
-      this.openModal = true
+      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>

+ 8 - 0
src/views/setting/announcementManagement/list.vue

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

+ 8 - 0
src/views/supplierManagement/associatedProductDetails/list.vue

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

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.