Procházet zdrojové kódy

销售退货列表

lilei před 3 roky
rodič
revize
cd33d05928

+ 19 - 31
src/views/salesReturnManagement/salesReturn/chooseCustomModal.vue

@@ -5,7 +5,7 @@
     centered
     :maskClosable="false"
     :confirmLoading="confirmLoading"
-    :width="960"
+    :width="560"
     :footer="null"
     @cancel="cancel"
   >
@@ -19,8 +19,8 @@
         :wrapper-col="formItemLayout.wrapperCol"
       >
         <a-row :gutter="15">
-          <a-col :span="16">
-            <a-form-model-item label="客户名称" prop="buyerSn" :labelCol="{ span: 3 }" :wrapperCol="{ span: 20 }">
+          <a-col :span="20">
+            <a-form-model-item label="客户名称" prop="buyerSn">
               <a-select
                 show-search
                 id="chooseCustom-buyerSn"
@@ -38,31 +38,17 @@
           </a-col>
         </a-row>
         <a-row :gutter="15">
-          <a-col :span="8">
-            <a-form-model-item label="联系人">
-              {{ form.contactName || '--' }}
+          <a-col :span="20">
+            <a-form-model-item label="是否同步" prop="grabFlag">
+              <v-select
+                code="FLAG"
+                showType="radio"
+                id="chooseCustom-grabFlag"
+                v-model="form.grabFlag"
+                allowClear
+                placeholder="请选择"></v-select>
             </a-form-model-item>
           </a-col>
-          <a-col :span="6">
-            <a-form-model-item label="联系手机">
-              {{ form.contactTel || '--' }}
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="10">
-            <a-form-model-item label="客户地址">
-              {{ form.provinceName }}{{ form.cityName }}{{ form.countyName }}{{ form.customerAddr }}
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="15">
-          <a-col :span="8">
-            <a-form-model-item label="是否抓单" prop="grabFlag">
-              <v-select code="FLAG" id="chooseCustom-grabFlag" v-model="form.grabFlag" allowClear placeholder="请选择"></v-select>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="8">
-            <a-form-model-item label="开单人">{{ $store.state.user.info.userNameCN }}</a-form-model-item>
-          </a-col>
         </a-row>
         <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
           <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
@@ -89,7 +75,7 @@ export default {
     return {
       opened: this.show,
       spinning: false,
-      title: '选择客户',
+      title: '新增销售退货单——选择客户',
       confirmLoading: false,
       formItemLayout: {
         labelCol: { span: 6 },
@@ -108,10 +94,11 @@ export default {
         countySn: '', // 区
         countyName: '',
         customerAddr: '', //  详细地址
-        grabFlag: '1' // 是否抓单
+        grabFlag: undefined // 是否抓单
       },
       rules: {
-        buyerSn: [{ required: true, message: '请选择客户', trigger: ['change', 'blur'] }]
+        buyerSn: [{ required: true, message: '请选择客户', trigger: ['change', 'blur'] }],
+        grabFlag: [{ required: true, message: '请选择是否同步', trigger: ['change', 'blur'] }]
       },
       fetching: false,
       dealerData: []
@@ -170,7 +157,7 @@ export default {
         }
       })
     },
-    // 新建或编辑销售单
+    // 新建销售退货
     salesSaveFun () {
       const _this = this
       const form = this.form
@@ -202,8 +189,9 @@ export default {
         countySn: '', // 区
         countyName: '',
         customerAddr: '', //  详细地址
-        grabFlag: '1' // 是否抓单
+        grabFlag: undefined // 是否抓单
       }
+      this.$refs.ruleForm.resetFields()
       this.dealerData = []
       this.$emit('cancel')
     }

+ 41 - 37
src/views/salesReturnManagement/salesReturn/list.vue

