lilei 2 năm trước cách đây
mục cha
commit
6951d97644

+ 202 - 0
src/views/salesManagement/outboundOrder/selectGlOrderModal.vue

@@ -0,0 +1,202 @@
+<template>
+  <a-modal
+    centered
+    class="collection-detail-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    :title="modalTit"
+    :bodyStyle="{padding: modalTit?'25px 32px 20px':'50px 32px 15px'}"
+    @cancel="isShow=false"
+    width="80%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="common-main">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form layout="inline">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="销退单号">
+                  <a-input v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入销退单号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="客户名称">
+                  <dealerSubareaScopeList ref="dealerSubareaScopeList" id="billOfLadingEdit-buyerSn" @change="custChange" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <span class="table-page-search-submitButtons">
+                  <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                  <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 表格数据 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: 400 }"
+          :pageSize="10"
+          bordered>
+          <!-- 收款单号 -->
+          <template slot="salesReturnBillNo" slot-scope="text, record">
+            {{ record.salesReturnBillNo }}
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <div v-if="record.billStatus == 'WAIT_RECEIVE'">
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                v-if="!record.checked"
+                @click="handleChoose(record)"
+              >选择</a-button>
+              <span style="color:green;" v-else>已选</span>
+            </div>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { salesReturnList } from '@/api/salesReturn'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+export default {
+  name: 'SelectGlOrderModal',
+  components: { STable, VSelect, dealerSubareaScopeList },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    modalTit: { // 弹框标题
+      type: String,
+      default: null
+    },
+    chooseData: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      spinning: false,
+      handlePlData: [],
+      queryParam: {
+        salesReturnBillNo: '',
+        buyerSn: undefined
+      },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '15%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '申请退货数量', dataIndex: 'totalQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
+      ],
+      orginData: [],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return salesReturnList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              const index = this.chooseData.findIndex(item => data.list[i].salesReturnBillNo == item.salesReturnBillNo)
+              data.list[i].checked = index >= 0
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          this.orginData = data.list
+          return data
+        })
+      },
+      snList: []
+    }
+  },
+  computed: {
+    totalAmount () {
+      let ret = 0
+      this.handlePlData.map(item => {
+        ret = ret + item.totalAmount
+      })
+      return ret.toFixed(2)
+    }
+  },
+  methods: {
+    custChange (val) {
+      this.queryParam.buyerSn = val.key
+    },
+    // 删除
+    handleDel (row) {
+      const i = this.chooseData.findIndex(item => row.salesReturnBillNo == item.salesReturnBillNo)
+      this.chooseData.splice(i, 1)
+      const oi = this.orginData.findIndex(item => row.salesReturnBillNo == item.salesReturnBillNo)
+      if (oi >= 0) {
+        this.orginData[oi].checked = false
+      }
+    },
+    // 选择
+    handleChoose (row) {
+      row.checked = true
+      this.chooseData.push(row)
+    },
+    // 取消
+    handleCommonCancel () {
+      this.$emit('cancel')
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryParam = {
+        salesReturnBillNo: '',
+        buyerSn: undefined
+      }
+      this.orginData = []
+      this.$refs.dealerSubareaScopeList.resetForm()
+      if (this.$refs.table) {
+        this.$refs.table.refresh(true)
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.handleCommonCancel()
+      } else {
+        this.resetSearchForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+
+</style>

+ 12 - 3
src/views/salesManagement/outboundOrder/sendGoodModal.vue

@@ -11,12 +11,12 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="common-main">
         <div style="display:flex;margin-bottom:10px;align-items: center;">
-          <a-button type="primary" class="button-info" ghost v-if="isEdit">选择关联单据</a-button>
+          <a-button @click="showGlModal=true" type="primary" class="button-info" ghost v-if="isEdit">选择关联单据</a-button>
           <div style="padding:0 15px;" v-if="sendBillStockOutList.length">
             <div>{{ customeName }},共 {{ sendBillStockOutList && sendBillStockOutList.length }} 个出库单,产品款数合计 <span>{{ productTotal&&productTotal.totalCategory }}</span> ,产品数量合计 <span>{{ productTotal&&productTotal.totalQty }}</span>。</div>
           </div>
         </div>
-        <div v-if="isEdit">
+        <div style="margin-bottom:10px;" v-if="isEdit">
           <a-table :columns="glColumns" :pagination="false" :scroll="{ y: 200 }" :data-source="sendBillStockOutList" bordered>
             <template slot="action" slot-scope="text, record, index">
               <a-button
@@ -190,6 +190,13 @@
         <a-button size="large" type="primary" @click="handleCommonOk">{{ okText }}</a-button>
       </div>
     </a-spin>
+    <!-- 关联单据 -->
+    <selectGlOrderModal
+      ref="selGlModal"
+      modalTit="选择关联单据"
+      :chooseData="sendBillStockOutList"
+      :openModal="showGlModal"
+      @cancel="showGlModal=false"></selectGlOrderModal>
   </a-modal>
 </template>
 
@@ -197,10 +204,11 @@
 import moment from 'moment'
 import locale from 'ant-design-vue/es/date-picker/locale/zh_CN'
 import { STable, VSelect } from '@/components'
+import selectGlOrderModal from './selectGlOrderModal.vue'
 import { sendBillInsert, sendBillFindBySn, sendBillUpdate } from '@/api/sendBill'
 export default {
   name: 'SendGoodModal',
-  components: { STable, VSelect },
+  components: { STable, VSelect, selectGlOrderModal },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -229,6 +237,7 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       disabled: false,
       spinning: false,
+      showGlModal: false,
       form: {
         'stockOutSnList': [], // 出库单列表
         'sendDate': moment(), // 托运时间

+ 2 - 2
vue.config.js

@@ -107,9 +107,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.0.183:8602/ocs-admin',
+        // target: 'http://192.168.0.183:8602/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  Á·Ï°
-        // target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
+        target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
         ws: false,
         changeOrigin: true,
         pathRewrite: {