소스 검색

修改bug

chenrui 1 년 전
부모
커밋
3b20c481d7
2개의 변경된 파일64개의 추가작업 그리고 121개의 파일을 삭제
  1. 21 56
      src/views/reportData/salesOutofStockReport/detailModal.vue
  2. 43 65
      src/views/reportData/salesOutofStockReport/list.vue

+ 21 - 56
src/views/reportData/salesOutofStockReport/detailModal.vue

@@ -14,15 +14,15 @@
         <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="销售单号">{{ (detailsData&&detailsData.salesOosBillNo) || '--' }}</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
-        <a-alert type="info" style="margin: 10px 0">
+        <a-alert type="info" style="margin: 10px 0" v-if="detailsData">
           <div slot="message">
-            缺货总款数 <strong>{{ (basicInfoData&&(basicInfoData.productTotalCategory || basicInfoData.productTotalCategory==0)) ? basicInfoData.productTotalCategory : '--' }}</strong> ,
-            缺货总数量 <strong>{{ (basicInfoData&&(basicInfoData.productTotalQty || basicInfoData.productTotalQty==0)) ? basicInfoData.productTotalQty : '--' }}</strong>
-            ,缺货总售价<strong>{{ (basicInfoData&&(basicInfoData.productTotalCost || basicInfoData.productTotalCost==0)) ? toThousands(basicInfoData.productTotalCost,2) : '--' }}</strong>
+            缺货总款数 <strong>{{ (detailsData.totalCategory || detailsData.totalCategory==0) ? detailsData.totalCategory : '--' }}</strong> ,
+            缺货总数量 <strong>{{ (detailsData.totalQty || detailsData.totalQty==0) ? detailsData.totalQty : '--' }}</strong>
+            ,缺货总售价<strong>{{ (detailsData.totalAmount || detailsData.totalAmount==0) ? toThousands(detailsData.totalAmount,2) : '--' }}</strong>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -35,20 +35,6 @@
           :data="loadData"
           :defaultLoadData="false"
           bordered>
-          <!-- 仓库仓位 -->
-          <template slot="warehouse" slot-scope="text, record, index">
-            <a-cascader
-              size="small"
-              @change="e => changeWarehouseCascade(e, record, index)"
-              v-model="record.warehouseCascade"
-              expand-trigger="hover"
-              :allowClear="false"
-              :options="warehouseCascadeData"
-              :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-              id="chainTransferInEdit-warehouseCascade"
-              placeholder="请选择仓库仓位"
-              style="width: 100%;" />
-          </template>
         </s-table>
       </a-spin>
     </div>
@@ -57,63 +43,45 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { findPayDetail } from '@/api/settlePay.js'
+import { salesOosQueryDetailList } from '@/api/reportData.js'
 import { STable } from '@/components'
-import Print from '@/views/common/print.vue'
-import { getOperationalPrecision } from '@/libs/tools.js'
-import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'FinancialPaymentDetailModal',
   mixins: [commonMixin],
