瀏覽代碼

bug修复

chenrui 3 年之前
父節點
當前提交
df95d78e3f

+ 6 - 2
src/views/notice/list.vue

@@ -94,7 +94,8 @@ export default {
       if (a !== b && a) {
         // 新未读消息
         if (a.type == 'no_read_count') {
-          this.resetSearchForm()
+          this.resetData()
+          this.handelSearch()
         }
       }
     }
@@ -156,6 +157,10 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.resetData()
+      this.handelSearch(1)
+    },
+    resetData () {
       this.$refs.rangeDate.resetDate()
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
@@ -164,7 +169,6 @@ export default {
       this.pageSize = 10
       this.paginationProps.total = 0
       this.paginationProps.current = 1
-      this.handelSearch(1)
     },
     //  详情
     handleDetail (row) {

+ 105 - 105
src/views/reportData/chainReceivedSendStorageReport/list.vue

@@ -1,9 +1,9 @@
 <template>
-  <a-card size="small" :bordered="false" class="chainStockReportList-wrap">
+  <a-card size="small" :bordered="false" class="sendStorageReportList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
       <a-form-model
-        id="chainStockReportList-form"
+        id="sendStorageReportList-form"
         ref="ruleForm"
         :model="queryParam"
         :rules="rules"
@@ -15,7 +15,7 @@
             <a-form-model-item label="连锁店" prop="targetName">
               <a-select
                 placeholder="请选择连锁店"
-                id="chainStockReportList-targetName"
+                id="sendStorageReportList-targetName"
                 allowClear
                 v-model="queryParam.targetName"
                 :showSearch="true"
@@ -26,26 +26,26 @@
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="日期">
-              <rangeDate ref="rangeDate" />
-            </a-form-item>
+            <a-form-model-item label="日期">
+              <rangeDate ref="rangeDate" @change="dateChange" />
+            </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="产品编码">
-              <a-input id="productInfoList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
-            </a-form-item>
+            <a-form-model-item label="产品编码">
+              <a-input id="sendStorageReportList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
+            </a-form-model-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品名称">
-                <a-input id="productInfoList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-              </a-form-item>
+              <a-form-model-item label="产品名称">
+                <a-input id="sendStorageReportList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品品牌">
+              <a-form-model-item label="产品品牌">
                 <a-select
                   placeholder="请选择产品品牌"
-                  id="productInfoList-productBrandSn"
+                  id="sendStorageReportList-productBrandSn"
                   allowClear
                   v-model="queryParam.productBrandSn"
                   :showSearch="true"
@@ -53,10 +53,10 @@
                   :filter-option="filterOption">
                   <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
                 </a-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品分类">
+              <a-form-model-item label="产品分类">
                 <a-cascader
                   @change="changeProductType"
                   change-on-select
@@ -64,15 +64,15 @@
                   expand-trigger="hover"
                   :options="productTypeList"
                   :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="productInfoList-productType"
+                  id="sendStorageReportList-productType"
                   placeholder="请选择产品分类"
                   allowClear />
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainStockReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainStockReportList-reset">重置</a-button>
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="sendStorageReportList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="sendStorageReportList-reset">重置</a-button>
             <a @click="advanced=!advanced" style="margin-left: 8px">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -89,7 +89,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1170 }"
+      :scroll="{ x: 2390 }"
       bordered>
     </s-table>
   </a-card>
@@ -109,6 +109,8 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         targetName: undefined,
         code: '', //  产品编码
         name: '', //  产品名称
@@ -126,109 +128,98 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '序号',
+          dataIndex: 'no',
+          width: 80,
+          align: 'center',
+          customRender: function (value, row, index) {
+            const obj = { children: value, attrs: {} }
+            if (value == '合计') {
+              console.log(111)
+              obj.attrs.colSpan = 7
+            }
+            return obj
+          }
+          // fixed: 'left'
+        },
         { title: '产品编码',
           dataIndex: 'code',
-          width: 250,
+          width: 220,
           align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{text}</span>,
-                attrs: {
-                  colSpan: 6
-                }
-              }
-            }
-            return text || '--'
-          } },
+          customRender: function (value, row, index) {
+            value = value || '--'
+            const obj = { children: value, attrs: {} }
+            if (value == '合计') { obj.attrs.colSpan = 0 }
+            return obj
+          }
+        },
         { title: '产品名称',
           dataIndex: 'name',
           align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{text}</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
+          customRender: function (value, row, index) {
+            value = value || '--'
+            const obj = { children: value, attrs: {} }
+            if (value == '合计') { obj.attrs.colSpan = 0 }
+            return obj
           },
-          ellipsis: true },
+          ellipsis: true
+        },
         { title: '品牌',
           dataIndex: 'brand',
           align: 'center',
           width: 200,
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{text}</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '三级类别',
+          customRender: function (value, row, index) {
+            value = value || '--'
+            const obj = { children: value, attrs: {} }
+            if (value == '合计') { obj.attrs.colSpan = 0 }
+            return obj
+          }
+        },
+        { title: '三级分类',
           dataIndex: 'productLeve',
           width: 150,
           align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{text}</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
+          customRender: function (value, row, index) {
+            value = value || '--'
+            const obj = { children: value, attrs: {} }
+            if (value == '合计') { obj.attrs.colSpan = 0 }
+            return obj
+          }
+        },
         { title: '原厂编码',
           dataIndex: 'origCode',
-          width: 150,
+          width: 220,
           align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{text}</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
+          customRender: function (value, row, index) {
+            value = value || '--'
+            const obj = { children: value, attrs: {} }
+            if (value == '合计') { obj.attrs.colSpan = 0 }
+            return obj
+          }
+        },
         { title: '单位',
           dataIndex: 'unit',
-          width: 150,
+          width: 100,
           align: 'center',
-          customRender: function (text, row, index) {
-            if (text == '合计') {
-              return {
-                children: <span>{text}</span>,
-                attrs: {
-                  colSpan: 0
-                }
-              }
-            }
-            return text || '--'
-          } },
-        { title: '期初数量', dataIndex: 'sqty', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '期初单价(¥)', dataIndex: 'sprice', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '期初金额(¥)', dataIndex: 'samount', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '收入数量', dataIndex: 'srqty', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '收入单价(¥)', dataIndex: 'srprice', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '收入金额(¥)', dataIndex: 'sramount', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '发出数量', dataIndex: 'fcqty', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '发出单价(¥)', dataIndex: 'fcprice', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '发出金额(¥)', dataIndex: 'fcamount', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '结存数量', dataIndex: 'dcqty', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '结存单价(¥)', dataIndex: 'dcprice', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } },
-        { title: '结存金额(¥)', dataIndex: 'dcamount', width: 150, align: 'center', customRender: function (text) { return text == '' ? '--' : text } }
+          customRender: function (value, row, index) {
+            value = value || '--'
+            const obj = { children: value, attrs: {} }
+            if (value == '合计') { obj.attrs.colSpan = 0 }
+            return obj
+          }
+        },
+        { title: '期初数量', dataIndex: 'sqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '期初单价(¥)', dataIndex: 'sprice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '期初金额(¥)', dataIndex: 'samount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收入数量', dataIndex: 'srqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收入单价(¥)', dataIndex: 'srprice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收入金额(¥)', dataIndex: 'sramount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '发出数量', dataIndex: 'fcqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '发出单价(¥)', dataIndex: 'fcprice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '发出金额(¥)', dataIndex: 'fcamount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结存数量', dataIndex: 'dcqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结存单价(¥)', dataIndex: 'dcprice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结存金额(¥)', dataIndex: 'dcamount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -372,7 +363,11 @@ export default {
             count: 10
           }
           for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
+            if (i < data.list.length - 1) {
+              data.list[i].no = i + 1
+            } else {
+              data.list[i].no = '合计'
+            }
           }
           _this.disabled = false
           resolve(data)
