lilei 1 rok pred
rodič
commit
16ad184405

+ 31 - 29
src/views/salesManagement/salesOrderWarehouse/detail.vue

@@ -20,28 +20,28 @@
             @click="handlePrint">导出Excel</a-button>
         </template>
       </a-page-header>
-       
+
       <!-- 基础信息 -->
       <a-card size="small" :bordered="false" class="salesDetail-cont" v-show="showDetail">
         <div v-if="detailData">
-         <a-descriptions size="small" :column="3">
-           <a-descriptions-item label="销售单号">{{ detailData.salesBillNo || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="创建时间">{{ detailData.createDate || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="收货地址" :span="2" v-if="detailData&&detailData.salesBillExtEntity">
-             {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrProvinceName || '' }}
-             {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCityName || '' }}
-             {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCountyName || '' }}
-             {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddr || '' }}
-           </a-descriptions-item>
-           <a-descriptions-item label="收货人" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="收货电话" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
-         </a-descriptions>
+          <a-descriptions size="small" :column="3">
+            <a-descriptions-item label="销售单号">{{ detailData.salesBillNo || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="创建时间">{{ detailData.createDate || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货地址" :span="2" v-if="detailData&&detailData.salesBillExtEntity">
+              {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrProvinceName || '' }}
+              {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCityName || '' }}
+              {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCountyName || '' }}
+              {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddr || '' }}
+            </a-descriptions-item>
+            <a-descriptions-item label="收货人" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货电话" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
+          </a-descriptions>
         </div>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
-        <!-- alert -->
+        <!-- 统计 -->
         <a-alert type="info" style="margin-bottom: 10px;" v-if="countData">
           <div slot="message">
             <span>
