Explorar el Código

Merge branch 'develop_cuxiao' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_cuxiao

chenrui hace 1 año
padre
commit
b1320217ad

+ 44 - 16
src/views/expenseManagement/expenseReimbursement/baseDataModal.vue

@@ -125,6 +125,7 @@ export default {
         labelCol: { span: 6 },
         wrapperCol: { span: 14 }
       },
+      fromPage: null,
       attachList: [],
       attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
       expenseTypes: [],
@@ -167,17 +168,32 @@ export default {
     },
     pageInit () {
       this.$nextTick(() => {
-        this.attachList = []
-        this.form.expenseAccountFilesList = ''
-        this.$refs.attachList.setFileList('')
-        this.$refs.ruleForm.resetFields()
-        this.expenseTypes = []
         if (this.expenseAccountSn) { //  编辑页
           this.getDetail()
           this.title = '编辑费用报销单'
+        }else{
+          this.title = '新增费用报销单'
         }
       })
     },
+    retsetForm(){
+      this.form = {
+        applyPersonSn: undefined, // 申请人
+        applyDepartmentSn: undefined, //  申请部门
+        expenseType: undefined, //  费用类型1
+        expenseType2: undefined, //  费用类型2
+        expenseTypeName: undefined, //  费用类型1
+        expenseTypeName2: undefined, //  费用类型2
+        expenseDate: moment().locale('zh-cn').format('YYYY-MM'), //  费用产生月
+        title: '', // 主题
+        content: '' // 费用说明
+      }
+      this.attachList = []
+      this.form.expenseAccountFilesList = ''
+      this.$refs.attachList.setFileList('')
+      this.$refs.ruleForm.resetFields()
+      this.expenseTypes = []
+    },
     // 申请人员
     employeeChange (v, r) {
       if (r.departmentSn) {
@@ -214,23 +230,28 @@ export default {
         item.fileType = item.extName
       })
     },
