Browse Source

仓库调拨修改

1004749546@qq.com 4 years ago
parent
commit
65e870e79d

+ 79 - 0
src/api/allocWarehouse.js

@@ -22,3 +22,82 @@ export const allocWarehouseDetailList = (params) => {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
+// 审核
+export const allocWarehouseAudit = params => {
+  return axios({
+    url: '/allocWarehouse/audit',
+    data: params,
+    method: 'post'
+  })
+}
+// 删除
+export const allocWarehouseDelete = params => {
+  return axios({
+    url: `/allocWarehouse/delete/${params.id}`,
+    method: 'get'
+  })
+}
+// 库存调拨明细列表合计
+export const allocWarehouseDetailTotal = params => {
+  return axios({
+    url: '/allocWarehouse/detail/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 库存调拨明细列表
+export const allocWarehouseDetailQuery = params => {
+  const url = `/allocWarehouse/detail/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 仓库调拨明细保存
+export const allocWarehouseDetailSave = params => {
+  return axios({
+    url: '/allocWarehouse/detail/save',
+    data: params,
+    method: 'post'
+  })
+}
+// 仓库调拨明细删除
+export const allocWarehouseDetailDelete = params => {
+  return axios({
+    url: '/allocWarehouse/detail/delete',
+    data: params,
+    method: 'post'
+  })
+}
+// 保存仓库调拨单
+export const allocWarehouseSave = params => {
+  return axios({
+    url: '/allocWarehouse/save',
+    data: params,
+    method: 'post'
+  })
+}
+// 选择产品
+export const productQuery = params => {
+  const url = `/stock/detail/queryStockProductPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 根据单据id查询单据基础信息
+export const allocWarehouseFind = params => {
+  const url = `/allocWarehouse/findById/${params.id}`
+  delete params.id
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

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

@@ -460,7 +460,7 @@ export const asyncRouterMap = [
                 }
                 }
               },
               },
               {
               {
-                path: 'edit/:id',
+                path: 'edit/:id/:sn',
                 name: 'warehouseAllocationEdit',
                 name: 'warehouseAllocationEdit',
                 component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/warehouseAllocation/edit.vue'),
                 component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/warehouseAllocation/edit.vue'),
                 meta: {
                 meta: {

+ 126 - 91
src/views/allocationManagement/warehouseAllocation/basicInfoModal.vue

@@ -1,99 +1,134 @@
 <template>
 <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 label="调出仓库" prop="sort">
+        <a-select
+          id="warehouseAllocation-basicInfo-outWarehouseSn"
+          allowClear
+          placeholder="请选择调出仓库"
+          v-model="form.outWarehouseSn"
+        >
+          <a-select-option v-for="item in warehouseList" :value="item.warehouseSn">
+            {{ item.name }}
+          </a-select-option>
+        </a-select>
+      </a-form-model-item>
+      <a-form-model-item label="调入仓库" prop="sort">
+        <a-select
+          id="warehouseAllocation-basicInfo-putWarehouseSn"
+          allowClear
+          placeholder="请选择调入仓库"
+          v-model="form.putWarehouseSn"
+        >
+          <a-select-option v-for="item in warehouseList" :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="30" v-model="form.relevanceNo" placeholder="请输入关联单号(最多30个字符)" allowClear />
+      </a-form-model-item>
+      <a-form-model-item label="备注" prop="remark">
+        <a-textarea id="warehouseAllocation-basicInfo-remark" :maxLength="500" v-model="form.remark" 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>
 </template>
 </template>
 
 
 <script>
 <script>
-import { VSelect } from '@/components';
+import { VSelect } from '@/components'
+import { warehouseAllList } from '@/api/warehouse.js'
+import { allocWarehouseSave } from '@/api/allocWarehouse.js'
 export default {
 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: {
+        name: [{ 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 () {
+      allocWarehouseSave(this.form).then(res => {
+        if (res.status == 200) {
+          this.isShow = false
+          this.$emit('ok', res.data)
+        }
+      })
+    },
+    filterOption (input, option) {
+      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+    }
+  }
+
+}
 </script>
 </script>
 
 
 <style lang="less">
 <style lang="less">

+ 165 - 98
src/views/allocationManagement/warehouseAllocation/edit.vue

@@ -17,18 +17,18 @@
         <a-collapse-panel key="1">
         <a-collapse-panel key="1">
           <template slot="header">
           <template slot="header">
             基础信息
             基础信息
-            <a-button
+            <!-- <a-button
               type="primary"
               type="primary"
               shape="circle"
               shape="circle"
               size="small"
               size="small"
               icon="edit"
               icon="edit"
               class="edit-circle-btn"
               class="edit-circle-btn"
               id="warehouseAllocationEdit-circle-btn"
               id="warehouseAllocationEdit-circle-btn"
-              @click.stop="handleEditInfo" />
+              @click.stop="handleEditInfo" /> -->
           </template>
           </template>
           <a-descriptions :column="3">
           <a-descriptions :column="3">
-            <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>
           </a-descriptions>
         </a-collapse-panel>
         </a-collapse-panel>
       </a-collapse>
       </a-collapse>
@@ -42,49 +42,51 @@
             <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
             <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
               <a-row :gutter="15">
               <a-row :gutter="15">
                 <a-col :md="6" :sm="24">
                 <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-form-item>
                 </a-col>
                 </a-col>
                 <a-col :md="6" :sm="24">
                 <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-form-item>
                 </a-col>
                 </a-col>
                 <a-col :md="6" :sm="24">
                 <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-form-item>
                 </a-col>
                 </a-col>
                 <template v-if="advanced">
                 <template v-if="advanced">
                   <a-col :md="6" :sm="24">
                   <a-col :md="6" :sm="24">
-                    <a-form-item label="产品品牌">
+                    <a-form-item label="产品品牌" prop="brandSn">
                       <a-select
                       <a-select
                         placeholder="请选择"
                         placeholder="请选择"
                         id="warehouseAllocationEdit-state"
                         id="warehouseAllocationEdit-state"
                         allowClear
                         allowClear
-                        v-model="queryParam.dataSourceNo"
+                        v-model="queryParam.brandSn"
                         :showSearch="true"
                         :showSearch="true"
                         option-filter-prop="children"
                         option-filter-prop="children"
                         :filter-option="filterOption">
                         :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 brandData" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
                       </a-select>
                       </a-select>
                     </a-form-item>
                     </a-form-item>
                   </a-col>
                   </a-col>
                   <a-col :md="6" :sm="24">
                   <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="产品类别" prop="brandSn">
+                      <a-cascader
+                        :field-names="{ label: 'productTypeName', value: 'productTypeSn', children: 'children'}"
+                        :options="typeData"
+                        id="warehouseAllocationEdit-state"
+                        placeholder="请选择产品类别"
+                        allowClear
+                        v-model="queryParam.brand" />
                     </a-form-item>
                     </a-form-item>
                   </a-col>
                   </a-col>
                   <a-col :md="6" :sm="24">
                   <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="brandSn">
+                      <a-select id="warehouseAllocationEdit-warehouse" placeholder="请选择" allowClear v-model="queryParam.warehouse" 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-form-item>
                   </a-col>
                   </a-col>
                 </template>
                 </template>
@@ -109,17 +111,22 @@
             :data="loadData"
             :data="loadData"
             :scroll="{ x: 1560 }"
             :scroll="{ x: 1560 }"
             bordered>
             bordered>
+            <!-- 类别 -->
+            <template slot="type" slot-scope="text, record">
+              <span>{{ record.productTypeName2||'' }}</span><span v-if="record.productTypeName3"><strong>-</strong>{{ record.productTypeName3||'' }}</span>
+              <!-- {{ record.productTypeName2+(record.productTypeName3?('-'+record.productTypeName3):'') }} -->
+            </template>
             <!-- 调入仓位 -->
             <!-- 调入仓位 -->
             <template slot="storageQuantity" slot-scope="text, record">
             <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>
+              <a-select id="warehouseAllocationEdit-warehouse" placeholder="请选择" allowClear v-model="record.putWarehouseLocationSn" style="width: 100%;">
+                <a-select-option v-for="item in warehousePutLocData" :key="item.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
               </a-select>
               </a-select>
             </template>
             </template>
             <!-- 调出数量 -->
             <!-- 调出数量 -->
             <template slot="transferOutQuantity" slot-scope="text, record">
             <template slot="transferOutQuantity" slot-scope="text, record">
               <a-input-number
               <a-input-number
-                id="warehouseAllocationEdit-storageQuantity"
-                :value="record.storageQuantity"
+                id="warehouseAllocationEdit-allocationQty"
+                :value="record.allocationQty"
                 :precision="0"
                 :precision="0"
                 :min="0"
                 :min="0"
                 :max="999999"
                 :max="999999"
@@ -139,7 +146,7 @@
         <a-collapse-panel key="1" header="已选产品">
         <a-collapse-panel key="1" header="已选产品">
           <!-- 总计 -->
           <!-- 总计 -->
           <a-alert type="info" showIcon style="margin-bottom:15px">
           <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>{{ productTotalCost }}</strong>,总数量: <strong>{{ productTotalQty }}</strong> ,总款数: <strong>{{ productTotalCategory }}</strong> </div>
           </a-alert>
           </a-alert>
           <!-- 筛选条件 -->
           <!-- 筛选条件 -->
           <a-row :gutter="15" justify="space-between">
           <a-row :gutter="15" justify="space-between">
@@ -148,25 +155,26 @@
                 <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
                 <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
                   <a-row :gutter="15">
                   <a-row :gutter="15">
                     <a-col :md="9" :sm="24">
                     <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="chooseParam.productCode" placeholder="请输入产品编码" allowClear />
                       </a-form-item>
                       </a-form-item>
                     </a-col>
                     </a-col>
                     <a-col :md="9" :sm="24">
                     <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="chooseParam.productName" placeholder="请输入产品名称" allowClear />
                       </a-form-item>
                       </a-form-item>
                     </a-col>
                     </a-col>
                     <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
                     <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 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 style="margin-left: 8px" @click="resetChooseSearchForm" :disabled="disabled" id="warehouseAllocationList-reset">重置</a-button>
                     </a-col>
                     </a-col>
                   </a-row>
                   </a-row>
                 </a-form>
                 </a-form>
               </div>
               </div>
             </a-col>
             </a-col>
             <a-col :span="7">
             <a-col :span="7">
-              <a-button size="small" type="primary" id="warehouseAllocationEdit-pladd-btn" style="margin-bottom: 8px;">批量添加</a-button>
+              <!-- 暂不做 -->
+              <!-- <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" 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" type="danger" id="warehouseAllocationEdit-del-all-btn" style="margin: 0 0 8px 8px;">整单删除</a-button>
             </a-col>
             </a-col>
@@ -181,17 +189,21 @@
             :data="chooseLoadData"
             :data="chooseLoadData"
             :scroll="{ x: 1460 }"
             :scroll="{ x: 1460 }"
             bordered>
             bordered>
+            <!-- 类别 -->
+            <template slot="type" slot-scope="text, record">
+              {{ record.productTypeName2+(record.productTypeName3?('-'+record.productTypeName3):'') }}
+            </template>
             <!-- 调入仓位 -->
             <!-- 调入仓位 -->
             <template slot="storageQuantity" slot-scope="text, record">
             <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>
+              <a-select id="warehouseAllocationEdit-warehouse" placeholder="请选择" allowClear v-model="record.putWarehouseLocationSn" style="width: 100%;">
+                <a-select-option v-for="item in warehousePutLocData" :key="item.warehouseLocationSn" :value="item.warehouseLocationSn">{{ item.name }}</a-select-option>
               </a-select>
               </a-select>
             </template>
             </template>
             <!-- 调出数量 -->
             <!-- 调出数量 -->
             <template slot="transferOutQuantity" slot-scope="text, record">
             <template slot="transferOutQuantity" slot-scope="text, record">
               <a-input-number
               <a-input-number
-                id="warehouseAllocationEdit-storageQuantity"
-                :value="record.storageQuantity"
+                id="warehouseAllocationEdit-allocationQty"
+                :value="record.allocationQty"
                 :precision="0"
                 :precision="0"
                 :min="0"
                 :min="0"
                 :max="999999"
                 :max="999999"
@@ -218,104 +230,92 @@
 <script>
 <script>
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
 import basicInfoModal from './basicInfoModal.vue'
+import { dealerProductBrandQuery } from '@/api/dealerProductBrand.js'
+import { dealerProductTypeList } from '@/api/dealerProductType.js'
+import { warehouseLocAllList } from '@/api/warehouse.js'
+import { productQuery, allocWarehouseFind, allocWarehouseDetailTotal, allocWarehouseDetailQuery, allocWarehouseDetailSave, allocWarehouseDetailDelete } from '@/api/allocWarehouse.js'
 export default {
 export default {
   components: { STable, VSelect, basicInfoModal },
   components: { STable, VSelect, basicInfoModal },
   data () {
   data () {
     return {
     return {
+      id: '', // 单据id
       queryParam: {
       queryParam: {
-
+        outWarehouseSn: '', // 调出仓库sn
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productOrigCode: '', // 原厂编码
+        brandName: '', // 品牌
+        typeName: '' // 类别
       },
       },
+	  chooseParam: {
+        allocationWarehouseSn: '', // 单据sn
+	    productCode: '', // 产品编码
+	    productName: '' // 产品名称
+	  },
+	  productTotalCost: 0, // 总成本
+	  productTotalQty: 0, // 总数量
+	  productTotalCategory: 0, // 总款项
+	  warehouse: null, // 基础信息
       brandData: [], //  产品品牌  下拉数据
       brandData: [], //  产品品牌  下拉数据
       typeData: [], //  产品类别  下拉数据
       typeData: [], //  产品类别  下拉数据
+      warehousePutLocData: [], //  调入仓库仓位  下拉数据
+      warehouseOutLocData: [], //  调出仓库仓位  下拉数据
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
       advanced: false, // 高级搜索 展开/关闭
       // 表头
       // 表头
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { 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: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: 200, align: 'center', ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '类别', width: 160, align: 'center', scopedSlots: { customRender: 'type' } },
+        { title: '调出仓位', dataIndex: 'outWarehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调入仓位', scopedSlots: { customRender: 'storageQuantity' }, width: 140, align: 'center' },
         { 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: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调出数量', scopedSlots: { customRender: 'transferOutQuantity' }, width: 140, align: 'center' },
         { title: '调出数量', scopedSlots: { customRender: 'transferOutQuantity' }, width: 140, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         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
-          }
+        return productQuery(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
             data.list[i].no = no + i + 1
           }
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          return data
         })
         })
       },
       },
       // 表头
       // 表头
       chooseColumns: [
       chooseColumns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { 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: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '类别', width: 160, align: 'center', scopedSlots: { customRender: 'type' } },
+        { title: '调出仓位', dataIndex: 'outWarehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调入仓位', dataIndex: 'custsNakme', width: 140, align: 'center', scopedSlots: { customRender: 'storageQuantity' } },
+        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调出数量', scopedSlots: { customRender: 'transferOutQuantity' }, width: 140, align: 'center' },
         { title: '调出数量', scopedSlots: { customRender: 'transferOutQuantity' }, width: 140, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
       chooseLoadData: parameter => {
         this.disabled = true
         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
-          }
+        return allocWarehouseDetailQuery(Object.assign(parameter, this.chooseParam)).then(res => {
+          const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
             data.list[i].no = no + i + 1
           }
           }
-          _this.disabled = false
-          resolve(data)
+		  this.getProduceTotal()
+          this.disabled = false
+          return data
         })
         })
       },
       },
       openModal: false // 选择基本信息弹框是否显示
       openModal: false // 选择基本信息弹框是否显示
@@ -332,8 +332,69 @@ export default {
       this.newTime = undefined
       this.newTime = undefined
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)
     },
     },
+    // 已选产品重置查询
+    resetChooseSearchForm () {
+      this.chooseParam.productCode = ''
+      this.chooseParam.productName = ''
+      this.$refs.chooseTable.refresh(true)
+    },
+    // 获取产品品牌
+    getProductBrand () {
+      dealerProductBrandQuery({}).then(res => {
+        this.brandData = res.data || []
+      })
+    },
+    // 获取产品分类
+    getProductType () {
+	  dealerProductTypeList({}).then(res => {
+	    this.typeData = res.data || []
+        console.log(res, this.typeData, '--------获取产品分类')
+	  })
+    },
+    // 获取仓库仓位
+    getWarehouseLoc (sn, type) {
+      warehouseLocAllList({ warehouseSn: sn }).then(res => {
+		  if (type == 'put') {
+			  this.warehousePutLocData = res.data || []
+		  } else {
+			  this.warehouseOutLocData = res.data || []
+		  }
+        // return res.data || []
+      })
+    },
+    // 查询基础信息
+    getHouse () {
+      allocWarehouseFind({ id: this.id }).then(res => {
+        if (res.status == 200) {
+          this.warehouse = res.data
+		  this.getWarehouseLoc(this.warehouse.putWarehouseSn, 'put')
+		  this.getWarehouseLoc(this.warehouse.outWarehouseSn, 'out')
+        } else {
+          this.warehouse = null
+        }
+      })
+    },
+    // 已选产品总计查询
+    getProduceTotal () {
+      allocWarehouseDetailTotal(this.chooseParam).then(res => {
+		  console.log(res, '-----总计----')
+		  if (res.status == 200) {
+			  this.productTotalCost = this.data.productTotalCost
+			  this.productTotalQty = this.data.productTotalQty
+			  this.productTotalCategory = this.data.productTotalCategory
+		  } else {
+			  this.productTotalCost = 0
+			  this.productTotalQty = 0
+			  this.productTotalCategory = 0
+		  }
+	  })
+    },
     //  添加
     //  添加
-    handleAdd (row) {},
+    handleAdd (row) {
+      const params = {
+
+      }
+    },
     //  删除
     //  删除
     handleDel (row) {},
     handleDel (row) {},
     //  编辑基本信息
     //  编辑基本信息
@@ -363,6 +424,12 @@ export default {
   beforeRouteEnter (to, from, next) {
   beforeRouteEnter (to, from, next) {
     next(vm => {
     next(vm => {
       vm.openModal = false
       vm.openModal = false
+	  vm.id = vm.$route.params.id
+	  vm.chooseParam.allocationWarehouseSn = vm.$route.params.sn
+	  vm.getProductBrand()
+	  vm.getProductType()
+	  vm.getHouse()
+	  console.log(vm.id, vm.$route.params, 'vm.id')
     })
     })
   }
   }
 }
 }

+ 27 - 32
src/views/allocationManagement/warehouseAllocation/list.vue

@@ -45,7 +45,7 @@
                   v-model="queryParam.state"
                   v-model="queryParam.state"
                   ref="state"
                   ref="state"
                   id="warehouseAllocationList-state"
                   id="warehouseAllocationList-state"
-                  code="PAYMENT_TYPE"
+                  code="ALLOCATION_WAREHOUSE_STATE"
                   placeholder="请选择单据状态"
                   placeholder="请选择单据状态"
                   allowClear></v-select>
                   allowClear></v-select>
               </a-form-item>
               </a-form-item>
@@ -64,7 +64,7 @@
     </div>
     </div>
     <!-- 操作按钮 -->
     <!-- 操作按钮 -->
     <div class="table-operator">
     <div class="table-operator">
-      <a-button id="warehouseAllocationList-add" type="primary" @click="handleEdit()">新增</a-button>
+      <a-button id="warehouseAllocationList-add" type="primary" @click="openModal=true">新增</a-button>
     </div>
     </div>
     <!-- 列表 -->
     <!-- 列表 -->
     <s-table
     <s-table
@@ -78,7 +78,7 @@
       bordered>
       bordered>
       <!-- 状态 -->
       <!-- 状态 -->
       <template slot="state" slot-scope="text, record">
       <template slot="state" slot-scope="text, record">
-        <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '待提交': '待审核' }}</a-tag>
+        <a-tag >{{ text }}</a-tag>
       </template>
       </template>
       <!-- 操作 -->
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
       <template slot="action" slot-scope="text, record">
@@ -92,12 +92,12 @@
       </template>
       </template>
     </s-table>
     </s-table>
     <!-- 新增/编辑 -->
     <!-- 新增/编辑 -->
-    <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
+    <basic-info-modal :openModal="openModal" @ok="handleEdit" @close="openModal=false" />
   </a-card>
   </a-card>
 </template>
 </template>
 
 
 <script>
 <script>
-import { allocWarehouseList } from '@/api/allocWarehouse'
+import { allocWarehouseList, allocWarehouseAudit, allocWarehouseDelete } from '@/api/allocWarehouse'
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
 import basicInfoModal from './basicInfoModal.vue'
 export default {
 export default {
@@ -123,7 +123,7 @@ export default {
         { title: '总数量', dataIndex: 'productTotalQty', 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: '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: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', scopedSlots: { customRender: 'state' }, width: 100, align: 'center' },
+        { title: '状态', dataIndex: 'stateDictValue', scopedSlots: { customRender: 'state' }, width: 100, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 215, align: 'center', fixed: 'right' }
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 215, align: 'center', fixed: 'right' }
       ],
       ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
@@ -158,7 +158,7 @@ export default {
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)
     },
     },
     //  基本信息  保存
     //  基本信息  保存
