Browse Source

连锁调出

chenrui 4 years ago
parent
commit
3e9f0fe280

+ 25 - 3
src/api/allocLinkageOut.js

@@ -1,6 +1,6 @@
 import { axios } from '@/utils/request'
 
-//  连锁调拨调出列表  分页
+//  连锁调拨调出 列表  分页
 export const allocLinkageOutList = (params) => {
   const url = `/allocLinkageOut/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
@@ -11,9 +11,17 @@ export const allocLinkageOutList = (params) => {
     method: 'post'
   })
 }
-//  连锁调拨调出详情列表  分页
+//  连锁调拨调出   保存
+export const allocLinkageOutSave = (params) => {
+  return axios({
+    url: '/allocLinkageOut/save',
+    data: params,
+    method: 'post'
+  })
+}
+//  连锁调拨调出 详情 列表  分页
 export const allocLinkageOutDetailList = (params) => {
-  const url = `/allocLinkageOut/queryDetailPage/${params.pageNo}/${params.pageSize}`
+  const url = `/allocLinkageOut/detail/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -22,3 +30,17 @@ export const allocLinkageOutDetailList = (params) => {
     method: 'post'
   })
 }
+//  连锁调拨调出 详情  根据sn查
+export const allocLinkageOutDetailSn = (params) => {
+  return axios({
+    url: `/allocLinkageOut/findBySn/${params.sn}`,
+    method: 'get'
+  })
+}
+//  连锁调拨调出   调往对象
+export const getTenantList = (params) => {
+  return axios({
+    url: '/allocLinkageOut/getTenantList',
+    method: 'get'
+  })
+}

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

