Browse Source

bug 修复

lilei 2 năm trước cách đây
mục cha
commit
19c7dc84ee

+ 9 - 0
src/api/allocateBill.js

@@ -22,6 +22,15 @@ export const allocDetailQueryPageForReturn = (params) => {
     method: 'post'
   })
 }
+
+// 批量修改部门信息
+export const updateBatchDepartment = params => {
+  return axios({
+    url: '/allocateBill/detail/updateBatchDepartment',
+    data: params,
+    method: 'post'
+  })
+}
 // 调拨管理  新增
 export const allocateBillSave = params => {
   return axios({

+ 8 - 0
src/api/allocateType.js

@@ -27,6 +27,14 @@ export const allocateTypeTreeList = params => {
     method: 'post'
   })
 }
+// 根据级别查询
+export const queryListByTreeLevel = params => {
+  return axios({
+    url: '/allocateType/queryListByTreeLevel',
+    data: params,
+    method: 'post'
+  })
+}
 // 调拨类型管理  新增/编辑
 export const allocateTypeSave = params => {
   return axios({

+ 9 - 7
src/views/allocationManagement/transferOut/basicInfoModal.vue

@@ -53,7 +53,7 @@
                 :options="allocateTypeList"
                 expand-trigger="hover"
                 placeholder="请选择费用/调拨类型"
-                :fieldNames="{ label: 'name', value: 'sn', children: 'sonList' }"/>
+                :fieldNames="{ label: 'name', value: 'allocateTypeSn', children: 'sonList' }"/>
             </a-form-model-item>
           </a-col>
           <a-col :md="12" :sm="24">
@@ -179,12 +179,12 @@ export default {
       console.log(val, opt, '------------')
       this.allocateTypeVal = val
       this.form.costTypeSn = val[0] ? val[0] : ''
-      this.form.allocateTypeSn = val[1] ? val[1] : ''
-      this.form.allocateSortSn = val[2] ? val[2] : ''
+      this.form.allocateSortSn = val[1] ? val[1] : ''
+      this.form.allocateTypeSn = val[2] ? val[2] : ''
       // 名称
       this.form.costTypeName = opt[0] ? opt[0].name : ''
-      this.form.allocateTypeName = opt[1] ? opt[1].name : ''
-      this.form.allocateSortName = opt[2] ? opt[2].name : ''
+      this.form.allocateSortName = opt[1] ? opt[1].name : ''
+      this.form.allocateTypeName = opt[2] ? opt[2].name : ''
     },
     //  产品分类  change
     changeProductType (val, id, opt) {
@@ -312,8 +312,10 @@ export default {
         if (this.detailData) {
           this.isEdit = true
           this.form = Object.assign(this.form, this.detailData)
-          this.allocateTypeVal = [this.detailData.costTypeSn, this.detailData.allocateTypeSn, this.detailData.allocateSortSn]
-          this.productType = [this.detailData.productTypeSn1, this.detailData.productTypeSn2, this.detailData.productTypeSn3]
+          this.allocateTypeVal = [this.detailData.costTypeSn, this.detailData.allocateSortSn, this.detailData.allocateTypeSn]
+          if (this.detailData.productTypeSn1) {
+            this.productType = [this.detailData.productTypeSn1, this.detailData.productTypeSn2, this.detailData.productTypeSn3]
+          }
         }
       }
     }

+ 20 - 1
src/views/allocationManagement/transferOut/detail.vue

@@ -58,9 +58,28 @@
               <a-descriptions-item label="发货编号">{{ (basicInfoData&&basicInfoData.sendNo) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="收货客户名称">{{ (basicInfoData&&basicInfoData.receiverName) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨单号">{{ (basicInfoData&&basicInfoData.allocateNo) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="调拨类型">{{ (basicInfoData&&basicInfoData.allocateTypeName) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="打印状态">{{ (basicInfoData&&basicInfoData.printStateDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="费用类型">
+                {{ (basicInfoData&&basicInfoData.costTypeName) || '--' }}
+              </a-descriptions-item>
+              <a-descriptions-item label="调拨类型">
+                <div>
+                  <span v-if="basicInfoData&&basicInfoData.allocateSortName">{{ basicInfoData.allocateSortName || '--' }}</span>
+                  <span v-if="basicInfoData&&basicInfoData.allocateTypeName">/{{ basicInfoData.allocateTypeName || '--' }}</span>
+                </div>
+              </a-descriptions-item>
+              <a-descriptions-item label="费用归属品牌">
+                {{ (basicInfoData&&basicInfoData.productBrandName) || '--' }}
+              </a-descriptions-item>
+              <a-descriptions-item label="费用归属品类">
+                <div>
+                  <span v-if="basicInfoData&&basicInfoData.productTypeName1">{{ basicInfoData.productTypeName1 || '--' }}</span>
+                  <span v-else>--</span>
+                  <span v-if="basicInfoData&&basicInfoData.productTypeName2">/{{ basicInfoData.productTypeName2 || '--' }}</span>
+                  <span v-if="basicInfoData&&basicInfoData.productTypeName3">/{{ basicInfoData.productTypeName3 || '--' }}</span>
+                </div>
+              </a-descriptions-item>
               <a-descriptions-item label="起止时间">
                 <span v-if="basicInfoData&&(basicInfoData.promoStartDate || basicInfoData.promoEndDate)">{{ (basicInfoData&&basicInfoData.promoStartDate) || '--' }} ~ {{ (basicInfoData&&basicInfoData.promoEndDate) || '--' }}</span>
                 <span v-else>--</span>

+ 163 - 29
src/views/allocationManagement/transferOut/edit.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="allocateBillEdit-wrap">
-    <!-- <a-spin :spinning="spinning" tip="Loading..."> -->
     <div class="ant-spin-nested-loading">
       <a-page-header :ghost="false" :backIcon="false" class="allocateBillEdit-back" >
         <!-- 自定义的二级文字标题 -->
@@ -62,8 +61,8 @@
               </a-descriptions-item>
               <a-descriptions-item label="调拨类型">
                 <div>
-                  <span v-if="basicInfoData.allocateTypeName">{{ basicInfoData.allocateTypeName || '--' }}</span>
-                  <span v-if="basicInfoData.allocateSortName">/{{ basicInfoData.allocateSortName || '--' }}</span>
+                  <span v-if="basicInfoData.allocateSortName">{{ basicInfoData.allocateSortName || '--' }}</span>
+                  <span v-if="basicInfoData.allocateTypeName">/{{ basicInfoData.allocateTypeName || '--' }}</span>
                 </div>
               </a-descriptions-item>
               <a-descriptions-item label="费用归属品牌">
@@ -72,6 +71,7 @@
               <a-descriptions-item label="费用归属品类">
                 <div>
                   <span v-if="basicInfoData.productTypeName1">{{ basicInfoData.productTypeName1 || '--' }}</span>
+                  <span v-else>--</span>
                   <span v-if="basicInfoData.productTypeName2">/{{ basicInfoData.productTypeName2 || '--' }}</span>
                   <span v-if="basicInfoData.productTypeName3">/{{ basicInfoData.productTypeName3 || '--' }}</span>
                 </div>
@@ -129,11 +129,16 @@
               :customRow="handleClickRow"
               :data="loadData"
               :scroll="{ y: 300 }"
-              :defaultLoadData="false"
               bordered>
               <!-- 操作 -->
               <template slot="action1" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-primary" @click="handleAdd(record)" id="allocateBillEdit-add-btn">添加</a-button>
+                <a-button
+                  size="small"
+                  type="link"
+                  class="button-primary"
+                  :loading="spinning"
+                  @click="handleAdd(record, false, 'noRefresh')"
+                >添加</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -153,7 +158,7 @@
             </a-alert>
             <!-- 筛选条件 -->
             <a-row :gutter="15">
-              <a-col :span="17">
+              <a-col :span="16">
                 <div class="table-page-search-wrapper">
                   <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
                     <a-row :gutter="15">
@@ -175,7 +180,13 @@
                   </a-form>
                 </div>
               </a-col>
-              <a-col :span="7" style="text-align: right;">
+              <a-col :span="8" style="text-align: right;">
+                <span v-if="selNums">已选{{ selNums }}项</span>
+                <a-button
+                  style="margin:0 15px;"
+                  size="small"
+                  id="salesEdit-plDel-btn"
+                  @click="openPlSet">批量设置费用归属</a-button>
                 <a-button size="small" id="allocateBillEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
                 <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
               </a-col>
@@ -188,10 +199,11 @@
               index="1"
               tableId="table2"
               :rowKey="(record) => record.id"
+              :row-selection="{ columnWidth: 40 }"
+              @rowSelection="rowSelectionFun"
               :columns="chooseColumns"
               :data="chooseLoadData"
               :scroll="{ y: 300 }"
-              :defaultLoadData="false"
               bordered>
               <!-- 售价 -->
               <template slot="price" slot-scope="text, record, index">
@@ -227,15 +239,35 @@
                   @blur="e => qtyBlur(e.target.value, record)"
                   style="width: 100%;" />
               </template>
+              <!-- 费用归属部门 -->
+              <template slot="department" slot-scope="text, record">
+                <a-select
+                  style="width:100%"
+                  placeholder="请选择部门"
+                  size="small"
+                  allowClear
+                  v-model="record.departmentSn"
+                  :showSearch="true"
+                  @change="e => handleChange(e, record)"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in departmentList" :key="item.departmentSn" :value="item.departmentSn">{{ item.name }}</a-select-option>
+                </a-select>
+              </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="allocateBillEdit-del-btn">删除</a-button>
+                <a-button
+                  size="small"
+                  type="link"
+                  class="button-error"
+                  :loading="spinning"
+                  @click="handleDel(record)"
+                  id="allocateBillEdit-del-btn">删除</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
         </a-collapse>
       </a-card>
-    <!-- </a-spin> -->
     </div>
     <div class="affix-cont" v-if="basicInfoData">
       <a-button
@@ -247,6 +279,7 @@
         @click="handleOpen"
         style="padding: 0 60px;">提交</a-button>
     </div>
+
     <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" :params="{allocateSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" />
     <!-- 打印导出 -->
@@ -261,6 +294,25 @@
     <dsModal ref="dsModal" :dealerLevel="$route.params.dealerLevel" :openModal="showDsModal" @close="showDsModal=false" @ok="handleSubmit" />
     <!-- 编辑基础信息 -->
     <basic-info-modal :openModal="editRemark" :detailData="basicInfoData" @ok="getDetail" @close="editRemark=false" />
+    <!-- 批量设置部门 -->
+    <commonModal modalTit="批量设置费用归属部门" :openModal="showPlModal" @cancel="closePlSet" @ok="setPlSetOk">
+      <div style="text-align: center;">
+        <div style="margin-bottom: 15px;font-size: 14px;"><strong>请选择费用归属部门</strong></div>
+        <div style="line-height: 24px;">
+          <div>
+            <a-select
+              style="width:100%"
+              placeholder="请选择部门"
+              allowClear
+              v-model="plSetVal"
+              :showSearch="true"
+              option-filter-prop="children"
+              :filter-option="filterOption">
+              <a-select-option v-for="item in departmentList" :key="item.departmentSn" :value="item.departmentSn">{{ item.name }}</a-select-option>
+            </a-select></div>
+        </div>
+      </div>
+    </commonModal>
   </div>
 </template>
 
@@ -271,20 +323,23 @@ import ImportGuideModal from './importGuideModal.vue'
 import basicInfoModal from './basicInfoModal.vue'
 import printModal from './printModal.vue'
 import dsModal from './dsModal.vue'
+import commonModal from '@/views/common/commonModal.vue'
 import { printFun, exportExcel } from '@/libs/JGPrint.js'
 import { queryStockProductPage } from '@/api/stock'
 import { productPriceInfo } from '@/api/product'
-import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetail, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert, allocateBillDetailExcel } from '@/api/allocateBill'
+import { departmentQueryList } from '@/api/expenseManagement'
+import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetail, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert, allocateBillDetailExcel, updateBatchDepartment } from '@/api/allocateBill'
 
 export default {
   name: 'TransferOutEdit',
   mixins: [commonMixin],
-  components: { STable, VSelect, ImportGuideModal, printModal, dsModal, basicInfoModal },
+  components: { STable, VSelect, ImportGuideModal, printModal, dsModal, basicInfoModal, commonModal },
   data () {
     return {
       spinning: false,
       showDsModal: false,
       editRemark: false,
+      showPlModal: false,
       queryParam: {
         productCode: '',
         productName: '',
@@ -302,6 +357,7 @@ export default {
       productTypeList: [], //  产品分类  下拉数据
       productType: [],
       warehouseList: [], //  仓库  下拉数据
+      departmentList: [], // 部门列表
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -324,16 +380,17 @@ export default {
         this.chooseDisabled = true
         const params = Object.assign(parameter, this.chooseQueryParam, { allocateSn: this.$route.params.sn })
         return allocateBillDetailList(params).then(res => {
-          this.getDetailCount()
           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
             data.list[i].qtyBackups = data.list[i].qty
             data.list[i].priceBackups = data.list[i].price
+            data.list[i].departmentSn = data.list[i].departmentSn || undefined
           }
           this.localDataSource = data.list || []
           this.chooseDisabled = false
+          this.getDetailCount(params)
           return data
         })
       },
@@ -341,10 +398,15 @@ export default {
       basicInfoData: null, // 基本信息
       openGuideModal: false, //  导入产品引导
       openModal: false,
-      nowType: null
+      nowType: null,
+      rowSelectionInfo: null,
+      plSetVal: undefined
     }
   },
   computed: {
+    selNums () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
+    },
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -376,6 +438,7 @@ export default {
         // { title: '售价', scopedSlots: { customRender: 'price' }, width: '10%', align: 'center' },
         { title: '库存数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '调出数量', scopedSlots: { customRender: 'qty' }, width: '10%', align: 'center' },
+        { title: '费用归属部门', scopedSlots: { customRender: 'department' }, width: '10%', align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
       ]
@@ -390,19 +453,76 @@ export default {
     }
   },
   methods: {
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    // 获取部门数据
+    getDepartmentList () {
+      departmentQueryList({}).then(res => {
+        if (res.status == 200) {
+          this.departmentList = res.data
+        } else {
+          this.departmentList = []
+        }
+      })
+    },
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 批量设置退货原因
+    openPlSet () {
+      if (this.selNums) {
+        this.showPlModal = true
+      } else {
+        this.$message.warning('请先选择产品!')
+      }
+    },
+    closePlSet () {
+      this.showPlModal = false
+      this.plSetVal = undefined
+    },
+    setPlSetOk () {
+      if (!this.plSetVal) {
+        this.$message.warning('请选择费用归属部门!')
+      } else {
+        this.spinning = true
+        const snList = []
+        const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        const department = this.departmentList.find(item => item.departmentSn == this.plSetVal)
+        arr.map(item => {
+          snList.push({
+            'allocateDetailSn': item.allocateDetailSn,
+            'departmentSn': this.plSetVal,
+            'departmentName': department ? department.name : ''
+          })
+        })
+        updateBatchDepartment(snList).then(res => {
+          if (res.status == 200) {
+            this.showPlModal = false
+            this.refashPage()
+          }
+          this.spinning = false
+        })
+      }
+    },
     //  重置
-    resetSearchForm () {
+    resetSearchForm (flag) {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
       this.queryParam.productOrigCode = ''
-      this.$refs.table.refresh(true)
+      if (!flag) {
+        this.$refs.table.refresh(true)
+      }
     },
     // 双击快速添加
     handleClickRow (record) {
       return {
         on: {
           dblclick: (event) => {
-            this.handleAdd(record)
+            this.handleAdd(record, false, 'noRefresh')
           }
         }
       }
@@ -416,10 +536,12 @@ export default {
       })
     },
     // 已选产品  重置
-    chooseResetSearchForm () {
+    chooseResetSearchForm (flag) {
       this.chooseQueryParam.productCode = ''
       this.chooseQueryParam.productName = ''
-      this.$refs.chooseTable.refresh(true)
+      if (!flag) {
+        this.$refs.chooseTable.refresh(true)
+      }
     },
     //  添加/编辑
     handleAdd (row, isEdit, isRefresh) {
@@ -429,7 +551,8 @@ export default {
         cost: isEdit ? row.cost : row.lastStockCost,
         price: isEdit ? row.price : row.productPrice,
         qty: isEdit ? row.qty : 1, //  添加时调出数量默认为1
-        productSn: row.productSn
+        productSn: row.productSn,
+        departmentSn: row.departmentSn
       }
       if (isEdit) { // 编辑
         // 清空数量时,值应保持未清空前的值,因数量不可为空
@@ -466,18 +589,22 @@ export default {
         centered: true,
         onOk () {
           if (isAll) { //  整单删除
+            _this.spinning = true
             allocateBillDetailDelAll({ sn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {
                 _this.$message.success(res.message)
                 _this.refashPage()
               }
+              _this.spinning = false
             })
           } else { //  单个删除
+            _this.spinning = true
             allocateBillDetailDel({ id: row.id }).then(res => {
               if (res.status == 200) {
                 _this.$message.success(res.message)
                 _this.refashPage()
               }
+              _this.spinning = false
             })
           }
         }
@@ -525,8 +652,8 @@ export default {
       })
     },
     // 合计
-    getDetailCount () {
-      allocateBillDetailCount({ allocateSn: this.$route.params.sn }).then(res => {
+    getDetailCount (params) {
+      allocateBillDetailCount({ allocateSn: this.$route.params.sn, ...params }).then(res => {
         if (res.status == 200) {
           this.productTotal = res.data
         } else {
@@ -545,6 +672,10 @@ export default {
         this.handleAdd(record, 'edit', 'noRefresh')
       }
     },
+    // 已选产品 修改部门
+    handleChange (value, record) {
+      this.handleAdd(record, 'edit', 'noRefresh')
+    },
     // 已选产品 售价  change
     priceChange (val, record) {
       //  光标移出,值发生改变再调用编辑接口
@@ -607,13 +738,15 @@ export default {
     },
     // 刷新当前页面
     refashPage () {
-      this.$refs.table.refresh()
+      // this.$refs.table.refresh()
+      this.$refs.chooseTable.clearSelected()
       this.$refs.chooseTable.refresh()
     },
     pageInit () {
+      this.getDepartmentList()
       this.getDetail()
-      this.resetSearchForm()
-      this.chooseResetSearchForm()
+      // this.resetSearchForm(1)
+      // this.chooseResetSearchForm(1)
     }
   },
   mounted () {
@@ -638,10 +771,11 @@ export default {
     position: relative;
     height: 100%;
     box-sizing: border-box;
-    >.ant-spin-nested-loading{
-      overflow-y: scroll;
-      height: 100%;
-      padding-bottom: 51px;
+    > .ant-spin-nested-loading {
+        position: relative;
+        height: 100%;
+        overflow: auto;
+        padding-bottom: 50px;
     }
     .allocateBillEdit-back{
       margin-bottom: 10px;

+ 2 - 2
src/views/allocationManagement/transferOut/list.vue

@@ -17,7 +17,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="调拨类型">
-                <AllocateType id="allocateBillList-allocateTypeSn" v-model="queryParam.allocateTypeSn"></AllocateType>
+                <AllocateType id="allocateBillList-allocateTypeSn" placeholder="请选择调拨类型" v-model="queryParam.allocateTypeSn"></AllocateType>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -118,8 +118,8 @@
         <template slot="allocateType" slot-scope="text, record">
           <div>
             <span v-if="record.costTypeName">{{ record.costTypeName }}/</span>
+            <span v-if="record.allocateSortName">{{ record.allocateSortName }}/</span>
             <span v-if="record.allocateTypeName">{{ record.allocateTypeName }}</span>
-            <span v-if="record.allocateSortName">/{{ record.allocateSortName }}</span>
           </div>
         </template>
         <!-- 操作 -->

+ 15 - 9
src/views/basicData/transferTypeManagement/editModal.vue

@@ -20,7 +20,7 @@
           :wrapper-col="formItemLayout.wrapperCol"
         >
           <a-form-model-item label="调拨类别" prop="allocateCategory">
-            <v-select code="ALLOCATE_CATEGORY" id="transferTypeManagementEdit-allocateCategory" v-model="form.allocateCategory" allowClear placeholder="请选择调拨类别"></v-select>
+            <allocateType id="transferTypeManagementEdit-allocateCategory" @change="changeCategory" :level="2" v-model="form.allocateCategory" placeholder="请选择调拨类别"></allocateType>
           </a-form-model-item>
           <a-form-model-item label="调拨类型名称" prop="name">
             <a-input
@@ -45,10 +45,11 @@
 import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
 import { allocateTypeSave } from '@/api/allocateType'
+import allocateType from '@/views/common/allocateType'
 export default {
   name: 'TransferTypeManagementEditModal',
   mixins: [commonMixin],
-  components: { VSelect },
+  components: { VSelect, allocateType },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -72,21 +73,21 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
-      detailsData: null, //  品牌数据
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
       form: {
         name: '', // 调拨类型名称
-        allocateCategory: undefined //  调拨类别
+        allocateCategory: undefined, //  调拨类别
+        treeLevel: 3
       },
       rules: {
-        name: [
-          { required: true, message: '请输入调拨类型名称', trigger: 'blur' }
-        ],
         allocateCategory: [
           { required: true, message: '请选择调拨类别', trigger: 'change' }
+        ],
+        name: [
+          { required: true, message: '请输入调拨类型名称', trigger: 'change' }
         ]
       }
     }
@@ -99,6 +100,12 @@ export default {
       str = str.replace(/[\r\n]/g, '')
       this.form.name = str
     },
+    changeCategory (v) {
+      if (v) {
+        this.form.allocateCategory = v
+        this.$refs.ruleForm.clearValidate('allocateCategory')
+      }
+    },
     //  保存
     handleSave () {
       const _this = this
@@ -117,7 +124,6 @@ export default {
             }
           })
         } else {
-          console.log('error submit!!')
           return false
         }
       })
@@ -138,7 +144,7 @@ export default {
     itemSn (newValue, oldValue) {
       if (this.isShow && newValue) { //  编辑
         this.form.name = this.nowData && this.nowData.name ? this.nowData.name : ''
-        this.form.allocateCategory = this.nowData && this.nowData.allocateCategory ? this.nowData.allocateCategory : ''
+        this.form.allocateCategory = this.nowData && this.nowData.superior ? this.nowData.superior.allocateTypeSn : ''
       } else { //  添加
         this.form.name = ''
         this.form.allocateCategory = undefined

+ 1 - 1
src/views/basicData/transferTypeManagement/list.vue

@@ -63,7 +63,7 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨类别', dataIndex: 'allocateCategoryDictValue', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类别', dataIndex: 'superior.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调拨类型名称', dataIndex: 'name', align: 'center', width: '40%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
       ],

+ 10 - 6
src/views/common/allocateType.js

@@ -1,8 +1,8 @@
-import { allocateTypeAllList } from '@/api/allocateType'
+import { queryListByTreeLevel } from '@/api/allocateType'
 const AllocateType = {
   template: `
       <a-select
-        placeholder="请选择调拨类型"
+        :placeholder="placeholder"
         :id="id"
         allowClear
         :value="defaultVal"
@@ -15,16 +15,20 @@ const AllocateType = {
     `,
   props: {
     value: {
-      type: String,
+      type: [String,Number],
       defatut: ''
     },
     id: {
       type: String,
       default: ''
     },
-    sysFlag: {
+    level: {
+      type: [String,Number],
+      default: '3'
+    },
+    placeholder:{
       type: String,
-      default: ''
+      default: '请选择'
     }
   },
   data() {
@@ -54,7 +58,7 @@ const AllocateType = {
     },
     //  调拨类型
     getProductBrand () {
-      allocateTypeAllList().then(res => {
+      queryListByTreeLevel({"treeLevel":this.level}).then(res => {
         if (res.status == 200) {
           this.list = res.data
         } else {

+ 15 - 4
src/views/salesManagement/salesQuery/printModal.vue

@@ -35,9 +35,20 @@
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item label="产品售价" prop="priceType">
-          <a-radio-group v-model="form.priceType">
-            <a-radio :value="nowType=='SALES_BILL_TYPE' ? 'SALES_BILL_TYPE_COST' : 'SALES_BILL_COST_NOT_LACK'">{{ nowType=='export' ? '导出' : '打印' }}</a-radio>
-            <a-radio :value="nowType=='SALES_BILL_TYPE' ? 'SALES_BILL_TYPE' : 'SALES_BILL_NOT_LACK'">不{{ nowType=='export' ? '导出' : '打印' }}</a-radio>
+          <!-- 分类打印 -->
+          <a-radio-group v-model="form.priceType" v-if="nowType=='SALES_BILL_TYPE'">
+            <a-radio value="SALES_BILL_TYPE_COST">打印</a-radio>
+            <a-radio value="SALES_BILL_TYPE">不打印</a-radio>
+          </a-radio-group>
+          <!-- 销售打印 -->
+          <a-radio-group v-model="form.priceType" v-if="nowType=='SALES_BILL'">
+            <a-radio value="SALES_BILL_COST">打印</a-radio>
+            <a-radio value="SALES_BILL">不打印</a-radio>
+          </a-radio-group>
+          <!-- 销售导出 -->
+          <a-radio-group v-model="form.priceType" v-if="nowType=='export'">
+            <a-radio value="SALES_BILL_COST_NOT_LACK">导出</a-radio>
+            <a-radio value="SALES_BILL_NOT_LACK">不导出</a-radio>
           </a-radio-group>
         </a-form-model-item>
       </a-form-model>
@@ -83,7 +94,7 @@ export default {
       },
       formItemLayout: {
         labelCol: { span: 6 },
-        wrapperCol: { span: 18 }
+        wrapperCol: { span: 15 }
       },
       spinning: false,
       typeList: []

+ 1 - 1
vue.config.js

@@ -107,7 +107,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.0.115:8602/ocs-admin',
+        target: 'http://192.168.0.215/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  Á·Ï°
         // target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
         ws: false,