Browse Source

连锁调入

chenrui 4 years ago
parent
commit
2438684d5a

+ 33 - 3
src/api/allocLinkagePut.js

@@ -1,6 +1,6 @@
 import { axios } from '@/utils/request'
 import { axios } from '@/utils/request'
 
 
-//  连锁调拨调入列表  分页
+//  连锁调拨调入 列表  分页
 export const allocLinkagePutList = (params) => {
 export const allocLinkagePutList = (params) => {
   const url = `/allocLinkagePut/queryPage/${params.pageNo}/${params.pageSize}`
   const url = `/allocLinkagePut/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageNo
@@ -11,9 +11,30 @@ export const allocLinkagePutList = (params) => {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
-//  连锁调拨调入详情列表  分页
+//  连锁调拨调入  审核
+export const allocLinkagePutAudit = (params) => {
+  return axios({
+    url: `/allocLinkagePut/audit/${params.sn}`,
+    method: 'get'
+  })
+}
+//  连锁调拨调出  入库
+export const allocLinkagePutSubmit = (params) => {
+  return axios({
+    url: `/allocLinkagePut/submit/${params.sn}`,
+    method: 'get'
+  })
+}
+//  连锁调拨调出 详情  根据sn查
+export const allocLinkagePutDetailSn = (params) => {
+  return axios({
+    url: `/allocLinkagePut/findBySn/${params.sn}`,
+    method: 'get'
+  })
+}
+//  连锁调拨调入 详情 列表  分页
 export const allocLinkagePutDetailList = (params) => {
 export const allocLinkagePutDetailList = (params) => {
-  const url = `/allocLinkagePut/queryDetailPage/${params.pageNo}/${params.pageSize}`
+  const url = `/allocLinkagePut/detail/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageNo
   delete params.pageSize
   delete params.pageSize
   return axios({
   return axios({
@@ -22,3 +43,12 @@ export const allocLinkagePutDetailList = (params) => {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
+//  连锁调拨调入 详情 编辑
+export const allocLinkagePutDetailUpdate = (params) => {
+  const url = `/allocLinkagePut/detail/update/${params.id}`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 9 - 0
src/api/warehouse.js

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

+ 47 - 58
src/config/router.config.js

@@ -532,64 +532,53 @@ export const asyncRouterMap = [
               }
               }
             ]
             ]
           },
           },
-          // {
-          //   path: '/allocationManagement/chainTransferIn',
-          //   redirect: '/allocationManagement/chainTransferIn/list',
-          //   name: 'chainTransferIn',
-          //   component: RouteView,
-          //   meta: {
-          //     title: '连锁调入',
-          //     icon: 'cluster'
-          //     // permission: 'M_goodsManage_list'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'list',
-          //       name: 'chainTransferInList',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferIn/list.vue'),
-          //       meta: {
-          //         title: '连锁调入列表',
-          //         icon: 'cluster',
-          //         hidden: true
-          //         // permission: 'M_goodsManage_list'
-          //       }
-          //     },
-          //     {
-          //       path: 'add',
-          //       name: 'chainTransferInAdd',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferIn/edit.vue'),
-          //       meta: {
-          //         title: '新增连锁调入',
-          //         icon: 'cluster',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     },
-          //     {
-          //       path: 'edit/:id',
-          //       name: 'chainTransferInEdit',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferIn/edit.vue'),
-          //       meta: {
-          //         title: '编辑连锁调入',
-          //         icon: 'cluster',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     },
-          //     {
-          //       path: 'detail/:id/:sn',
-          //       name: 'chainTransferInDetail',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferIn/detail.vue'),
-          //       meta: {
-          //         title: '连锁调入详情',
-          //         icon: 'cluster',
-          //         hidden: true
-          //         // permission: 'B_goodsManage_edit'
-          //       }
-          //     }
-          //   ]
-          // },
+          {
+            path: '/allocationManagement/chainTransferIn',
+            redirect: '/allocationManagement/chainTransferIn/list',
+            name: 'chainTransferIn',
+            component: RouteView,
+            meta: {
+              title: '连锁调入',
+              icon: 'cluster'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'chainTransferInList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferIn/list.vue'),
+                meta: {
+                  title: '连锁调入列表',
+                  icon: 'cluster',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              },
+              {
+                path: 'edit/:id/:sn',
+                name: 'chainTransferInEdit',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferIn/edit.vue'),
+                meta: {
+                  title: '编辑连锁调入',
+                  icon: 'cluster',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: 'detail/:sn',
+                name: 'chainTransferInDetail',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/allocationManagement/chainTransferIn/detail.vue'),
+                meta: {
+                  title: '连锁调入详情',
+                  icon: 'cluster',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              }
+            ]
+          },
           {
           {
             path: '/allocationManagement/chainTransferOut',
             path: '/allocationManagement/chainTransferOut',
             redirect: '/allocationManagement/chainTransferOut/list',
             redirect: '/allocationManagement/chainTransferOut/list',

+ 50 - 28
src/views/allocationManagement/chainTransferIn/detail.vue

@@ -1,9 +1,9 @@
 <template>
 <template>
   <div class="chainTransferInDetail-wrap">
   <div class="chainTransferInDetail-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="chainTransferInDetail-back">
+    <a-page-header :ghost="false" :backIcon="false" class="chainTransferInDetail-cont" >
       <!-- 自定义的二级文字标题 -->
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
       <template slot="subTitle">
-        <a id="chainTransferInDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
+        <a id="chainTransferInDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
       </template>
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
       <template slot="extra">
@@ -11,10 +11,23 @@
         <a-button key="1" type="primary" id="chainTransferInDetail-print-btn">快速打印</a-button>
         <a-button key="1" type="primary" id="chainTransferInDetail-print-btn">快速打印</a-button>
       </template>
       </template>
     </a-page-header>
     </a-page-header>
+    <!-- 基础信息 -->
+    <a-card size="small" :bordered="false" class="chainTransferInDetail-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1" header="基础信息">
+          <a-descriptions :column="3">
+            <a-descriptions-item label="调入单号">{{ (basicInfoData&&basicInfoData.allocationLinkagePutNo) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="调出对象">{{ (basicInfoData&&basicInfoData.outTenantName) || '--' }}</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>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
     <a-card size="small" :bordered="false" class="chainTransferInDetail-cont">
     <a-card size="small" :bordered="false" class="chainTransferInDetail-cont">
       <!-- 总计 -->
       <!-- 总计 -->
       <a-alert type="info" showIcon style="margin-bottom:15px">
       <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>
+        <div slot="message">总款数 <strong>{{ (basicInfoData&&basicInfoData.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (basicInfoData&&basicInfoData.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (basicInfoData&&basicInfoData.productTotalCost) || 0 }}</strong></div>
       </a-alert>
       </a-alert>
       <!-- 列表 -->
       <!-- 列表 -->
       <s-table
       <s-table
@@ -26,70 +39,79 @@
         :data="loadData"
         :data="loadData"
         :scroll="{ x: 1275 }"
         :scroll="{ x: 1275 }"
         bordered>
         bordered>
-        <!-- 成本小计 -->
-        <template slot="totalCost" slot-scope="text, record">
-          <span>{{ (record.putCost * record.putQty) || 0 }}</span>
-        </template>
       </s-table>
       </s-table>
     </a-card>
     </a-card>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
-import { allocLinkagePutDetailList } from '@/api/allocLinkagePut'
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
+import { getOperationalPrecision } from '@/libs/tools.js'
+import { allocLinkagePutDetailList, allocLinkagePutDetailSn } from '@/api/allocLinkagePut'
 export default {
 export default {
   components: { STable, VSelect },
   components: { STable, VSelect },
   data () {
   data () {
     return {
     return {
-      queryParam: {
-        allocationLinkagePutSn: this.$route.params.sn
-      },
-      disabled: false, //  查询、重置按钮是否可操作
-      brandData: [], //  产品品牌  下拉数据
-      typeData: [], //  产品类别  下拉数据
       // 表头
       // 表头
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
         { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '成本价(¥)', dataIndex: 'putCost', 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: '调入数量', dataIndex: 'putQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '调入数量', dataIndex: 'putQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本小计(¥)', scopedSlots: { customRender: 'totalCost' }, width: 135, align: 'center' },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: 115, align: 'center' },
         { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' } }
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', customRender: function (text) { return text || '--' } }
       ],
       ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
-        this.disabled = true
-        return allocLinkagePutDetailList(Object.assign(parameter, this.queryParam)).then(res => {
+        const params = Object.assign(parameter, { allocationLinkagePutSn: this.$route.params.sn })
+        return allocLinkagePutDetailList(params).then(res => {
           const data = res.data
           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
+            // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+            data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
           }
           }
-          this.disabled = false
           return data
           return data
         })
         })
-      }
-		  }
+      },
+      basicInfoData: null //  基本信息
+    }
   },
   },
   methods: {
   methods: {
-		  //  返回列表
-		  handleBack () {
+    //  返回列表
+    handleBack () {
       this.$router.push({ path: '/allocationManagement/chainTransferIn/list' })
       this.$router.push({ path: '/allocationManagement/chainTransferIn/list' })
-		  }
+    },
+    // 基本信息
+    getDetail () {
+      allocLinkagePutDetailSn({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
+    //  编辑
+    handleEdit () {
+      this.$router.push({ path: `/allocationManagement/chainTransferIn/edit/${this.basicInfoData.id}/${this.basicInfoData.allocationLinkagePutSn}` })
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getDetail()
+    })
   }
   }
 }
 }
 </script>
 </script>
 
 
 <style lang="less">
 <style lang="less">
   .chainTransferInDetail-wrap{
   .chainTransferInDetail-wrap{
-    .chainTransferInDetail-back{
-      margin-bottom: 15px;
-    }
     .chainTransferInDetail-cont{
     .chainTransferInDetail-cont{
       margin-bottom: 15px;
       margin-bottom: 15px;
     }
     }

+ 132 - 46
src/views/allocationManagement/chainTransferIn/edit.vue

@@ -1,9 +1,9 @@
 <template>
 <template>
   <div class="chainTransferInEdit-wrap">
   <div class="chainTransferInEdit-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="chainTransferInEdit-back">
+    <a-page-header :ghost="false" :backIcon="false" class="chainTransferInEdit-back" >
       <!-- 自定义的二级文字标题 -->
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
       <template slot="subTitle">
-        <a id="chainTransferInEdit-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
+        <a id="chainTransferInEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
       </template>
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
       <template slot="extra">
@@ -11,9 +11,22 @@
         <a-button key="1" type="primary" id="chainTransferInEdit-print-btn">快速打印</a-button>
         <a-button key="1" type="primary" id="chainTransferInEdit-print-btn">快速打印</a-button>
       </template>
       </template>
     </a-page-header>
     </a-page-header>
+    <!-- 基础信息 -->
+    <a-card size="small" :bordered="false" class="chainTransferInDetail-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1" header="基础信息">
+          <a-descriptions :column="3">
+            <a-descriptions-item label="调入单号">{{ (basicInfoData&&basicInfoData.allocationLinkagePutNo) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="调出对象">{{ (basicInfoData&&basicInfoData.outTenantName) || '--' }}</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>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
     <!-- 总计 -->
     <!-- 总计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">调出对象: <strong>支持市级</strong>,调入单号: <strong>2121212</strong>,总成本:¥<strong>6.33</strong>,总数量: <strong>6</strong> </div>
+      <div slot="message">总款数 <strong>{{ (basicInfoData&&basicInfoData.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (basicInfoData&&basicInfoData.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (basicInfoData&&basicInfoData.productTotalCost) || 0 }}</strong></div>
     </a-alert>
     </a-alert>
     <a-card size="small" :bordered="false" class="chainTransferInEdit-cont">
     <a-card size="small" :bordered="false" class="chainTransferInEdit-cont">
       <!-- 筛选条件 -->
       <!-- 筛选条件 -->
@@ -21,18 +34,26 @@
         <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="chainTransferInEdit-name" v-model="queryParam.name" placeholder="请输入产品编码" allowClear />
+              <a-form-item label="产品编码" prop="productCode">
+                <a-input id="chainTransferInEdit-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="chainTransferInEdit-name" v-model="queryParam.name" placeholder="请输入产品名称" allowClear />
+              <a-form-item label="产品名称" prop="productName">
+                <a-input id="chainTransferInEdit-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="产品类别">
-                <a-cascader :options="typeData" id="chainTransferInEdit-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="chainTransferInEdit-productType"
+                  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;">
@@ -43,13 +64,13 @@
         </a-form>
         </a-form>
       </div>
       </div>
       <!-- 列表 -->
       <!-- 列表 -->
-      <s-table
+      <a-table
         class="sTable"
         class="sTable"
         ref="table"
         ref="table"
         size="default"
         size="default"
         :rowKey="(record) => record.id"
         :rowKey="(record) => record.id"
         :columns="columns"
         :columns="columns"
-        :data="loadData"
+        :dataSource="loadData"
         :scroll="{ x: 1255 }"
         :scroll="{ x: 1255 }"
         bordered>
         bordered>
         <!-- 调入仓库 -->
         <!-- 调入仓库 -->
@@ -64,11 +85,17 @@
             <a-select-option v-for="item in typeData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
             <a-select-option v-for="item in typeData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
           </a-select>
           </a-select>
         </template>
         </template>
-      </s-table>
+      </a-table>
     </a-card>
     </a-card>
     <a-affix :offset-bottom="0">
     <a-affix :offset-bottom="0">
       <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
       <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
-        <a-button type="primary" id="chainTransferInEdit-submit" size="large" class="button-primary" @click="handleSubmit" style="padding: 0 60px;">提交</a-button>
+        <a-button
+          type="primary"
+          id="chainTransferInEdit-submit"
+          size="large"
+          class="button-primary"
+          @click="handleSubmit"
+          style="padding: 0 60px;">提交</a-button>
       </div>
       </div>
     </a-affix>
     </a-affix>
   </div>
   </div>
@@ -76,6 +103,9 @@
 
 
 <script>
 <script>
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
+import { dealerProductTypeList } from '@/api/dealerProductType'
+import { warehouseCascadeList } from '@/api/warehouse'
+import { allocLinkagePutDetailSn } from '@/api/allocLinkagePut'
 export default {
 export default {
   components: { STable, VSelect },
   components: { STable, VSelect },
   data () {
   data () {
@@ -84,8 +114,8 @@ export default {
 
 
       },
       },
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
-      brandData: [], //  产品品牌  下拉数据
-      typeData: [], //  产品类别  下拉数据
+      productTypeList: [], //  产品分类  下拉数据
+      productType: [],
       // 表头
       // 表头
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
@@ -99,36 +129,18 @@ export default {
         { title: '仓库', scopedSlots: { customRender: 'warehouse' }, width: 140, align: 'center' },
         { title: '仓库', scopedSlots: { customRender: 'warehouse' }, width: 140, align: 'center' },
         { title: '仓位', scopedSlots: { customRender: 'warehouseLoc' }, width: 140, align: 'center' }
         { title: '仓位', scopedSlots: { customRender: 'warehouseLoc' }, width: 140, align: 'center' }
       ],
       ],
-      // 加载数据方法 必须为 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)
+      },
+      basicInfoData: null, //  基本信息
+      productTotal: null //  合计
     }
     }
   },
   },
   methods: {
   methods: {
@@ -140,14 +152,88 @@ export default {
       this.queryParam.itemName = ''
       this.queryParam.itemName = ''
       this.oldTime = undefined
       this.oldTime = undefined
       this.newTime = undefined
       this.newTime = undefined
-      this.$refs.table.refresh(true)
+      this.getProductList(1)
+    },
+    // 基本信息
+    getDetail () {
+      allocLinkagePutDetailSn({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data
+          this.getProductList(1)
+          this.getProductType()
+        } else {
+          this.basicInfoData = null
+        }
+      })
     },
     },
     //  提交
     //  提交
     handleSubmit () {},
     handleSubmit () {},
+    // 产品列表数据
+    getProductList (pageNo) {
+      this.disabled = true
+      this.pageNo = pageNo || this.pageNo
+      // 箭冠品牌 sysFlag传1,非箭冠品牌传0。与新增时所选调出产品类型有关
+      this.queryParam.sysFlag = this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0'
+      const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
+      productQuery(params).then(res => {
+        if (res.status == 200) {
+          const data = res.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 = []
+        }
+      })
+    },
+    // 合计
+    getDetailCount (params) {
+      allocLinkageOutDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = null
+        }
+      })
+    },
     //  返回列表
     //  返回列表
     handleBack () {
     handleBack () {
       this.$router.push({ path: '/allocationManagement/chainTransferIn/list' })
       this.$router.push({ path: '/allocationManagement/chainTransferIn/list' })
+    },
+    //  产品分类  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] : ''
+    },
+    //  产品分类  列表
+    getProductType () {
+      dealerProductTypeList({ sysFlag: this.basicInfoData.allocationType == 'JIANGUAN' ? '1' : '0' }).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
+    },
+    getWarehouseCascade () {
+      warehouseCascadeList({}).then(res => {
+
+      })
     }
     }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getDetail()
+      vm.getWarehouseCascade()
+    })
   }
   }
 }
 }
 </script>
 </script>

+ 72 - 41
src/views/allocationManagement/chainTransferIn/list.vue

@@ -14,17 +14,19 @@
                 :format="dateFormat"
                 :format="dateFormat"
                 :placeholder="['开始时间', '结束时间']" />
                 :placeholder="['开始时间', '结束时间']" />
             </a-form-item>
             </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-form-item label="调出对象">
-              <v-select
-                v-model="queryParam.outTenantName"
-                ref="outTenantName"
-                id="chainTransferInList-outTenantName"
-                code="PAYMENT_TYPE"
+              <a-select
                 placeholder="请选择调出对象"
                 placeholder="请选择调出对象"
-                allowClear></v-select>
+                allowClear
+                id="chainTransferInList-putTenantSn"
+                v-model="queryParam.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-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :md="6" :sm="24">
           <a-col :md="6" :sm="24">
@@ -33,20 +35,20 @@
                 v-model="queryParam.allocationType"
                 v-model="queryParam.allocationType"
                 ref="allocationType"
                 ref="allocationType"
                 id="chainTransferInList-allocationType"
                 id="chainTransferInList-allocationType"
-                code="PAYMENT_TYPE"
+                code="ALLOCATION_LINKAGE_PRODUCT_TYPE"
                 placeholder="请选择调拨产品类型"
                 placeholder="请选择调拨产品类型"
                 allowClear></v-select>
                 allowClear></v-select>
             </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="业务状态">
                 <v-select
                 <v-select
                   v-model="queryParam.state"
                   v-model="queryParam.state"
                   ref="state"
                   ref="state"
                   id="chainTransferInList-state"
                   id="chainTransferInList-state"
                   code="PAYMENT_TYPE"
                   code="PAYMENT_TYPE"
-                  placeholder="请选择单据状态"
+                  placeholder="请选择业务状态"
                   allowClear></v-select>
                   allowClear></v-select>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
@@ -70,29 +72,26 @@
       :rowKey="(record) => record.id"
       :rowKey="(record) => record.id"
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
-      :scroll="{ x: 1595 }"
+      :scroll="{ x: 1850 }"
       bordered>
       bordered>
-      <!-- 状态 -->
-      <template slot="state" slot-scope="text, record">
-        <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '待入库': '待审核' }}</a-tag>
+      <!-- 连锁调入单号 -->
+      <template slot="allocationLinkagePutNo" slot-scope="text, record">
+        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.allocationLinkagePutNo }}</span>
       </template>
       </template>
       <!-- 操作 -->
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
       <template slot="action" slot-scope="text, record">
         <a-button size="small" type="link" class="button-primary" @click="handleWarehousing(record)" id="chainTransferInList-warehousing-btn">入库</a-button>
         <a-button size="small" type="link" class="button-primary" @click="handleWarehousing(record)" id="chainTransferInList-warehousing-btn">入库</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
         <a-button size="small" type="link" class="button-warning" @click="handleExamine(record)" id="chainTransferInList-examine-btn">审核</a-button>
         <a-button size="small" type="link" class="button-warning" @click="handleExamine(record)" id="chainTransferInList-examine-btn">审核</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
         <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="chainTransferInList-edit-btn">编辑</a-button>
         <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="chainTransferInList-edit-btn">编辑</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleDetail(record)" id="chainTransferInList-detail-btn">详情</a-button>
       </template>
       </template>
     </s-table>
     </s-table>
   </a-card>
   </a-card>
 </template>
 </template>
 
 
 <script>
 <script>