@@ -337,75 +337,75 @@ export const asyncRouterMap = [
           // permission: 'M_shop'
         },
         children: [
+          {
+            path: '/purchasingManagement/purchaseOrder',
+            redirect: '/purchasingManagement/purchaseOrder/list',
+            name: 'purchaseOrder',
+            component: RouteView,
+            meta: {
+              title: '采购单管理',
+              icon: 'money-collect'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
               {
-                path: '/purchasingManagement/purchaseOrder',
-                redirect: '/purchasingManagement/purchaseOrder/list',
-                name: 'purchaseOrder',
-                component: RouteView,
+                path: 'list',
+                name: 'purchaseOrderList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/list.vue'),
                 meta: {
-                  title: '采购单管理',
-                  icon: 'money-collect'
+                  title: '采购单列表',
+                  icon: 'money-collect',
+                  hidden: true
                   // permission: 'M_goodsManage_list'
-                },
-                hideChildrenInMenu: true,
-                children: [
-                  {
-                    path: 'list',
-                    name: 'purchaseOrderList',
-                    component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/list.vue'),
-                    meta: {
-                      title: '采购单列表',
-                      icon: 'money-collect',
-                      hidden: true
-                      // permission: 'M_goodsManage_list'
-                    }
-                  },
-                  {
-                    path: 'add/:id',
-                    name: 'purchaseOrderAdd',
-                    component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/edit.vue'),
-                    meta: {
-                      title: '新增采购单',
-                      icon: 'money-collect',
-                      hidden: true
-                      // permission: 'B_goodsManage_edit'
-                    }
-                  },
-                  {
-                    path: 'edit/:id',
-                    name: 'purchaseOrderEdit',
-                    component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/edit.vue'),
-                    meta: {
-                      title: '编辑采购单',
-                      icon: 'money-collect',
-                      hidden: true
-                      // permission: 'B_goodsManage_edit'
-                    }
-                  },
-                  {
-                    path: 'detail/:id',
-                    name: 'purchaseOrderDetail',
-                    component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/detail.vue'),
-                    meta: {
-                      title: '采购单详情',
-                      icon: 'money-collect',
-                      hidden: true
-                      // permission: 'B_goodsManage_edit'
-                    }
-                  },
-                  {
-                    path: 'warehousing/:id',
-                    name: 'purchaseOrderWarehousing',
-                    component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/warehousing.vue'),
-                    meta: {
-                      title: '入库',
-                      icon: 'money-collect',
-                      hidden: true
-                      // permission: 'B_goodsManage_edit'
-                    }
-                  }
-                ]
+                }
+              },
+              {
+                path: 'add/:id',
+                name: 'purchaseOrderAdd',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/edit.vue'),
+                meta: {
+                  title: '新增采购单',
+                  icon: 'money-collect',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: 'edit/:id',
+                name: 'purchaseOrderEdit',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/edit.vue'),
+                meta: {
+                  title: '编辑采购单',
+                  icon: 'money-collect',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: 'detail/:id',
+                name: 'purchaseOrderDetail',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/detail.vue'),
+                meta: {
+                  title: '采购单详情',
+                  icon: 'money-collect',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
               },
+              {
+                path: 'warehousing/:id',
+                name: 'purchaseOrderWarehousing',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/warehousing.vue'),
+                meta: {
+                  title: '入库',
+                  icon: 'money-collect',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              }
+            ]
+          },
           {
             path: '/purchasingManagement/purchaseReturn',
             redirect: '/purchasingManagement/purchaseReturn/list',
@@ -473,8 +473,8 @@ export const asyncRouterMap = [
         component: PageView,
         meta: {
           title: '调拨管理',
-          icon: 'cluster',
-          permission: 'M_allocationManagement'
+          icon: 'cluster'
+          // permission: 'M_allocationManagement'
         },
         children: [
           {
@@ -590,64 +590,64 @@ export const asyncRouterMap = [
           //     }
           //   ]
           // },
-          // {
-          //   path: '/allocationManagement/chainTransferOut',
-          //   redirect: '/allocationManagement/chainTransferOut/list',
-          //   name: 'chainTransferOut',
-          //   component: RouteView,
-          //   meta: {
-          //     title: '连锁调出',
-          //     icon: 'pull-request'
-          //     // permission: 'M_goodsManage_list'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'list',
-          //       name: 'chainTransferOutList',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferOut/list.vue'),
-          //       meta: {
-          //         title: '连锁调出列表',
-          //         icon: 'pull-request',
-          //         hidden: true
-          //         // permission: 'M_goodsManage_list'
-          //       }
-          //     },
-          //     {
-          //       path: 'add',
-          //       name: 'chainTransferOutAdd',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferOut/edit.vue'),
-          //       meta: {
-          //         title: '新增连锁调出',
-          //         icon: 'pull-request',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     },
-          //     {
-          //       path: 'edit/:id',
-          //       name: 'chainTransferOutEdit',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferOut/edit.vue'),
-          //       meta: {
-          //         title: '编辑连锁调出',
-          //         icon: 'pull-request',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     },
-          //     {
-          //       path: 'detail/:id/:sn',
-          //       name: 'chainTransferOutDetail',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferOut/detail.vue'),
-          //       meta: {
-          //         title: '连锁调出详情',
-          //         icon: 'pull-request',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     }
-          //   ]
-          // },
+          {
+            path: '/allocationManagement/chainTransferOut',
+            redirect: '/allocationManagement/chainTransferOut/list',
+            name: 'chainTransferOut',
+            component: RouteView,
+            meta: {
+              title: '连锁调出',
+              icon: 'pull-request'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'chainTransferOutList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferOut/list.vue'),
+                meta: {
+                  title: '连锁调出列表',
+                  icon: 'pull-request',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              },
+              {
+                path: 'add',
+                name: 'chainTransferOutAdd',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferOut/edit.vue'),
+                meta: {
+                  title: '新增连锁调出',
+                  icon: 'pull-request',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: 'edit/:id',
+                name: 'chainTransferOutEdit',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferOut/edit.vue'),
+                meta: {
+                  title: '编辑连锁调出',
+                  icon: 'pull-request',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: 'detail/:id/:sn',
+                name: 'chainTransferOutDetail',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferOut/detail.vue'),
+                meta: {
+                  title: '连锁调出详情',
+                  icon: 'pull-request',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              }
+            ]
+          },
           {
             path: '/allocationManagement/storeTransferOut',
             redirect: '/allocationManagement/storeTransferOut/list',

+ 129 - 83
src/views/allocationManagement/chainTransferOut/basicInfoModal.vue

@@ -1,91 +1,137 @@
 <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>
+  <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="allocationType">
+        <v-select
+          v-model="form.allocationType"
+          ref="billStatus"
+          id="chainTransferOut-basicInfo-allocationType"
+          code="ALLOCATION_LINKAGE_PRODUCT_TYPE"
+          placeholder="请选择调出产品类型"
+          allowClear
+        ></v-select>
+      </a-form-model-item>
+      <a-form-model-item label="调往对象" prop="putTenantSn">
+        <a-select
+          placeholder="请选择调往对象"
+          allowClear
+          v-model="form.putTenantSn"
+          :showSearch="true"
+          option-filter-prop="children"
+          :filter-option="filterOption">
+          <a-select-option v-for="item in putTenantSnData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+        </a-select>
+      </a-form-model-item>
+      <a-form-model-item label="备注" prop="remark">
+        <a-textarea id="chainTransferOut-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="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';
+import { VSelect } from '@/components'
+import { getTenantList, allocLinkageOutSave } from '@/api/allocLinkageOut'
 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')
-			}
-		}
-	}
-};
+  name: 'ChainTransferOutBasicInfoModal',
+  components: { VSelect },
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        allocationType: '', // 调出产品类型
+        putTenantSn: undefined, //  调往对象
+        remark: ''
+      },
+      rules: {
+        allocationType: [{ required: true, message: '请选择调出产品类型', trigger: 'change' }],
+        putTenantSn: [{ required: true, message: '请选择调往对象', trigger: 'change' }]
+      },
+      putTenantSnData: [] //  调往对象  下拉数据
+    }
+  },
+  methods: {
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          allocLinkageOutSave(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
+        }
+      })
+    },
+    filterOption (input, option) {
+      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+    },
+    // 调往对象
+    getPutTenantList () {
+      getTenantList({}).then(res => {
+        if (res.status == 200) {
+          this.putTenantSnData = res.data
+        } else {
+          this.putTenantSnData = []
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+      } else {
+        this.getPutTenantList()
+      }
+    }
+  }
+}
 </script>
 
 <style lang="less">

+ 180 - 133
src/views/allocationManagement/chainTransferOut/edit.vue

@@ -1,9 +1,10 @@
 <template>
   <div class="chainTransferOutEdit-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="chainTransferOutEdit-back">
+    <a-page-header :ghost="false" :backIcon="false" class="chainTransferOutEdit-back" >
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
-        <a id="chainTransferOutEdit-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
+        <a id="chainTransferOutEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        <span style="margin: 0 15px;color: #666;">调往对象:{{ (basicInfoData&&basicInfoData.putTenantName) || '--' }}</span>
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
@@ -11,27 +12,6 @@
         <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']">
@@ -41,18 +21,18 @@
             <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 label="产品编码" prop="productCode">
+                    <a-input id="chainTransferOutEdit-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="chainTransferOutEdit-name" v-model="queryParam.name" placeholder="请输入产品名称" allowClear />
+                  <a-form-item label="产品名称" prop="productName">
+                    <a-input id="chainTransferOutEdit-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="chainTransferOutEdit-name" v-model="queryParam.name" placeholder="请输入原厂编码" allowClear />
+                  <a-form-item label="原厂编码" prop="productOrigCode">
+                    <a-input id="chainTransferOutEdit-productOrigCode" v-model="queryParam.productOrigCode" placeholder="请输入原厂编码" allowClear />
                   </a-form-item>
                 </a-col>
                 <template v-if="advanced">
@@ -60,30 +40,34 @@
                     <a-form-item label="产品品牌">
                       <a-select
                         placeholder="请选择"
-                        id="chainTransferOutEdit-state"
+                        id="chainTransferOutEdit-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="chainTransferOutEdit-state" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
+                    <a-form-item label="产品分类">
+                      <a-cascader
+                        @change="changeProductType"
+                        change-on-select
+                        v-model="productType"
+                        :options="productTypeList"
+                        :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                        id="chainTransferOutEdit-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="chainTransferOutEdit-billStatus"
-                        code="PAYMENT_TYPE"
-                        placeholder="请选择仓库"
-                        allowClear></v-select>
+                      <a-select id="chainTransferOutEdit-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>
@@ -99,30 +83,31 @@
             </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: 1530 }"
+            :dataSource="loadData"
+            :scroll="{ x: 1610, y: 300 }"
             bordered>
             <!-- 调出数量 -->
-            <template slot="transferOutQuantity" slot-scope="text, record">
+            <template slot="outQty" slot-scope="text, record">
               <a-input-number
-                id="chainTransferOutEdit-storageQuantity"
-                :value="record.storageQuantity"
+                id="chainTransferOutEdit-outQty"
+                v-model="record.outQty"
                 :precision="0"
-                :min="0"
+                :min="1"
                 :max="999999"
-                placeholder="请输入" />
+                placeholder="请输入"
+                style="width: 100%;" />
             </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-table>
         </a-collapse-panel>
       </a-collapse>
     </a-card>
@@ -167,22 +152,12 @@
           <s-table
             class="sTable"
             ref="chooseTable"
-            size="default"
+            size="small"
             :rowKey="(record) => record.id"
             :columns="chooseColumns"
             :data="chooseLoadData"
-            :scroll="{ x: 1545 }"
+            :scroll="{ x: 1545, y: 300 }"
             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>
@@ -193,7 +168,13 @@
     </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="chainTransferOutEdit-submit" size="large" class="button-primary" @click="handleSubmit" style="padding: 0 60px;">提交</a-button>
+        <a-button
+          type="primary"
+          id="chainTransferOutEdit-submit"
+          size="large"
+          class="button-primary"
+          @click="handleSubmit"
+          style="padding: 0 60px;">提交</a-button>
       </div>
     </a-affix>
     <!-- 选择基本信息弹框 -->
@@ -204,61 +185,59 @@
 <script>
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
+import { allocLinkageOutDetailSn, allocLinkageOutDetailList } from '@/api/allocLinkageOut'
+import { productQuery } from '@/api/allocWarehouse'
+import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+import { dealerProductTypeList } from '@/api/dealerProductType'
+import { warehouseAllList } from '@/api/warehouse'
 export default {
   components: { STable, VSelect, basicInfoModal },
   data () {
     return {
       queryParam: {
-
+        productCode: '',
+        productName: '',
+        productOrigCode: '',
+        warehouseSn: undefined,
+        brandSn: undefined,
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined
       },
-      brandData: [], //  产品品牌  下拉数据
-      typeData: [], //  产品类别  下拉数据
+      productBrandList: [], //  产品品牌  下拉数据
+      productTypeList: [], //  产品分类  下拉数据
+      productType: [],
+      warehouseList: [], //  仓库  下拉数据
       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: '产品编码', dataIndex: 'productCode', width: 200, align: 'center' },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { 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: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存数量', dataIndex: 'currentQty', 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: 'outQty' }, 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)
-        })
+      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)
+      },
+      chooseQueryParam: {
+        productCode: '',
+        productName: ''
       },
       // 表头
       chooseColumns: [
@@ -271,41 +250,26 @@ export default {
         { 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: 'outQty', 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
-          }
+        return allocLinkageOutDetailList(Object.assign(parameter, this.chooseQueryParam, { allocationLinkageOutSn: this.$route.params.sn })).then(res => {
+          const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          return data
         })
       },
-      openModal: false // 选择基本信息弹框是否显示
+      openModal: false, // 选择基本信息弹框是否显示
+      basicInfoData: null, //  基本信息
+      productTotal: null //  合计
     }
   },
   methods: {
@@ -319,6 +283,16 @@ export default {
       this.newTime = undefined
       this.$refs.table.refresh(true)
     },
+    // 基本信息
+    getDetail () {
+      allocLinkageOutDetailSn({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
     //  添加
     handleAdd (row) {},
     //  删除
@@ -342,14 +316,87 @@ export default {
       this.$router.push({ path: '/allocationManagement/chainTransferOut/list' })
     },
     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
+      )
+    },
+    // 产品列表数据
+    getProductList (pageNo) {
+      this.disabled = true
+      this.pageNo = pageNo || this.pageNo
+      const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
+      productQuery(params).then(res => {
+        if (res.status == 200) {
+          const data = res.data
+          console.log(data)
+          this.paginationProps.total = Number(res.data.count) || 0
+          this.paginationProps.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
+          }
+          this.loadData = data.list
+          this.disabled = false
+        } else {
+          this.paginationProps.total = 0
+          this.paginationProps.current = 1
+          this.loadData = []
+        }
+      })
+    },
+    // 已选产品 调出数量  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 = []
+        }
+      })
     }
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.openModal = false
+      vm.getDetail()
+      vm.getProductList(1)
+      vm.getWarehouseList()
+      vm.getProductBrand()
+      vm.getProductType()
     })
   }
 }