@@ -22,13 +22,35 @@
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-item label="销退单号">
-                  <a-input id="salesReturn-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入销退单号"/>
+                <a-form-item label="总部销退单号">
+                  <a-input id="salesReturn-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入总部销退单号"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="客户采退单号">
-                  <a-input id="salesReturn-purchaseReturnBillNo" v-model.trim="queryParam.purchaseReturnBillNo" allowClear placeholder="请输入客户采退单号"/>
+                <a-form-item label="客户采退申请单号">
+                  <a-input id="salesReturn-purchaseReturnBillNo" v-model.trim="queryParam.purchaseReturnBillNo" allowClear placeholder="请输入客户采退申请单号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="单据来源">
+                  <v-select
+                    v-model="queryParam.salesReturnBillSource"
+                    ref="salesReturnBillSource"
+                    id="salesReturn-salesReturnBillSource"
+                    code="SALES_SOURCE"
+                    placeholder="请选择单据来源"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="是否同步给客户">
+                  <v-select
+                    v-model="queryParam.syncToCustomFlag"
+                    ref="syncToCustom"
+                    id="salesReturn-syncToCustom"
+                    code="FLAG"
+                    placeholder="请选择是否同步给客户"
+                    allowClear></v-select>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -74,14 +96,6 @@
       <div class="table-operator">
         <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesReturnNew')" @click="openModal = true">新增</a-button>
       </div>
-      <!-- alert -->
-      <a-alert type="info" style="margin-bottom: 10px;">
-        <div slot="message">
-          <span v-if="$hasPermissions('B_isShowPrice')">退货总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? countData.totalAmount : '--' }}</strong>元;</span>
-          总单数:<strong>{{ countData&&(countData.totalRecord || countData.totalRecord==0) ? countData.totalRecord : '--' }}</strong>;
-          总数量:<strong>{{ countData&&(countData.totalQty || countData.totalQty==0) ? countData.totalQty : '--' }}</strong>;
-        </div>
-      </a-alert>
       <!-- 列表 -->
       <s-table
         class="sTable fixPagination"
@@ -209,17 +223,14 @@ export default {
         salesReturnBillNo: undefined, //  总部销退单号
         purchaseReturnBillNo: '',
         billStatus: undefined, // 业务状态
-        // financialStatus: undefined, // 财务状态
         subareaSn: undefined,
-        shippingAddrProvinceSn: undefined
+        shippingAddrProvinceSn: undefined,
+        salesReturnBillSource: undefined
       },
-      countData: null, // 统计数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        // 查询总计
-        this.getQueryCount(Object.assign(parameter, this.queryParam))
         return salesReturnList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
@@ -243,24 +254,22 @@ export default {
   computed: {
     columns () {
       const arr = [
-        { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户采退单号', dataIndex: 'purchaseReturnBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '是否同步给客户', dataIndex: 'asyncFlag', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户采退申请单号', dataIndex: 'purchaseReturnBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '10%', align: 'center' },
-        { title: '退货客户', dataIndex: 'buyerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'totalBadQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'totalBackStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '退款金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '是否抓单', dataIndex: 'grabFlag', width: '6%', align: 'center', customRender: function (text) { return ['否', '是'][text] } },
-        { title: '审核时间', dataIndex: 'auditTime', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '申请退货数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'totalBadQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'totalBadQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'totalBackStockQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'totalBackStockQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '财务状态', dataIndex: 'financialStatusDictValue', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        arr.splice(9, 0, { title: '退款金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
       return arr
     }
   },
@@ -278,12 +287,6 @@ export default {
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
-    // 列表统计
-    getQueryCount (params) {
-      salesReturnQueryCount(params).then(res => {
-        this.countData = res.data || null
-      })
-    },
     // 编辑
     handleEdit (row) {
       this.$router.push({ name: row.grabFlag == 1 ? 'salesReturnGrabEdit' : 'salesReturnEdit', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
@@ -352,6 +355,7 @@ export default {
       this.queryParam.purchaseReturnBillNo = ''
       this.queryParam.billStatus = undefined
       this.queryParam.subareaSn = undefined
+      this.queryParam.salesReturnBillSource = undefined
       this.queryParam.shippingAddrProvinceSn = undefined
       this.$refs.table.refresh(true)
     },