-    handleOk () {
+    handleOk (data) {
       this.$router.push({ path: `/allocationManagement/warehouseAllocation/add` })
       this.$router.push({ path: `/allocationManagement/warehouseAllocation/add` })
     },
     },
     //  删除
     //  删除
@@ -169,35 +169,35 @@ export default {
         content: '删除后不可恢复,确定要进行删除吗?',
         content: '删除后不可恢复,确定要进行删除吗?',
         centered: true,
         centered: true,
         onOk () {
         onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          allocWarehouseDelete({
+            id: row.id
+          }).then(res => {
+            console.log(res, 'res1111')
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
         }
       })
       })
     },
     },
     //  审核
     //  审核
-    handleExamine () {
+    handleExamine (row) {
       const _this = this
       const _this = this
       this.$confirm({
       this.$confirm({
         title: '提示',
         title: '提示',
         content: '确认要审核通过吗?',
         content: '确认要审核通过吗?',
         centered: true,
         centered: true,
         onOk () {
         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({
+            id: row.id
+          }).then(res => {
+            console.log(res, 'res1111')
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
         }
       })
       })
     },
     },
@@ -207,12 +207,7 @@ export default {
     },
     },
     //  新增/编辑
     //  新增/编辑
     handleEdit (row) {
     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}` })
     }
     }
   }
   }
 }
 }