-import { allocLinkagePutList } from '@/api/allocLinkagePut'
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
+import { allocLinkagePutList, allocLinkagePutAudit, allocLinkagePutSubmit } from '@/api/allocLinkagePut'
+import { getTenantList } from '@/api/allocLinkageOut'
 export default {
 export default {
   components: { STable, VSelect },
   components: { STable, VSelect },
   data () {
   data () {
@@ -102,23 +101,24 @@ export default {
       queryParam: { //  查询条件
       queryParam: { //  查询条件
         outTenantName: undefined, //  调出对象
         outTenantName: undefined, //  调出对象
         allocationType: undefined, //  调拨产品类型
         allocationType: undefined, //  调拨产品类型
-        state: undefined //  单据状态
+        state: undefined //  业务状态
       },
       },
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
       dateFormat: 'YYYY-MM-DD',
       dateFormat: 'YYYY-MM-DD',
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '连锁调出单号', dataIndex: 'productName', width: 140, align: 'center' },
-        { title: '店内单号', dataIndex: 'allocationLinkagePutNo', width: 140, align: 'center' },
-        { title: '调出对象', dataIndex: 'outTenantName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '连锁调入单号', scopedSlots: { customRender: 'allocationLinkagePutNo' }, width: 220, align: 'center' },
+        { title: '店内单号', dataIndex: 'allocatiosnLinkagePutNo', width: 200, align: 'center' },
+        { title: '调出对象', dataIndex: 'outTenantName', 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: '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: '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: 'putWarehouseTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '入库时间', dataIndex: 'putWarehouseTime', 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: 215, align: 'center', fixed: 'right' }
+        { title: '调拨产品类型', dataIndex: 'allocationTypeDictValue', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: 100, align: 'center' },
+        { title: '财务状态', dataIndex: 'settleStateDictValue', width: 100, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 170, align: 'center', fixed: 'right' }
       ],
       ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
@@ -134,8 +134,7 @@ export default {
           return data
           return data
         })
         })
       },
       },