@@ -88,7 +88,7 @@ import printModal from './printModal.vue'
 export default {
   name: 'SalesOrderWarehouseDetail',
   mixins: [commonMixin],
-  components: { STable, VSelect ,printModal},
+  components: { STable, VSelect, printModal },
   data () {
     return {
       disabled: false,
@@ -111,10 +111,10 @@ export default {
       },
       detailData: null, //  详情数据
       countData: null, // 数量数据
-      fromRouter: null,
-      openModal:false,
-      showDetail: false,
-      tableHeight: 300
+      fromRouter: null, // 打开此页面的来源页面
+      openModal: false, // 导出Excel
+      showDetail: false, // 是否显示详情
+      tableHeight: 300 // 表格高度
     }
   },
   computed: {
@@ -131,25 +131,27 @@ export default {
         arr.splice(4, 0, { title: '出库仓库', dataIndex: 'warehouseName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       return arr
-    },
+    }
   },
   watch: {
-    showDetail(newValue, oldValue) {
+    // 监听详情显示隐藏,并计算表格高度
+    showDetail (newValue, oldValue) {
       this.getTableHeight()
     }
   },
   methods: {
-    getTableHeight(){
-      this.tableHeight =  window.innerHeight - (this.showDetail ? 376 : 265)
+    // 表格高度
+    getTableHeight () {
+      this.tableHeight = window.innerHeight - (this.showDetail ? 376 : 265)
     },
-    handlePrint(){
+    // 导出Excel
+    handlePrint () {
       this.openModal = true
     },
     // 确定打印或预览,导出
     handleOk (objs) {
       const _this = this
       const params = JSON.parse(JSON.stringify(objs))
-      console.log(params)
       delete params.type
       _this.spinning = true
       exportExcel(salesDetailExcel, params, '销售清单' + moment().format('YYYYMMDDHHmmss'), () => {
@@ -163,7 +165,7 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesOrderWarehouseList' })
     },
-    //  详情
+    //  获取详情
     getDetail () {
       salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
@@ -174,7 +176,7 @@ export default {
         }
       })
     },
-    // 数量
+    // 统计数据
     getCount () {
       queryCountForWarehouseDetail({ salesBillSn: this.$route.params.sn, warehouseSn: this.$route.params.wsn }).then(res => {
         if (res.status == 200) {

+ 112 - 108
src/views/salesManagement/salesOrderWarehouse/list.vue

@@ -1,102 +1,102 @@
 <template>
   <div>
-  <!-- 搜索条件 -->
-  <a-card size="small" :bordered="false" class="searchBoxNormal">
-    <div ref="tableSearch" class="table-page-search-wrapper">
-      <a-form-model
-        id="salesOrderWarehouseList-form"
-        ref="ruleForm"
-        class="form-model-con"
-        layout="inline"
-        :rules="rules"
-        :model="queryParam"
-        @keyup.enter.native="handleSearch">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="创建时间" prop="time">
-              <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="客户名称">
-              <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesManagementList-buyerName" @change="custChange" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="销售单号">
-              <a-input id="salesOrderWarehouseList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="业务状态">
-              <v-select
-                v-model="queryParam.billStatus"
-                ref="billStatus"
-                id="salesManagementList-billStatus"
-                code="SALES_BILL_STATUS"
-                placeholder="请选择业务状态"
-                allowClear></v-select>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
-              <Area id="salesOrderWarehouseList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24" v-show="isShowWarehouse">
-            <a-form-model-item label="出库仓库">
-              <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesOrderWarehouseList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesOrderWarehouseList-reset">重置</a-button>
-            <a-button
-              style="margin-left: 10px"
-              type="primary"
-              class="button-warning"
-              @click="handleExport"
-              :disabled="disabled"
-              :loading="exportLoading"
-              v-if="$hasPermissions('B_salesOrderWarehouseExport')"
-            >导出</a-button>
-          </a-col>
-        </a-row>
-      </a-form-model>
-    </div>
-  </a-card>
- 
-  <a-card size="small" :bordered="false" class="salesOrderWarehouseList-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <div class="tongji-bar" style="margin-bottom:10px">
-        <!-- 总款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '0' }}</strong>; -->
-        总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
+    <!-- 搜索条件 -->
+    <a-card size="small" :bordered="false" class="searchBoxNormal">
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form-model
+          id="salesOrderWarehouseList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="创建时间" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户名称">
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesManagementList-buyerName" @change="custChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="销售单号">
+                <a-input id="salesOrderWarehouseList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="业务状态">
+                <v-select
+                  v-model="queryParam.billStatus"
+                  ref="billStatus"
+                  id="salesManagementList-billStatus"
+                  code="SALES_BILL_STATUS"
+                  placeholder="请选择业务状态"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
+                <Area id="salesOrderWarehouseList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24" v-show="isShowWarehouse">
+              <a-form-model-item label="出库仓库">
+                <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesOrderWarehouseList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesOrderWarehouseList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_salesOrderWarehouseExport')"
+              >导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
       </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+68+'px' }"
-        size="small"
-        :rowKey="(record) => record.no"
-        rowKeyName="no"
-        :columns="columns"
-        :pageSize="30"
-        :data="loadData"
-        :scroll="{ y: tableHeight }"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 单号 -->
-        <template slot="stockOutNo" slot-scope="text, record" v-if="$hasPermissions('B_salesOrderWarehouseDetail')">
-          <span class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
-          <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
-        </template>
-      </s-table>
-    </a-spin>
-    <!-- 导出提示框 -->
-    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
-  </a-card>
-   </div>
+    </a-card>
+
+    <a-card size="small" :bordered="false" class="salesOrderWarehouseList-wrap">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <div class="tongji-bar" style="margin-bottom:10px">
+          <!-- 总款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '0' }}</strong>; -->
+          总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+68+'px' }"
+          size="small"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :columns="columns"
+          :pageSize="30"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 单号 -->
+          <template slot="stockOutNo" slot-scope="text, record" v-if="$hasPermissions('B_salesOrderWarehouseDetail')">
+            <span class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+            <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 导出提示框 -->
+      <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+    </a-card>
+  </div>
 </template>
 
 <script>
@@ -124,19 +124,20 @@ export default {
           moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
           moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
         ],
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        beginDate: getDate.getThreeMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         buyerSn: '', //  客户名称
         billStatus: 'WAIT_AUDIT', //  业务状态
         salesBillNo: '', // 销售单号
-        shippingAddrProvinceSn: undefined,
-        warehouseSn: undefined
+        shippingAddrProvinceSn: undefined, // 地址sn
+        warehouseSn: undefined // 仓库sn
       },
-      exportLoading: false,
+      exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
       loading: false,
-      totalData: null,
-      showExport: false,
+      totalData: null, // 统计信息
+      showExport: false, // 导出提示框
+      // 校验规则
       rules: {
         'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }]
       },
@@ -173,9 +174,10 @@ export default {
         { title: '总数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
-	  if (this.isShowWarehouse) {
-	    arr.splice(5, 0, { title: '出库仓库', dataIndex: 'warehouseName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
-	  }
+      // 如果显示仓库
+      if (this.isShowWarehouse) {
+        arr.splice(5, 0, { title: '出库仓库', dataIndex: 'warehouseName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
+      }
       return arr
     }
   },
@@ -192,6 +194,7 @@ export default {
         }
       })
     },
+    // 选择客户
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
@@ -216,7 +219,7 @@ export default {
         _this.showExport = true
       })
     },
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -243,10 +246,11 @@ export default {
       this.queryParam.warehouseSn = undefined
       this.$refs.table.refresh(true)
     },
-    //  详情
+    //  打开详情页面
     handleDetail (row) {
       this.$router.push({ path: `/salesManagement/salesOrderWarehouse/detail/${row.salesBillSn}/${row.warehouseSn}` })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 21 - 17
src/views/salesManagement/salesOrderWarehouse/printModal.vue

@@ -48,13 +48,13 @@ export default {
       type: Boolean,
       default: false
     },
-    itemData: {
+    itemData: { // 单据详情信息
       type: Object,
       default: () => {
         return null
       }
     },
-    nowType: {
+    nowType: { // 导出类型
       type: String,
       default: ''
     }
@@ -62,12 +62,14 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 导出选项
       form: {
         id: 'all',
         dataScope: 'all',
         priceType: undefined,
-        orgCode: "1"
+        orgCode: '1'
       },
+      // 选项校验
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         dataScope: [{ required: true, message: '请选择是否缺货产品', trigger: 'change' }],
@@ -78,7 +80,7 @@ export default {
         wrapperCol: { span: 15 }
       },
       spinning: false,
-      typeList: []
+      typeList: [] // 产品分类
     }
   },
   computed: {
@@ -92,16 +94,17 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-           _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK':'SALES_BILL'
-           _this.form.priceType += _this.form.orgCode == "1" ? '_ORIG_CODE':''
-           const obj = {
-             salesBillSn: _this.itemData.salesBillSn,
-             priceType: _this.form.priceType,
-             dataScope: _this.form.dataScope == 'all' ? '' : _this.form.dataScope,
-             type: isPrint || 'preview'
-           }
-           _this.$emit('ok', obj)
-           _this.isShow = false
+          // 价格类型
+          _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK' : 'SALES_BILL'
+          _this.form.priceType += _this.form.orgCode == '1' ? '_ORIG_CODE' : ''
+          const obj = {
+            salesBillSn: _this.itemData.salesBillSn,
+            priceType: _this.form.priceType,
+            dataScope: _this.form.dataScope == 'all' ? '' : _this.form.dataScope,
+            type: isPrint || 'preview'
+          }
+          _this.$emit('ok', obj)
+          _this.isShow = false
         } else {
           console.log('error submit!!')
           return false
@@ -110,8 +113,8 @@ export default {
     },
     // 取消选择分类
     handleCancel () {
-       this.isShow = false
-    },
+      this.isShow = false
+    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -122,11 +125,12 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        // 重置表单
         this.form = {
           id: 'all',
           dataScope: 'all',
           priceType: undefined,
-          orgCode: "1"
+          orgCode: '1'
         }
         this.$refs.ruleForm.resetFields()
       }