-  components: { STable, Print },
+  components: { STable },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
-    },
-    itemId: {
-      type: [Number, String],
-      default: ''
     }
   },
   data () {
+    const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓库', dataIndex: 'unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '缺货数量', dataIndex: 'putQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '缺货金额', dataIndex: 'costSubtotal', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '仓库', dataIndex: 'warehouseName', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'origCode', width: '13%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
+        { title: '缺货数量', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货金额', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '单位', dataIndex: 'unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      localDataSource: [],
+      detailsData: null,
       loadData: parameter => {
         this.spinning = true
-        const params = Object.assign(parameter, this.queryParam, { allocationLinkagePutSn: this.$route.params.sn })
-        return allocLinkagePutDetailList(params).then(res => {
+        const params = Object.assign(parameter, this.queryParam, { salesOosBillSn: this.detailsData.salesOosBillSn })
+        return salesOosQueryDetailList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            this.getDetailCount(params)
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
-              const warehouseSn = data.list[i].warehouseSn || undefined
-              const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
-              data.list[i].warehouseSnBackups = warehouseSn
-              data.list[i].warehouseLocationSnBackups = warehouseLocationSn
-              if (warehouseSn || warehouseLocationSn) {
-                data.list[i].warehouseCascade = [warehouseSn, warehouseLocationSn]
-              } else {
-                data.list[i].warehouseCascade = undefined
-              }
-              // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
-              data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
             }
-            this.localDataSource = data.list || []
           }
           this.spinning = false
           return data
@@ -123,13 +91,10 @@ export default {
   },
   methods: {
     //  获取详情
-    getDetail (id) {
-      findPayDetail({ id: id }).then(res => {
-        if (res.status == 200) {
-          this.detailsData = res.data
-        } else {
-          this.detailsData = null
-        }
+    getDetail (obj) {
+      this.detailsData = obj
+      this.$nextTick(() => {
+        this.$refs.table.refresh()
       })
     }
   },

+ 43 - 65
src/views/reportData/salesOutofStockReport/list.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="table-page-search-wrapper">
       <!-- 搜索条件 -->
       <a-form-model
-        id="salesReturnReportList-form"
+        id="salesOutofStockReport-form"
         ref="ruleForm"
         class="form-model-con"
         layout="inline"
@@ -20,12 +20,20 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="客户名称">
-              <custList id="salesReturnReportList-buyerName" ref="custSatelliteList" @change="custSatelliteChange"></custList>
+              <custList id="salesOutofStockReport-buyerName" ref="custSatelliteList" @change="custSatelliteChange"></custList>
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesReturnReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnReportList-reset">重置</a-button>
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesOutofStockReport-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesOutofStockReport-reset">重置</a-button>
+            <a-button
+              style="margin-left: 5px"
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              id="salesOutofStockReport-export">导出</a-button>
           </a-col>
         </a-row>
       </a-form-model>
@@ -64,7 +72,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import custList from '@/views/common/custList.vue'
 import detailModal from './detailModal.vue'
-import { reportSalesReturnPageList, reportSalesReturnBillTotal, reportSalesReturnExport } from '@/api/reportData'
+import { salesOosQueryList, salesOosExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate, custList, detailModal },
   mixins: [commonMixin],
@@ -73,20 +81,14 @@ export default {
       spinning: false,
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
-      advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
       queryParam: { //  查询条件
         time: [],
         beginDate: '',
         endDate: '',
-        buyerNameCurrent: undefined, // 客户名称
-        buyerSnCurrent: undefined, // 客户sn
-        salesReturnNo: ''
-      },
-      openDetailModal: true,
-      rules: {
-        'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
+        targetName: undefined, // 客户名称
+        targetSn: undefined // 客户sn
       },
+      openDetailModal: false, // 详情弹窗
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
@@ -95,16 +97,13 @@ export default {
         const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
         delete params.time
-        return reportSalesReturnPageList(params).then(res => {
+        return salesOosQueryList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            // 总计
-            this.getCount(params)
             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].inStockQty = data.list[i].totalQty
             }
             this.disabled = false
           }
@@ -112,7 +111,9 @@ export default {
           return data
         })
       },
-      totalData: null //  合计
+      rules: {
+        'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
+      }
     }
   },
   computed: {
@@ -120,9 +121,9 @@ export default {
       const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'auditTime', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', dataIndex: 'salesReturnNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'buyerName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '创建时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesOosBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'targetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '缺货次数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '缺货数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '缺货金额', dataIndex: 'totalAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
@@ -132,18 +133,23 @@ export default {
     }
   },
   methods: {
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          this.$message.info('请至少输入一个查询条件')
+          return false
+        }
+      })
+    },
     // 查看详情
     handleDetail (row) {
       this.openDetailModal = true
-    },
-    // 合计
-    getCount (params) {
-      reportSalesReturnBillTotal(params).then(res => {
-        if (res.status == 200) {
-          this.totalData = res.data
-        } else {
-          this.totalData = null
-        }
+      const _this = this
+      this.$nextTick(() => {
+        _this.$refs.detailModal.getDetail(row)
       })
     },
     //  创建时间  change
@@ -152,17 +158,6 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
-    //  查询
-    handleSearch () {
-      this.$refs.ruleForm.validate(valid => {
-        if (valid) {
-          this.$refs.table.refresh(true)
-        } else {
-          console.log('error submit!!')
-          return false
-        }
-      })
-    },
     custSatelliteChange (v, row) {
       if (row && row.customerSn) {
         this.queryParam.buyerSnCurrent = row.customerSn
@@ -178,12 +173,10 @@ export default {
       this.queryParam.time = []
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.salesReturnNo = ''
       this.queryParam.buyerNameCurrent = undefined
       this.queryParam.buyerSnCurrent = undefined
-      this.$refs.custSatelliteList.resetForm()
       this.$refs.ruleForm.resetFields()
-      this.totalData = null
+      this.$refs.custSatelliteList.resetForm()
       this.$refs.table.clearTable()
     },
     // 导出
@@ -192,37 +185,22 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const params = _this.queryParam
-          params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
           _this.exportLoading = true
           _this.spinning = true
-          reportSalesReturnExport(params).then(res => {
-            downloadExcel(res, '销售退货报表')
+          salesOosExport(params).then(res => {
+            downloadExcel(res, '销售货报表')
             _this.exportLoading = false
             _this.spinning = false
           })
         } else {
-          console.log('error submit!!')
+          this.$message.info('请至少输入一个查询条件')
           return false
         }
       })
     },
-    pageInit () {}
-  },
-  mounted () {
-    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
-      this.resetSearchForm()
-    }
-  },
-  activated () {
-    // 如果是新页签打开,则重置当前页面
-    if (this.$store.state.app.isNewTab) {
-      this.pageInit()
-      this.resetSearchForm()
+    beforeRouteEnter (to, from, next) {
+      next(vm => {})
     }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {})
   }
 }
 </script>