chenrui 4 years ago
parent
commit
696777da6d

+ 24 - 1
src/api/sparePartsPur.js

@@ -19,9 +19,24 @@ export const sparePartsPurCount = (params) => {
     method: 'post'
   })
 }
+//  散件采购(入库) 新增
+export const sparePartsPurSave = (params) => {
+  return axios({
+    url: '/sparePartsPur/save',
+    data: params,
+    method: 'post'
+  })
+}
+//  散件采购(入库) 详情
+export const sparePartsPurDetail = (params) => {
+  return axios({
+    url: `/sparePartsPur/findById/${params.id}`,
+    method: 'get'
+  })
+}
 //  散件采购(入库)详情列表  分页
 export const sparePartsPurDetailList = (params) => {
-  const url = `/sparePartsPur/queryDetailPage/${params.pageNo}/${params.pageSize}`
+  const url = `/sparePartsPur/detail/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -30,3 +45,11 @@ export const sparePartsPurDetailList = (params) => {
     method: 'post'
   })
 }
+//  散件采购(入库) 详情列表 合计
+export const sparePartsPurDetailCount = (params) => {
+  return axios({
+    url: '/sparePartsPur/detail/queryCount',
+    data: params,
+    method: 'post'
+  })
+}

+ 5 - 27
src/config/router.config.js

@@ -761,7 +761,7 @@ export const asyncRouterMap = [
                 }
               }
             ]
-          },
+          }
           // {
           //   path: '/inventoryManagement/inventoryChecking',
           //   redirect: '/inventoryManagement/inventoryChecking/list',
@@ -1083,28 +1083,6 @@ export const asyncRouterMap = [
                   hidden: true,
                   permission: 'M_supplier_supplierInfo_list'
                 }
-              },
-              {
-                path: 'add',
-                name: 'supplierInfoAdd',
-                component: () => import(/* webpackChunkName: "shop" */ '@/views/supplierManagement/supplierInfo/edit.vue'),
-                meta: {
-                  title: '新增供应商',
-                  icon: 'team',
-                  hidden: true,
-                  permission: 'B_supplier_supplierInfo_add'
-                }
-              },
-              {
-                path: 'edit/:id',
-                name: 'supplierInfoEdit',
-                component: () => import(/* webpackChunkName: "shop" */ '@/views/supplierManagement/supplierInfo/edit.vue'),
-                meta: {
-                  title: '编辑供应商',
-                  icon: 'team',
-                  hidden: true,
-                  permission: 'B_supplier_supplierInfo_edit'
-                }
               }
             ]
           }
@@ -1145,7 +1123,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'add',
+                path: 'add/:id/:sn',
                 name: 'bulkWarehousingOrderAdd',
                 component: () => import(/* webpackChunkName: "shop" */ '@/views/bulkManagement/bulkWarehousingOrder/edit.vue'),
                 meta: {
@@ -1156,7 +1134,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'edit/:id',
+                path: 'edit/:id/:sn',
                 name: 'bulkWarehousingOrderEdit',
                 component: () => import(/* webpackChunkName: "shop" */ '@/views/bulkManagement/bulkWarehousingOrder/edit.vue'),
                 meta: {
@@ -1178,7 +1156,7 @@ export const asyncRouterMap = [
                 }
               }
             ]
-          },
+          }
           // {
           //   path: '/bulkManagement/bulkReturnGoods',
           //   redirect: '/bulkManagement/bulkReturnGoods/list',
@@ -1418,7 +1396,7 @@ export const asyncRouterMap = [
                 }
               }
             ]
-          },
+          }
           // {
           //   path: '/financialManagement/companyReceivablePayable',
           //   redirect: '/financialManagement/companyReceivablePayable/list',

+ 84 - 22
src/views/bulkManagement/bulkWarehousingOrder/basicInfoModal.vue

@@ -4,7 +4,7 @@
     class="bulkWarehousingOrder-basicInfo-modal"
     :footer="null"
     :maskClosable="false"
-    title="新散件入库单"
+    title="新散件入库单"
     v-model="isShow"
     @cancle="isShow=false"
     width="80%">
@@ -15,42 +15,51 @@
       :rules="rules"
       :label-col="formItemLayout.labelCol"
       :wrapper-col="formItemLayout.wrapperCol" >
-      <a-form-model-item label="供应商" prop="state">
+      <a-form-model-item label="供应商" prop="supplierSn">
         <a-select
           placeholder="请输入名称查询,如果没有请点击 '+' 新增"
           allowClear
-          v-model="form.dataSourceNo"
+          v-model="form.supplierSn"
           :showSearch="true"
           option-filter-prop="children"
           :filter-option="filterOption"
           style="width: 80%;">
-          <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 supplierList" :key="item.supplierSn" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
         </a-select>
-        <a-button icon="plus" size="small" id="bulkWarehousingOrder-basicInfo-add-btn" style="margin-left: 10px;"></a-button>
+        <a-button icon="plus" size="small" @click="openSupplierModal=true" id="bulkWarehousingOrder-basicInfo-add-btn" style="margin-left: 10px;"></a-button>
       </a-form-model-item>
-      <a-form-model-item label="散件入库类型" prop="sort">
-        <v-select
-          v-model="form.billStatus"
-          ref="billStatus"
-          id="bulkWarehousingOrder-basicInfo-billStatus"
-          code="PAYMENT_TYPE"
-          placeholder="请选择散件入库类型"
-          allowClear
-          style="width: 80%;"></v-select>
+      <a-form-model-item label="散件入库类型" prop="sparePartsType">
+        <a-select id="bulkWarehousingOrder-basicInfo-sparePartsType" placeholder="请选择散件入库类型" allowClear v-model="form.sparePartsType">
+          <a-select-option v-for="item in sparePartsPutTypeList" :key="item.sparePartsPutTypeSn" :value="item.sparePartsPutTypeSn">{{ item.name }}</a-select-option>
+        </a-select>
+      </a-form-model-item>
+      <a-form-model-item label="备注" prop="remarks">
+        <a-textarea
+          id="bulkWarehousingOrder-remarks"
+          :maxLength="200"
+          v-model="form.remarks"
+          placeholder="请输入备注(最多200个字符)"
+          allowClear />
       </a-form-model-item>
     </a-form-model>
     <div class="btn-cont">
       <a-button type="primary" id="bulkWarehousingOrder-basicInfo-modal-save" @click="handleSave">保存</a-button>
       <a-button id="bulkWarehousingOrder-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
     </div>
+    <!-- 供应商 -->
+    <supplier-info-edit-modal :openModal="openSupplierModal" @close="closeSupplierModal" />
   </a-modal>
 </template>
 
 <script>
 import { VSelect } from '@/components'
+import supplierInfoEditModal from '@/views/supplierManagement/supplierInfo/editModal.vue'
+import { supplierAllList } from '@/api/supplier'
+import { sparePartsPutTypeAllList } from '@/api/sparePartsPutType'
+import { sparePartsPurSave } from '@/api/sparePartsPur'
 export default {
   name: 'BulkWarehousingOrderBasicInfoModal',
-  components: { VSelect },
+  components: { VSelect, supplierInfoEditModal },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -65,27 +74,76 @@ export default {
         wrapperCol: { span: 16 }
       },
       form: {
-        name: '', // 仓库名称
-        sort: '' //  排序
+        supplierSn: undefined, // 供应商
+        sparePartsType: undefined, //  散件类型
+        remarks: '' // 备注
       },
       rules: {
-        name: [
-          { required: true, message: '请输入仓库名称', trigger: 'blur' }
+        supplierSn: [
+          { required: true, message: '请选择供应商', trigger: 'change' }
+        ],
+        sparePartsType: [
+          { required: true, message: '请选择散件入库类型', trigger: 'change' }
         ]
       },
-      brandData: [] //  供应商  下拉数据
+      supplierList: [], //  供应商  下拉数据
+      sparePartsPutTypeList: [], //  散件入库类型  下拉数据
+      openSupplierModal: false //  供应商 弹框
     }
   },
   methods: {
     //  保存
     handleSave () {
-      this.isShow = false
-      this.$emit('ok')
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          console.log('-----------id', _this.$route.params.id)
+          // form.id = _this.$route.params.id ? _this.$route.params.id : undefined
+          sparePartsPurSave(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
       )
+    },
+    // 供应商下拉数据
+    getSupplierList () {
+      supplierAllList().then(res => {
+        if (res.status == 200) {
+          this.supplierList = res.data
+        } else {
+          this.supplierList = []
+        }
+      })
+    },
+    // 散件入库类型下拉数据
+    getSparePartsPutTypeList () {
+      sparePartsPutTypeAllList().then(res => {
+        if (res.status == 200) {
+          this.sparePartsPutTypeList = res.data
+        } else {
+          this.sparePartsPutTypeList = []
+        }
+      })
+    },
+    // 关闭供应商弹框
+    closeSupplierModal () {
+      this.openSupplierModal = false
+      this.getSupplierList()
     }
   },
   watch: {
@@ -97,6 +155,10 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+      } else {
+        this.getSupplierList()
+        this.getSparePartsPutTypeList()
       }
     }
   }

+ 198 - 160
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -14,18 +14,26 @@
     </a-page-header>
     <!-- 内容 -->
     <a-page-header title="单号:CG2021010100001" ></a-page-header>
-    
+
     <!-- 基础信息 -->
     <a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-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="bulkWarehousingOrderEdit-edit-circle-btn" @click.stop="handleEditInfo" />
+            <!-- <a-button
+              type="primary"
+              shape="circle"
+              size="small"
+              icon="edit"
+              class="edit-circle-btn"
+              id="bulkWarehousingOrderEdit-edit-circle-btn"
+              @click.stop="handleEditInfo" /> -->
           </template>
           <a-descriptions :column="3">
-            <a-descriptions-item label="供应商">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="类型">箭冠营销中心</a-descriptions-item>
+            <a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="类型">{{ (basicInfoData&&basicInfoData.sparePartsTypeName) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
           </a-descriptions>
         </a-collapse-panel>
       </a-collapse>
@@ -50,7 +58,14 @@
                   </a-col>
                   <a-col :md="6" :sm="24">
                     <a-form-item label="产品品牌">
-                      <a-select placeholder="请选择" id="bulkWarehousingOrderEdit-state" allowClear v-model="queryParam.dataSourceNo" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
+                      <a-select
+                        placeholder="请选择"
+                        id="bulkWarehousingOrderEdit-state"
+                        allowClear
+                        v-model="queryParam.dataSourceNo"
+                        :showSearch="true"
+                        option-filter-prop="children"
+                        :filter-option="filterOption">
                         <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
                       </a-select>
                     </a-form-item>
@@ -71,46 +86,50 @@
             <s-table
               class="sTable"
               ref="table"
-              size="default"
+              size="small"
               :rowKey="(record) => record.id"
               :columns="columns"
+              :customRow="handleClickRow"
               :data="loadData"
+              :scroll="{ x: 1700, y: 300 }"
               bordered>
               <!-- 成本价 -->
               <template slot="costPrice" slot-scope="text, record">
                 <a-input-number
                   id="bulkWarehousingOrderEdit-costPrice"
-                  :value="record.costPrice"
+                  v-model="record.costPrice"
                   :precision="2"
                   :min="0"
                   :max="999999"
-                  placeholder="请输入" />
+                  placeholder="请输入"
+                  style="width: 100%;" />
               </template>
               <!-- 数量 -->
               <template slot="quantity" slot-scope="text, record">
                 <a-input-number
                   id="bulkWarehousingOrderEdit-quantity"
-                  :value="record.quantity"
+                  v-model="record.quantity"
                   :precision="0"
                   :min="0"
                   :max="999999"
-                  placeholder="请输入" />
+                  placeholder="请输入"
+                  style="width: 100%;" />
               </template>
               <!-- 仓库 -->
               <template slot="warehouse" slot-scope="text, record">
-                <a-select id="bulkWarehousingOrderEdit-warehouse" placeholder="请选择" allowClear v-model="record.warehouse">
-                	<a-select-option v-for="item in customeList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+                <a-select id="bulkWarehousingOrderEdit-warehouse" placeholder="请选择" allowClear v-model="record.warehouse" style="width: 100%;">
+                  <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
                 </a-select>
               </template>
               <!-- 仓位 -->
               <template slot="position" slot-scope="text, record">
-                <a-select id="bulkWarehousingOrderEdit-position" placeholder="请选择" allowClear v-model="record.position">
-                	<a-select-option v-for="item in customeList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+                <a-select id="bulkWarehousingOrderEdit-position" placeholder="请选择" allowClear v-model="record.position" style="width: 100%;">
+                  <a-select-option v-for="item in warehouseList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.name }}</a-select-option>
                 </a-select>
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="primary" @click="handleAdd(record)" id="bulkWarehousingOrderEdit-add-btn">添加</a-button>
+                <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="bulkWarehousingOrderEdit-add-btn">添加</a-button>
               </template>
             </s-table>
           </div>
@@ -129,13 +148,13 @@
           <div>
             <!-- 总计 -->
             <a-alert type="info" showIcon style="margin-bottom:15px">
-              <div slot="message">总款数 <strong>6</strong> ,总数量 <strong>6</strong> ,总成本¥<strong>6.33</strong></div>
+              <div slot="message">总款数 <strong>{{ (productTotal&&productTotal.productTotalCategory) || 0 }}</strong> ,总数量 <strong>{{ (productTotal&&productTotal.productTotalQty) || 0 }}</strong> ,总成本¥<strong>{{ (productTotal&&productTotal.productTotalCost) || 0 }}</strong></div>
             </a-alert>
             <!-- 列表 -->
             <s-table
               class="sTable"
               ref="table"
-              size="default"
+              size="small"
               :rowKey="(record) => record.id"
               :columns="chooseColumns"
               :data="chooseLoadData"
@@ -144,7 +163,7 @@
               <template slot="costPrice" slot-scope="text, record">
                 <a-input-number
                   id="bulkWarehousingOrderEdit-costPrice"
-                  :value="record.costPrice"
+                  v-model="record.costPrice"
                   :precision="2"
                   :min="0"
                   :max="999999"
@@ -154,7 +173,7 @@
               <template slot="quantity" slot-scope="text, record">
                 <a-input-number
                   id="bulkWarehousingOrderEdit-quantity"
-                  :value="record.quantity"
+                  v-model="record.quantity"
                   :precision="0"
                   :min="0"
                   :max="999999"
@@ -163,13 +182,13 @@
               <!-- 仓库 -->
               <template slot="warehouse" slot-scope="text, record">
                 <a-select id="bulkWarehousingOrderEdit-warehouse" placeholder="请选择" allowClear v-model="record.warehouse">
-                	<a-select-option v-for="item in customeList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+                  <a-select-option v-for="item in warehouseList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
                 </a-select>
               </template>
               <!-- 仓位 -->
               <template slot="position" slot-scope="text, record">
                 <a-select id="bulkWarehousingOrderEdit-position" placeholder="请选择" allowClear v-model="record.position">
-                	<a-select-option v-for="item in customeList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+                  <a-select-option v-for="item in customeList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
                 </a-select>
               </template>
               <!-- 操作 -->
@@ -187,152 +206,171 @@
 </template>
 
 <script>
-  import { STable, VSelect } from '@/components'
-  import basicInfoModal from './basicInfoModal.vue'
-  export default{
-    components: { STable, VSelect, basicInfoModal },
-    data(){
-      return{
-        queryParam: {
-          
-        },
-        brandData: [],  //  产品品牌  下拉数据
-        typeData: [],  //  产品类别  下拉数据
-        disabled: false, //  查询、重置按钮是否可操作
-        // 表头
-        columns: [
-          { title: '产品编码', dataIndex: 'creatDate', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-          { title: '产品名称', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '原厂编码', dataIndex: 'totalP', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '产品品牌', dataIndex: 'custsName', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
-          { title: '单位', dataIndex: 'custsNdame', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '成本价', scopedSlots: { customRender: 'costPrice' }, align: 'center' },
-          { title: '数量', scopedSlots: { customRender: 'quantity' }, align: 'center' },
-          { title: '仓库', scopedSlots: { customRender: 'warehouse' }, align: 'center' },
-          { title: '仓位', scopedSlots: { customRender: 'position' }, align: 'center' },
-          { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, 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)
-          })
-        },
-        // 表头
-        chooseColumns: [
-          { title: '产品编码', dataIndex: 'creatDate', align: 'center', sorter: true },
-          { title: '产品名称', dataIndex: 'custName', align: 'center' },
-          { title: '原厂编码', dataIndex: 'totalP', align: 'center' },
-          { title: '产品品牌', dataIndex: 'custsName', align: 'center', sorter: true },
-          { title: '单位', dataIndex: 'custsNdame', align: 'center' },
-          { title: '成本价', scopedSlots: { customRender: 'costPrice' }, align: 'center' },
-          { title: '数量', scopedSlots: { customRender: 'quantity' }, align: 'center' },
-          { title: '成本小计', dataIndex: 'custsNdsame', align: 'center' },
-          { title: '仓库', scopedSlots: { customRender: 'warehouse' }, align: 'center' },
-          { title: '仓位', scopedSlots: { customRender: 'position' }, align: 'center' },
-          { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
-        ],
-        // 加载数据方法 必须为 Promise 对象
-        chooseLoadData: parameter => {
-          this.disabled = true
-          // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-          //   const data = res.data
-          //   const no = (data.pageNo - 1) * data.pageSize
-          //   for (var i = 0; i < data.list.length; i++) {
-          //     data.list[i].no = no + i + 1
-          //   }
-          //   this.disabled = false
-          //   return data
-          // })
-          const _this = this
-          return new Promise(function(resolve, reject){
-            const data = {
-              pageNo: 1,
-              pageSize: 10,
-              list: [
-                { id: '1', purchaseNo: 'jgqp11111111111', custssName: 0, creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-              ],
-              count: 10
-            }
-            const no = (data.pageNo - 1) * data.pageSize
-            for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1
-            }
-            _this.disabled = false
-            resolve(data)
-          })
-        },
-        openModal: false, // 选择基本信息弹框是否显示
-        customeList: [],  //  仓库  下拉数据
-      }
-    },
-    methods: {
-      //  重置
-      resetSearchForm () {
-        this.queryParam.orderBundleNo = ''
-        this.queryParam.orderBundle.custMobile = ''
-        this.queryParam.bundleName = ''
-        this.queryParam.itemName = ''
-        this.oldTime = undefined
-        this.newTime = undefined
-        this.$refs.table.refresh(true)
-      },
-      //  添加
-      handleAdd(row){},
-      //  删除
-      handleDel(row){},
-      //  编辑基本信息
-      handleEditInfo(){
-        this.openModal = true
-      },
-      //  基本信息  保存
-      handleOk(){
-        
-      },
-      //  导入明细
-      handleImport(){
-        console.log(333)
+import { STable, VSelect } from '@/components'
+import basicInfoModal from './basicInfoModal.vue'
+import { sparePartsPurDetail, sparePartsPurDetailList, sparePartsPurDetailCount } from '@/api/sparePartsPur'
+import { dealerProductList } from '@/api/dealerProduct'
+import { warehouseAllList } from '@/api/warehouse'
+export default {
+  components: { STable, VSelect, basicInfoModal },
+  data () {
+    return {
+      queryParam: {
+        productBrandSn: undefined
+        // productBrandSn: undefined,
       },
-      //  返回列表
-      handleBack(){
-        this.$router.push({ path: '/bulkManagement/bulkWarehousingOrder/list'})
+      brandData: [], //  产品品牌  下拉数据
+      typeData: [], //  产品类别  下拉数据
+      disabled: false, //  查询、重置按钮是否可操作
+      // 表头
+      columns: [
+        { title: '产品编码', dataIndex: 'code', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'origCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productBrandName', width: 200, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', scopedSlots: { customRender: 'costPrice' }, width: 150, align: 'center' },
+        { title: '数量', scopedSlots: { customRender: 'quantity' }, width: 150, align: 'center' },
+        { title: '仓库', scopedSlots: { customRender: 'warehouse' }, width: 200, align: 'center' },
+        { title: '仓位', scopedSlots: { customRender: 'position' }, width: 200, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        return dealerProductList(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
+          this.getWarehouseList()
+          console.log('--------数据', data)
+          return data
+        })
       },
-      filterOption(input, option) {
-      	return (
-      		option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      	)
+      // 表头
+      chooseColumns: [
+        { title: '产品编码', dataIndex: 'creatDate', align: 'center', sorter: true },
+        { title: '产品名称', dataIndex: 'custName', align: 'center' },
+        { title: '原厂编码', dataIndex: 'totalP', align: 'center' },
+        { title: '产品品牌', dataIndex: 'custsName', align: 'center', sorter: true },
+        { title: '单位', dataIndex: 'custsNdame', align: 'center' },
+        { title: '成本价', scopedSlots: { customRender: 'costPrice' }, align: 'center' },
+        { title: '数量', scopedSlots: { customRender: 'quantity' }, align: 'center' },
+        { title: '成本小计', dataIndex: 'custsNdsame', align: 'center' },
+        { title: '仓库', scopedSlots: { customRender: 'warehouse' }, align: 'center' },
+        { title: '仓位', scopedSlots: { customRender: 'position' }, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      chooseLoadData: parameter => {
+        this.disabled = true
+        return sparePartsPurDetailList(Object.assign(parameter, { sparePartsPurchaseSn: 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
+          return data
+        })
       },
+      openModal: false, // 选择基本信息弹框是否显示
+      warehouseList: [], //  仓库  下拉数据
+      basicInfoData: null, //  基本信息
+      productTotal: null //  合计
+    }
+  },
+  methods: {
+    //  重置
+    resetSearchForm () {
+      this.queryParam.orderBundleNo = ''
+      this.queryParam.orderBundle.custMobile = ''
+      this.queryParam.bundleName = ''
+      this.queryParam.itemName = ''
+      this.oldTime = undefined
+      this.newTime = undefined
+      this.$refs.table.refresh(true)
+    },
+    // 双击快速添加
+    handleClickRow (record) {
+      return {
+        on: {
+          dblclick: (event) => {
+            console.log(record)
+          }
+        }
+      }
     },
-    beforeRouteEnter (to, from, next) {
-      next(vm => {
-        vm.openModal = false
+    // 获取详情
+    getDetail () {
+      sparePartsPurDetail({ id: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data
+        } else {
+          this.basicInfoData = null
+        }
       })
+    },
+    //  添加
+    handleAdd (row) {},
+    //  删除
+    handleDel (row) {},
+    //  编辑基本信息
+    handleEditInfo () {
+      this.openModal = true
+    },
+    //  基本信息  保存
+    handleOk () {
+
+    },
+    //  导入明细
+    handleImport () {
+      console.log(333)
+    },
+    //  返回列表
+    handleBack () {
+      this.$router.push({ path: '/bulkManagement/bulkWarehousingOrder/list' })
+    },
+    // 仓库下拉数据
+    getWarehouseList () {
+      warehouseAllList({}).then(res => {
+        if (res.status == 200) {
+          this.warehouseList = res.data
+          const defaultFlagInd = this.warehouseList.findIndex(item => item.defaultFlag == 1)
+          console.log(defaultFlagInd, this.loadData)
+          // this.loadData.map(item => {
+          //   item.warehouse = this.warehouseList[defaultFlagInd].warehouseSn
+          // })
+        } else {
+          this.warehouseList = []
+        }
+      })
+    },
+    // 合计
+    getDetailCount () {
+      sparePartsPurDetailCount({ sparePartsPurchaseSn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        }
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
     }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.openModal = false
+      vm.getDetail()
+      vm.getDetailCount()
+    })
   }
+}
 </script>
 
 <style lang="less">

+ 7 - 8
src/views/bulkManagement/bulkWarehousingOrder/list.vue

@@ -99,7 +99,6 @@
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button size="small" type="primary" @click="handleEdit(record)" class="button-info" id="bulkWarehousingOrderList-edit-btn">编辑</a-button>
-        <a-button size="small" type="primary" @click="handleDetail(record)" class="button-success" id="bulkWarehousingOrderList-detail-btn">详情</a-button>
         <a-button size="small" type="primary" @click="handleWarehouse(record)" class="button-warning" id="bulkWarehousingOrderList-warehouse-btn">入库</a-button>
         <a-button size="small" type="primary" @click="handleDel(record)" class="button-error" id="bulkWarehousingOrderList-del-btn">删除</a-button>
       </template>
@@ -135,7 +134,7 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '散件单号', dataIndex: 'sparePartsPurchaseNo', width: 200, align: 'center' },
+        { title: '散件单号', scopedSlots: { customRender: 'sparePartsPurchaseNo' }, width: 200, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
         { title: '供应商', dataIndex: 'supplierName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品款数', dataIndex: 'productTotalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -143,7 +142,7 @@ export default {
         { title: '总金额', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '业务状态', dataIndex: 'stateDictValue', width: 110, align: 'center' },
         { title: '财务状态', dataIndex: 'settleStateDictValue', width: 110, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 250, align: 'center', fixed: 'right' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -164,7 +163,8 @@ export default {
         productTotalCost: '',
         productTotalQty: ''
       },
-      dataTotalCount: '' //  列表数据总条数
+      dataTotalCount: '', //  列表数据总条数
+      itemId: '' //  当前id
     }
   },
   methods: {
@@ -187,16 +187,15 @@ export default {
       this.openModal = true
     },
     //  基本信息  保存
-    handleOk () {
-      this.$router.push({ path: `/bulkManagement/bulkWarehousingOrder/add` })
+    handleOk (row) {
+      this.$router.push({ path: `/bulkManagement/bulkWarehousingOrder/add/${row.id}/${row.sparePartsPurchaseSn}` })
     },
     //  编辑
     handleEdit (row) {
-      this.$router.push({ path: `/bulkManagement/bulkWarehousingOrder/edit/${row.id}` })
+      this.$router.push({ path: `/bulkManagement/bulkWarehousingOrder/edit/${row.id}/${row.sparePartsPurchaseSn}` })
     },
     //  详情
     handleDetail (row) {
-      console.log(12112)
       this.$router.push({ path: `/bulkManagement/bulkWarehousingOrder/detail/${row.id}` })
     },
     //  入库

+ 1 - 1
src/views/power/role/roleList.vue

@@ -181,7 +181,7 @@ export default {
       this.queryParam.isEnable = ''
       this.refreshTable()
     },
-    // 新
+    // 新
     openModal () {
       this.showModal = true
       this.itemData = {}

+ 1 - 1
src/views/power/user/userList.vue

@@ -152,7 +152,7 @@ export default {
     refreshTable () {
       this.$refs.table.refresh(true)
     },
-    // 新
+    // 新
     openModal () {
       this.showModal = true
       this.itemData = {}

+ 65 - 38
src/views/supplierManagement/supplierInfo/edit.vue → src/views/supplierManagement/supplierInfo/editModal.vue

@@ -1,11 +1,15 @@
 <template>
-  <div class="supplierInfoEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="supplierInfoEdit-cont">
-      <template slot="subTitle">
-        <a href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="supplierInfoEdit-table-page-wrapper">
+  <a-modal
+    centered
+    class="supplierInfoEdit-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="800">
+    <!-- 表单 -->
+    <div>
       <a-form-model
         id="supplierInfoEdit-form"
         ref="ruleForm"
@@ -90,25 +94,40 @@
             <a-radio :value="0">禁用</a-radio>
           </a-radio-group>
         </a-form-model-item>
-        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
-          <a-button type="primary" @click="handleSubmit" size="large" id="supplierInfoEdit-btn-submit" style="padding: 0 60px;">保存</a-button>
-        </a-form-model-item>
       </a-form-model>
-    </a-card>
-  </div>
+      <div class="btn-cont">
+        <a-button type="primary" id="supplierInfoEdit-btn-submit" @click="handleSubmit">保存</a-button>
+        <a-button id="supplierInfoEdit-btn-back" @click="isShow = false" style="margin-left: 15px;">返回列表</a-button>
+      </div>
+    </div>
+  </a-modal>
 </template>
 
 <script>
-import { STable, VSelect } from '@/components'
 import { getArea } from '@/api/data'
 import { supplierDetail, supplierSave } from '@/api/supplier'
 export default {
-  name: 'SupplierInfoEdit',
-  components: { STable, VSelect },
+  name: 'SupplierInfoEditModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  computed: {
+    modalTit () {
+      return this.itemId ? '编辑' : '新增'
+    }
+  },
   data () {
     return {
+      isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
-        labelCol: { span: 4 },
+        labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
       form: {
@@ -166,8 +185,8 @@ export default {
       this.form.supplierName = str
     },
     //  获取供应商信息
-    getGoodsDetail () {
-      supplierDetail({ id: this.$route.params.id }).then(res => {
+    getDetail () {
+      supplierDetail({ id: this.itemId }).then(res => {
         if (res.status == 200) {
           if (res.data.provinceSn) { this.getArea('city', res.data.provinceSn) }
           if (res.data.citySn) { this.getArea('district', res.data.citySn) }
@@ -183,13 +202,11 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = _this.form
-          form.id = this.$route.params.id ? this.$route.params.id : null
+          form.id = this.itemId ? this.itemId : null
           supplierSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              setTimeout(() => {
-                _this.handleBack()
-              }, 1000)
+              _this.isShow = false
             }
           })
         } else {
@@ -198,10 +215,6 @@ export default {
         }
       })
     },
-    //  返回
-    handleBack () {
-      this.$router.push({ path: '/supplierManagement/supplierInfo/list' })
-    },
     // 获取城市列表
     getCityList (val) {
       const index = this.addrProvinceList.findIndex(item => item.sn == val)
@@ -263,25 +276,39 @@ export default {
       })
     }
   },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.getArea('province')
-      vm.$refs.ruleForm.resetFields()
-      if (vm.$route.params.id) { //  编辑页
-        vm.getGoodsDetail()
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+        this.addrCityList = []
+        this.addrDistrictList = []
+      } else {
+        this.getArea('province')
       }
-    })
+    },
+    itemId (newValue, oldValue) {
+      if (this.isShow && newValue) { //  编辑
+        this.getDetail()
+      }
+    }
   }
 }
 </script>
 
 <style lang="less">
-  .supplierInfoEdit-wrap{
-    .supplierInfoEdit-cont{
-      margin-bottom: 15px;
+  .supplierInfoEdit-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
     }
-    .supplierInfoEdit-table-page-wrapper{
-      padding-top: 20px;
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
     }
   }
 </style>

+ 15 - 7
src/views/supplierManagement/supplierInfo/list.vue

@@ -56,14 +56,17 @@
         <span :style="{color:(record.enabledFlag==1?'#00aa00':'#999')}">{{ record.enabledFlagDictValue }}</span>
       </template>
     </s-table>
+    <!-- 供应商 -->
+    <supplier-info-edit-modal :itemId="itemId" :openModal="openModal" @close="closeModal" />
   </a-card>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
 import { supplierList } from '@/api/supplier'
+import supplierInfoEditModal from './editModal.vue'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, supplierInfoEditModal },
   data () {
     return {
       queryParam: { //  查询条件
@@ -99,7 +102,9 @@ export default {
           this.disabled = false
           return data
         })
-      }
+      },
+      itemId: '', //  当前id
+      openModal: false // 弹框
     }
   },
   methods: {
@@ -120,11 +125,14 @@ export default {
     },
     //  新增/编辑
     handleEdit (row) {
-      if (row) { //  编辑
-        this.$router.push({ path: `/supplierManagement/supplierInfo/edit/${row.id}` })
-      } else { //  新增
-        this.$router.push({ path: '/supplierManagement/supplierInfo/add' })
-      }
+      this.itemId = row && row.id ? row.id : null
+      this.openModal = true
+    },
+    // 关闭弹框
+    closeModal () {
+      this.itemId = ''
+      this.openModal = false
+      this.$refs.table.refresh(true)
     }
   }
 }