@@ -385,6 +380,11 @@ export default {
     }
   },
   methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
     //  查询
     handleSearch () {
       this.$refs.ruleForm.validate(valid => {

+ 1 - 1
src/views/reportData/chainSalesDetailReport/list.vue

@@ -264,7 +264,7 @@ export default {
     }
   },
   methods: {
-    //  创建时间  change
+    //  时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]

+ 40 - 15
src/views/reportData/chainSalesReport/list.vue

@@ -1,10 +1,10 @@
 <template>
-  <a-card size="small" :bordered="false" class="chainStockReportList-wrap">
+  <a-card size="small" :bordered="false" class="chainSalesReportList-wrap">
     <a-alert :show-icon="false" type="error" message="注:连锁销售单报表包含急件销售数量、售价,连锁销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
       <a-form-model
-        id="chainStockReportList-form"
+        id="chainSalesReportList-form"
         ref="ruleForm"
         :model="queryParam"
         :rules="rules"
@@ -16,7 +16,7 @@
             <a-form-model-item label="连锁店" prop="targetName">
               <a-select
                 placeholder="请选择连锁店"
-                id="chainStockReportList-targetName"
+                id="chainSalesReportList-targetName"
                 allowClear
                 v-model="queryParam.targetName"
                 :showSearch="true"
@@ -33,14 +33,14 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="客户名称">
-              <a-input id="chainStockReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入客户名称"/>
+              <a-input id="chainSalesReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入客户名称"/>
             </a-form-model-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="客户类型">
-                <a-select id="chainStockReportList-targetName" v-model="queryParam.allocateTypeSn" placeholder="请选择客户类型" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
+                <a-select id="chainSalesReportList-customerType" v-model="queryParam.customerTypeSn" allowClear placeholder="请选择客户类型">
+                  <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
@@ -73,25 +73,25 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="收款方式">
-                <a-select id="chainStockReportList-targetName" v-model="queryParam.allocateTypeSn" placeholder="请选择收款方式" allowClear >
-                  <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
+                <a-select id="chainSalesReportList-settleStyleSn" v-model="queryParam.settleStyleSn" allowClear placeholder="请选择收款方式">
+                  <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="单号">
-                <a-input id="chainStockReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入单号"/>
+                <a-input id="chainSalesReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="业务员">
-                <a-input id="chainStockReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入业务员"/>
+                <a-input id="chainSalesReportList-targetName" v-model.trim="queryParam.code" allowClear placeholder="请输入业务员"/>
               </a-form-model-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24" style="margin-top: 3px;">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainStockReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainStockReportList-reset">重置</a-button>
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainSalesReportList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainSalesReportList-reset">重置</a-button>
             <a @click="advanced=!advanced" style="margin-left: 8px">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -128,8 +128,8 @@
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { getArea } from '@/api/data'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import { custTypeFindAllList } from '@/api/custType'
+import { settleStyleFindAllList } from '@/api/customer'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
@@ -200,7 +200,9 @@ export default {
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      allocateTypeList: [] //  调拨类型
+      allocateTypeList: [], //  调拨类型
+      custTypeList: [], //  客户类型 下拉数据
+      settleStyleList: [] //  收款方式  下拉数据
     }
   },
   methods: {
@@ -238,6 +240,27 @@ export default {
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
+    //  获取客户类型列表
+    getCustTypeList () {
+      const _this = this
+      custTypeFindAllList().then(res => {
+        if (res.status == 200) {
+          _this.custTypeList = res.data || []
+        } else {
+          _this.custTypeList = []
+        }
+      })
+    },
+    // 收款方式
+    getSettleStyleList () {
+      settleStyleFindAllList().then(res => {
+        if (res.status == 200) {
+          this.settleStyleList = res.data
+        } else {
+          this.settleStyleList = []
+        }
+      })
+    },
     // 获取城市列表
     getCityList (val) {
       this.addrCityList = []
@@ -284,6 +307,8 @@ export default {
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.getArea('province')
+      vm.getCustTypeList()
+      vm.getSettleStyleList()
     })
   }
 }