+ 12 - 16
src/views/allocationManagement/chainTransferOut/list.vue

@@ -76,21 +76,16 @@
       :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 slot="allocationLinkageOutNo" slot-scope="text, record">
+        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.allocationLinkageOutNo }}</span>
       </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>
+        <a-button size="small" type="link" class="button-success" @click="handleExamine(record)" id="chainTransferOutList-examine-btn">审核</a-button>
+        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="chainTransferOutList-edit-btn">编辑</a-button>
+        <a-button size="small" type="link" class="button-warning" @click="handleOut(record)" id="chainTransferOutList-out-btn">出库</a-button>
+        <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="chainTransferOutList-del-btn">删除</a-button>
       </template>
     </s-table>
     <!-- 新增/编辑 -->
@@ -99,9 +94,9 @@
 </template>
 
 <script>
-import { allocLinkageOutList } from '@/api/allocLinkageOut'
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
+import { allocLinkageOutList } from '@/api/allocLinkageOut'
 export default {
   components: { STable, VSelect, basicInfoModal },
   data () {
@@ -125,7 +120,8 @@ export default {
         { 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: '业务状态', dataIndex: 'stateDictValue', width: 110, align: 'center' },
+        { title: '财务状态', dataIndex: 'settleStateDictValue', width: 110, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 260, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -160,8 +156,8 @@ export default {
       this.$refs.table.refresh(true)
     },
     //  基本信息  保存
-    handleOk () {
-      this.$router.push({ path: `/allocationManagement/chainTransferOut/add` })
+    handleOk (data) {
+      this.$router.push({ path: `/allocationManagement/chainTransferOut/add/${data.allocationLinkageOutSn}` })
     },
     //  删除
     handleDel (row) {

+ 4 - 4
src/views/customerManagement/customerInfo/list.vue

@@ -182,16 +182,16 @@ export default {
         }
         // 创建时间
         if (this.creatTime && this.creatTime.length > 0) {
-          this.queryParam.beginDate = moment(this.creatTime[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.creatTime[1]).format(this.dateFormat)
+          this.queryParam.beginDate = moment(this.creatTime[0]).format(this.dateFormat) + ' 00:00:00'
+          this.queryParam.endDate = moment(this.creatTime[1]).format(this.dateFormat) + ' 23:59:59'
         } else {
           this.queryParam.beginDate = undefined
           this.queryParam.endDate = undefined
         }
         // 最后销售时间
         if (this.lastSaleTime && this.lastSaleTime.length > 0) {
-          this.queryParam.saleBeginDate = moment(this.lastSaleTime[0]).format(this.dateFormat)
-          this.queryParam.saleEndDate = moment(this.lastSaleTime[1]).format(this.dateFormat)
+          this.queryParam.saleBeginDate = moment(this.lastSaleTime[0]).format(this.dateFormat) + ' 00:00:00'
+          this.queryParam.saleEndDate = moment(this.lastSaleTime[1]).format(this.dateFormat) + ' 23:59:59'
         } else {
           this.queryParam.saleBeginDate = undefined
           this.queryParam.saleEndDate = undefined