-      openModal: false, //  新增编辑产品品牌  弹框
-      itemId: '' //  当前品牌id
+      putTenantSnData: []
     }
     }
   },
   },
   methods: {
   methods: {
@@ -152,39 +151,71 @@ export default {
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)
     },
     },
     //  入库
     //  入库
-    handleWarehousing () {},
+    handleWarehousing (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要入库吗?',
+        centered: true,
+        onOk () {
+          allocLinkagePutSubmit({ sn: row.allocationLinkagePutSn }).then(res => {
+            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()
-          //   }
-          // })
+          allocLinkagePutAudit({ sn: row.allocationLinkagePutSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
         }
       })
       })
     },
     },
     //  详情
     //  详情
     handleDetail (row) {
     handleDetail (row) {
-      this.$router.push({ path: `/allocationManagement/chainTransferIn/detail/${row.id}/${row.allocationLinkagePutSn}` })
+      this.$router.push({ path: `/allocationManagement/chainTransferIn/detail/${row.allocationLinkagePutSn}` })
     },
     },
     //  新增/编辑
     //  新增/编辑
     handleEdit (row) {
     handleEdit (row) {
       if (row) { //  编辑
       if (row) { //  编辑
-        this.$router.push({ path: `/allocationManagement/chainTransferIn/edit/${row.id}` })
+        this.$router.push({ path: `/allocationManagement/chainTransferIn/edit/${row.id}/${row.allocationLinkagePutSn}` })
       } else { //  新增
       } else { //  新增
         this.$router.push({ path: '/allocationManagement/chainTransferIn/add' })
         this.$router.push({ path: '/allocationManagement/chainTransferIn/add' })
       }
       }
+    },
+    // 调出对象
+    getPutTenantList () {
+      getTenantList({}).then(res => {
+        if (res.status == 200) {
+          this.putTenantSnData = res.data
+        } else {
+          this.putTenantSnData = []
+        }
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
     }
     }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getPutTenantList()
+    })
   }
   }
 }
 }
 </script>
 </script>