+    // 设置数据
+    setDetail(data, from){
+      console.log(data)
+      this.fromPage = from
+      this.form = Object.assign(this.form, data)
+      // 获取附件列表
+      if(this.$refs.attachList){
+        this.form.expenseAccountFilesList = ''
+        this.attachList = data.expenseAccountFilesList
+        this.$refs.attachList.setFileList(this.attachList)
+      }
+      setTimeout(()=>{
+        this.expenseTypes = data.expenseType ? [this.form.expenseType, this.form.expenseType2] : []
+      }, 500)
+    },
     //  详情
     getDetail () {
       this.spinning = true
       this.disabled = true
       expenseAccountDetail({ expenseAccountSn: this.expenseAccountSn }).then(res => {
         if (res.status == 200) {
-          const data = res.data
-          this.form = Object.assign(this.form, data)
-          // 获取附件列表
-          this.form.expenseAccountFilesList = ''
-          this.attachList = res.data.expenseAccountFilesList
-          this.$refs.attachList.setFileList(this.attachList)
-          if (this.form.expenseType) {
-            this.expenseTypes = [this.form.expenseType, this.form.expenseType2]
-          } else {
-            this.expenseTypes = []
-          }
+          this.setDetail(res.data)
         } else {
           this.$refs.ruleForm.resetFields()
         }
@@ -249,6 +270,11 @@ export default {
           form.expenseAccountFilesList = this.attachList
           _this.spinning = true
           console.log(form)
+          // 从销售单转的费用
+          if(_this.fromPage=='sales'){
+            _this.$emit('expenseSaveOk',form)
+            return false
+          }
           expenseAccountSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
@@ -276,6 +302,8 @@ export default {
       this.opened = newValue
       if (newValue) {
         this.pageInit()
+      }else{
+        this.retsetForm()
       }
     },
     itemSn (a, b) {

+ 4 - 9
src/views/salesManagement/salesQueryNew/comps/activeQueryPart.vue

@@ -78,7 +78,7 @@
       </template>
       <!-- 价格 -->
       <template slot="productPrice" slot-scope="text, record">
-         {{ text||text==0 ? text : '--' }} <span title="原价" v-if="promoProductClz == 'GIFT' || promoProductClz == 'DISCOUNT'">({{ record.origPrice||record.origPrice==0 ? record.origPrice : '--' }})</span>
+         {{ text||text==0 ? toThousands(text) : '--' }} <span title="原价" v-if="promoProductClz == 'GIFT' || promoProductClz == 'DISCOUNT'">({{ record.origPrice||record.origPrice==0 ? toThousands(record.origPrice) : '--' }})</span>
       </template>
       <!-- 产品名称 -->
       <template slot="productName" slot-scope="text, record">
@@ -181,7 +181,7 @@ export default {
       const arr = [
         { title: '产品编码', dataIndex: 'productCode', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', scopedSlots: { customRender: 'productName' }, align: 'left' },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '品牌', dataIndex: 'productBrandName', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '出库仓库', dataIndex: 'warehouseName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '库存数量', dataIndex: 'currentStockQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -194,7 +194,7 @@ export default {
       ]
       let idx = 7
       if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
-        arr.splice(idx, 0, { title: '售价', dataIndex: 'productPrice', width: '60px', align: 'right', scopedSlots: { customRender: 'productPrice' } })
+        arr.splice(idx, 0, { title: '售价', dataIndex: 'productPrice', width: '100px', align: 'right', scopedSlots: { customRender: 'productPrice' } })
         idx = idx + 1
       }
       // 促销品没有起订量
@@ -228,12 +228,7 @@ export default {
       return {
         on: {
           dblclick: (event) => {
-            if (!record.productPrice || record.productPrice <= 0) {
-              _this.$message.info('该产品暂时不能添加')
-            } else {
-              event.stopPropagation()
-              _this.$emit('add', record, 0, this.promoProductClz)
-            }
+            _this.handleAdd(record)
           }
         }
       }

+ 2 - 5
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -124,10 +124,7 @@
               ftext = '槛'
               fcolor = '#108ee9'
             }
-            if(record.promotionFlag == 'DISCOUNT'){
-              ftext = '特'
-              fcolor = '#faad14'
-            }
+             
             return (
                     <div>
                         <span style="padding-right: 15px;">{data}</span>
@@ -158,7 +155,7 @@
                         {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>):('')}
                         {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount>0 ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
                         {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount<0 ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
-                        {record.expenseAccountFlag!='WAIT' ? record.expenseAccountFlagDictValue : ''}
+                        {record.total&&record.total.expenseAccountFlag!='WAIT' ? (<span style="color:red;">{record.total.expenseAccountFlagDictValue}</span>) : ''}
                     </div>
                   </div>
                 ):(<span>{data}</span>)}

+ 6 - 6
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -163,7 +163,7 @@
       <template slot="productCode" slot-scope="text, record">
         <span style="padding-right: 15px;">{{ text }}</span>
         <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
-        <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
+        <!-- <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge> -->
         <a-badge count="槛" v-if="record.promotionFlag=='GATE'" :number-style="{ backgroundColor: '#108ee9', zoom:'80%' }"></a-badge>
         <a-badge count="缺" v-if="Number(record.stockQty||0) < Number(record.unpushedQty||0)" :number-style="{ zoom:'80%' }"></a-badge>
       </template>
@@ -182,12 +182,12 @@
        <!-- 销售价 -->
        <template slot="price" slot-scope="text, record">
         {{ toThousands(text) }}
-        <span v-if="record.promotionFlag=='GIFT'" title="原价">({{ toThousands(record.origPrice) }})</span>
+        <span v-if="record.promotionFlag=='GIFT'||record.promotionFlag=='DISCOUNT'" title="原价">({{ toThousands(record.origPrice) }})</span>
       </template>
-      <!-- 促销价 -->
+      <!-- 折扣 -->
       <template slot="discountPrice" slot-scope="text, record">
-        <span>{{ toThousands(record.discountedPrice) }}</span>
-        ({{ record.discountRate }}%)
+        <span v-if="record.promotionFlag=='DISCOUNT'">{{ record.discountRate }}%</span>
+        <span v-else>--</span>
       </template>
       <!-- 销售数量 -->
       <template slot="salesNums" slot-scope="text, record">
@@ -423,7 +423,7 @@
           // 如果是特价活动
           if(this.promo.promotionRule.promotionRuleType=='PROMO_PROD'){
             idx = idx + 1
-            arr.splice(5, 0, { title: '促销价', dataIndex: 'discountPrice', width: '6%', align: 'right', scopedSlots: { customRender: 'discountPrice' }})
+            arr.splice(5, 0, { title: '折扣', dataIndex: 'discountPrice', width: '6%', align: 'right', scopedSlots: { customRender: 'discountPrice' }})
           }
           arr.splice(8+idx, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         }

+ 1 - 1
src/views/salesManagement/salesQueryNew/edit.vue

@@ -264,7 +264,7 @@ export default {
     },
     showNewActiveOk(){
       this.showNewActiveModal = false
-      this.pageInit()
+      this.getOrderDetail(true)
     },
     // 添加产品,包括正常和活动的产品
     closeProductModal(){

+ 16 - 3
src/views/salesManagement/salesQueryNew/list.vue

@@ -273,6 +273,8 @@
         </div>
       </div>
     </commonModal>
+    <!-- 新增费用单 -->
+    <baseDataModal ref="expenseModal" @expenseSaveOk="expenseSaveOk" :show="openBaseModal" @close="openBaseModal=false"></baseDataModal>
     <!-- 导出提示框 -->
     <reportModal :visible="showExport" @close="showExport=false"></reportModal>
   </a-card>
@@ -290,6 +292,7 @@ import { STable, VSelect } from '@/components'
 import commonModal from '@/views/common/commonModal.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import baseDataModal from '@/views/expenseManagement/expenseReimbursement/baseDataModal.vue'
 import reportModal from '@/views/common/reportModal.vue'
 import { salesList, salesDel,salesCancle, salesCount, queryCreateBySalesBillSn, expenseAccountSave } from '@/api/salesNew'
 import { hdExportExcel } from '@/libs/exportExcel'
@@ -299,13 +302,14 @@ import { salesDetailExport } from '@/api/salesBillReport'
 export default {
   name: 'SalesQueryList',
   mixins: [commonMixin],
-  components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, Area, rangeDate, subarea, commonModal, reportModal, chooseWarehouse },
+  components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, Area, rangeDate, subarea, commonModal, reportModal, chooseWarehouse, baseDataModal },
   data () {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 选择客户弹框是否显示
+      openBaseModal: false, // 费用弹框
       showTipModal: false, // 备货打印弹框
       showExport: false,
       exportLoading: false,
@@ -525,10 +529,10 @@ export default {
           </div>,
           onOk() {
             if(_this.expenseOption){
-              _this.expenseOption = null
               _this.expenseSave(hasExpense,_this.expenseOption)
             }else{
               _this.$message.info("请选择费用报销单类型!")
+              return true
             }
           },
           onCancel() {
@@ -543,11 +547,20 @@ export default {
     // 转费用单
     expenseSave(data, type){
       console.log(data,type)
-      const params = type ? data[type] : data.balance||data.exceed
+      const params = type ? data[type] : (data.balance||data.exceed)
+      if(params){
+        this.openBaseModal = true
+        this.$refs.expenseModal.setDetail(params, 'sales')
+      }
+    },
+    expenseSaveOk(params){
       expenseAccountSave(params).then(res => {
         if(res.status == 200){
           this.$message.info(res.message)
           this.$refs.table.refresh()
+          this.openBaseModal = false
+          this.expenseOption = null
+          this.$router.push({ name: 'expenseReimbursementEdit', params: { sn: res.data.expenseAccountSn } })
         }
       })
     },

+ 4 - 5
src/views/salesManagement/waitDispatchNew/detailProductList.vue

@@ -127,10 +127,7 @@
             ftext = '槛'
             fcolor = '#108ee9'
           }
-          if(record.promotionFlag == 'DISCOUNT'){
-            ftext = '特'
-            fcolor = '#faad14'
-          }
+           
           return (
                   <div>
                       <span style="padding-right: 15px;">{data}</span>
@@ -179,7 +176,7 @@
         let arr= [
               { title: "", field: "", key: "acheck", type: "checkbox", align: "center" },
               { title: '序号', field: 'no',key: "a", width: 50, align: 'center', operationColumn: false },
-              { title: '活动规则', field: 'productCode',key: "m", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row,row[column.field],h)} },
+              { title: '活动规则', field: 'prompName',key: "m", width: 100, align: 'center',operationColumn: false },
               { title: '产品编码', field: 'productCode',key: "b", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row,row[column.field],h)} },
               { title: '产品名称', field: 'productName',key: "c", width: 200, align: 'center',operationColumn: false , ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
               { title: '出库仓库', field: 'warehouseName',key: "e", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
@@ -241,12 +238,14 @@
             const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
             const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
             const warehouseName = item.dispatchBill && item.dispatchBill.warehouseName || ''
+            const prompName = item.promotionRule ? (item.promotionRule.promotion && item.promotionRule.promotion.description) + '('+item.promotionRule.description+')' : '--'
             item.productCode = productCode || '--'
             item.productName = productName || '--'
             item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
             item.productOrigUnit = productOrigUnit || '--'
             item.warehouseName = warehouseName || '--'
             item.qtyBackups = item.qty
+            item.prompName = prompName || '--'
           })
           this.showEmpty = this.dataSource.length <= 0
           this.tableHeight = (this.showEmpty ? 300 : this.maxHeight) + 'px'

+ 4 - 5
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -230,10 +230,7 @@ export default {
               ftext = '槛'
               fcolor = '#108ee9'
             }
-            if(record.promotionFlag == 'DISCOUNT'){
-              ftext = '特'
-              fcolor = '#faad14'
-            }
+             
             return (
                     <div>
                         <span style="padding-right: 15px;">{data}</span>
@@ -402,8 +399,10 @@ export default {
         const params = this.queryParam
         if(params.promoFlag){
           params.isGifg = params.promoFlag == 1 ? 'Y' : 'N'
+        }else{
+          params.isGifg = undefined
         }
-        
+ 
         const active = this.activeList
 
         // 正常产品