Browse Source

打印对接

lilei 3 years ago
parent
commit
c0097f63e0

+ 43 - 1
src/api/sendBill.js

@@ -1,9 +1,51 @@
 import { axios } from '@/utils/request'
-// 发货
+// 新增发货
 export const sendBillInsert = params => {
   return axios({
     url: '/sendBill/insert',
     data: params,
     method: 'post'
   })
+}
+// 修改发货单
+export const sendBillUpdate = params => {
+  return axios({
+    url: '/sendBill/update',
+    data: params,
+    method: 'post'
+  })
+}
+// 获取客户信息
+export const getCustomerInfo = params => {
+  return axios({
+    url: '/sendBill/getCustomerInfo',
+    data: params,
+    method: 'post'
+  })
+}
+// 发货单列表分页查询
+export const sendBillQueryPageList = (params) => {
+  const url = `/sendBill/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 更新发货单物流信息
+export const updateTransportInfo = params => {
+  return axios({
+    url: '/sendBill/updateTransportInfo',
+    data: params,
+    method: 'post'
+  })
+}
+// 根据sn查找详情
+export const sendBillFindBySn = params => {
+  return axios({
+    url: `/sendBill/findBySn/${params.sn}`,
+    method: 'get'
+  })
 }

+ 39 - 17
src/views/salesManagement/outboundOrder/list.vue

@@ -41,10 +41,10 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="发货状态">
                   <v-select
-                    v-model="queryParam.state"
-                    ref="state"
-                    id="outboundOrderList-state"
-                    code="OUT_STATE"
+                    v-model="queryParam.sendFlag"
+                    ref="sendFlag"
+                    id="outboundOrderList-sendFlag"
+                    code="SEND_FLAG"
                     placeholder="请选择发货状态"
                     allowClear></v-select>
                 </a-form-item>
@@ -124,8 +124,10 @@
             size="small"
             type="link"
             class="button-primary"
+            v-if="record.sendFlag==0"
             @click="handleSendGood(record)"
             id="outboundOrderList-sendBill">发货</a-button>
+          <span v-if="record.sendFlag==1&&record.state=='FINISH'">--</span>
         </template>
       </s-table>
     </a-spin>
@@ -146,7 +148,7 @@
       </div>
     </a-modal>
     <!-- 发货信息 -->
-    <detailModal ref="detailModal" modalTit="新增发货单" :openModal="showDetailModal" @ok="sendSuccess" @cancel="showDetailModal=false"></detailModal>
+    <sendGoodModal ref="detailModal" modalTit="新增发货单" :openModal="showDetailModal" @ok="sendSuccess" @cancel="showDetailModal=false"></sendGoodModal>
   </a-card>
 </template>
 
@@ -159,13 +161,14 @@ import subarea from '@/views/common/subarea.js'
 import Area from '@/views/common/area.js'
 import pushOrderDetailModal from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import allocationDetailModal from '@/views/allocationManagement/transferOut/detail.vue'
-import detailModal from './detailModal.vue'
+import sendGoodModal from './sendGoodModal.vue'
 import { STable, VSelect } from '@/components'
 import { stockOutList, stockOutOut } from '@/api/stockOut'
+import { getCustomerInfo } from '@/api/sendBill'
 export default {
   name: 'OutboundOrderList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, pushOrderDetailModal, allocationDetailModal, subarea, Area, detailModal },
+  components: { STable, VSelect, rangeDate, pushOrderDetailModal, allocationDetailModal, subarea, Area, sendGoodModal },
   data () {
     return {
       spinning: false,
@@ -184,7 +187,8 @@ export default {
         outBizNo: '',
         state: undefined, //  状态
         subareaSn: undefined,
-        shippingAddrProvinceSn: undefined
+        shippingAddrProvinceSn: undefined,
+        sendFlag: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
       loading: false,
@@ -226,7 +230,7 @@ export default {
         // { title: '售价', dataIndex: 'productTotalPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '出库时间', dataIndex: 'outTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '出库状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '发货状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货状态', dataIndex: 'sendFlagDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
@@ -267,6 +271,7 @@ export default {
       this.queryParam.outBizNo = ''
       this.queryParam.subareaSn = undefined
       this.queryParam.shippingAddrProvinceSn = undefined
+      this.queryParam.sendFlag = undefined
       this.$refs.table.refresh(true)
     },
     //  详情
@@ -355,28 +360,45 @@ export default {
       })
     },
     // 发货/批量发货
+    getCustome (data, stockOutSnList) {
+      const _this = this
+      this.spinning = true
+      getCustomerInfo({ stockOutSnList: stockOutSnList }).then(res => {
+        if (res.status == 200) {
+          _this.showDetailModal = true
+          _this.$refs.detailModal.setData(data, res.data)
+          _this.spinning = false
+        }
+      })
+    },
     handleSendGood (row) {
       const _this = this
-      if (row) { //  单个出库
-        this.showDetailModal = true
-        this.$refs.detailModal.setData([row], 0)
-      } else { //  批量出库
+      let stockOutSnList = []
+      if (row) { //  单发货
+        stockOutSnList = [row.stockOutSn]
+        this.getCustome([row], stockOutSnList)
+      } else { //  批量发货
         const slen = _this.rowSelectionInfo.selectedRowKeys.length
         if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
           _this.$message.warning('请在列表勾选后再进行批量操作!')
           return
         }
+
         // 判断是否选择相同的客户
         const demanderName = _this.rowSelectionInfo.selectedRows[0].demanderName
         const haseq = _this.rowSelectionInfo.selectedRows.filter(item => item.demanderName == demanderName)
-        if (haseq.length == slen) {
-          this.showDetailModal = true
-          this.$refs.detailModal.setData(_this.rowSelectionInfo.selectedRows, 1)
+        const hasSend = _this.rowSelectionInfo.selectedRows.find(item => item.sendFlag == 1)
+        if (haseq.length == slen && !hasSend) {
+          // 获取客户信息
+          _this.rowSelectionInfo.selectedRows.map(item => {
+            stockOutSnList.push(item.stockOutSn)
+          })
+          _this.getCustome(_this.rowSelectionInfo.selectedRows, stockOutSnList)
         } else {
           this.$info({
             title: '操作提示',
             centered: true,
-            content: '您所选择的出库单,不属于同一个客户,无法批量发货,请重新选择。只能针对一个客户的出库单进行批量发货。'
+            content: hasSend ? '已发货的数据不能再次发货,请重新选择' : '您所选择的出库单,不属于同一个客户,无法批量发货,请重新选择。只能针对一个客户的出库单进行批量发货。'
           })
         }
       }

+ 55 - 12
src/views/salesManagement/outboundOrder/detailModal.vue → src/views/salesManagement/outboundOrder/sendGoodModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     v-model="isShow"
     :title="modalTit"
-    @cancle="isShow=false"
+    @cancle="handleCommonCancel"
     width="60%">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="common-main">
@@ -29,17 +29,17 @@
               </a-col>
               <a-col span="12">
                 <a-form-model-item label="目的地">
-                  <a-input placeholder="请输入目的地(最多100字符)" :maxLength="100" v-model.trim="form.customerAddress"></a-input>
+                  <a-input placeholder="请输入目的地(最多30字符)" :maxLength="30" v-model.trim="form.customerAddress"></a-input>
                 </a-form-model-item>
               </a-col>
               <a-col span="12">
                 <a-form-model-item label="收货人" prop="customerCacateName">
-                  <a-input placeholder="请输入收货人(最多50字符)" :maxLength="50" v-model.trim="form.customerCacateName"></a-input>
+                  <a-input placeholder="请输入收货人(最多30字符)" :maxLength="30" v-model.trim="form.customerCacateName"></a-input>
                 </a-form-model-item>
               </a-col>
               <a-col span="12">
                 <a-form-model-item label="电话" prop="customerCacatePhone">
-                  <a-input placeholder="请输入电话" :maxLength="11" v-model.trim="form.customerCacatePhone"></a-input>
+                  <a-input placeholder="请输入电话" :maxLength="30" v-model.trim="form.customerCacatePhone"></a-input>
                 </a-form-model-item>
               </a-col>
               <a-col span="24">
@@ -171,9 +171,9 @@
 import moment from 'moment'
 import locale from 'ant-design-vue/es/date-picker/locale/zh_CN'
 import { STable, VSelect } from '@/components'
-import { sendBillInsert } from '@/api/sendBill'
+import { sendBillInsert, sendBillFindBySn, sendBillUpdate } from '@/api/sendBill'
 export default {
-  name: 'CommonModal',
+  name: 'SendGoodModal',
   components: { STable, VSelect },
   props: {
     openModal: { //  弹框显示状态
@@ -241,13 +241,50 @@ export default {
         { title: '其他', dataIndex: 'otherAmount', scopedSlots: { customRender: 'other' }, width: '8%', align: 'center' },
         { title: '合计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ]
+      ],
+      isEdit: false
     }
   },
   methods: {
-    setData (data) {
+    // 新增,出库单和收货人信息
+    setData (data, customeInfo) {
       this.detail = data
+      this.isEdit = false
       this.getProductTotal()
+      if (customeInfo) {
+        this.form.customerCacateName = customeInfo.consigneeName
+        this.form.customerCacatePhone = customeInfo.consigneeTel
+        this.form.customerAddressDetail = customeInfo.addr
+      }
+    },
+    // 编辑
+    getDetail (data) {
+      this.spinning = true
+      this.isEdit = true
+      sendBillFindBySn({ sn: data.sendBillSn }).then(res => {
+        console.log(res)
+        this.spinning = false
+        if (res.data) {
+          this.detail = res.data.sendBillStockOutList // 出库单
+          this.tableData = res.data.detailList // 发货明细
+          this.tableData.map((item, i) => {
+            item.no = i + 1
+          })
+          // 统计出库单
+          this.getProductTotal()
+          // 基本信息
+          this.form.customerCacateName = res.data.customeName
+          this.form.customerCacatePhone = res.data.customerCacatePhone
+          this.form.customerAddress = res.data.customerAddress
+          this.form.customerAddressDetail = res.data.customerAddressDetail
+          this.form.sendDate = res.data.sendDate
+          this.form.payType = res.data.payType
+          this.form.handoverType = res.data.handoverType
+          this.form.totalSendAmount = res.data.totalSendAmount
+          this.form.sendBillNo = data.sendBillNo
+          this.form.sendBillSn = data.sendBillSn
+        }
+      })
     },
     // 出库单数据统计
     getProductTotal () {
@@ -261,7 +298,8 @@ export default {
         ret.totalQty = ret.totalQty + item.productTotalQty
         stockOutSnList.push(item.stockOutSn)
       })
-      this.form.stockOutSnList = stockOutSnList
+      // 编辑时不需要传
+      this.form.stockOutSnList = this.isEdit ? [] : stockOutSnList
       this.productTotal = ret
     },
     // 计算运费合计
@@ -315,7 +353,7 @@ export default {
     // 确定
     handleCommonOk () {
       const _this = this
-      if (_this.form.stockOutSnList.length == 0) {
+      if (_this.form.stockOutSnList.length == 0 && !this.isEdit) {
         _this.$message.info('请选择出库单!')
         return
       }
@@ -334,11 +372,14 @@ export default {
             _this.$message.info('请输入费用!')
             return false
           }
-          console.log(_this.form)
-          sendBillInsert(_this.form).then(res => {
+          console.log(_this.form, this.isEdit)
+          const baseUrl = this.isEdit ? sendBillUpdate : sendBillInsert
+          _this.spinning = true
+          baseUrl(_this.form).then(res => {
             if (res.status == 200) {
               _this.$emit('ok')
               _this.isShow = false
+              _this.spinning = false
               _this.$message.success(res.message)
             }
           })
@@ -350,6 +391,8 @@ export default {
     // 取消
     handleCommonCancel () {
       this.$emit('cancel')
+      this.tableData = []
+      this.detail = []
       this.$refs.ruleForm.resetFields()
     }
   },

+ 225 - 55
src/views/salesManagement/sendOutOrder/detailModal.vue

@@ -6,47 +6,146 @@
     :maskClosable="false"
     v-model="isShow"
     :title="modalTit"
-    @cancle="isShow=false"
+    @cancle="handleCommonCancel"
     width="60%">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="common-main">
-        <a-alert type="info" v-if="detail" style="margin-bottom:10px">
-          <div slot="message">箭冠汽配西安大兴店,共 {{ detail && detail.length }} 个出库单,产品款数合计 <span>1266.45</span> ,产品数量合计 <span>158</span>。</div>
-        </a-alert>
+        <div style="display: flex;align-items: center;justify-content: space-between;padding-bottom: 10px;">
+          <a-alert type="info" v-if="sendBillStockOutList.length" style="margin-bottom:10px">
+            <div slot="message">箭冠汽配西安大兴店,共 {{ sendBillStockOutList && sendBillStockOutList.length }} 个出库单,产品款数合计 <span>{{ productTotal&&productTotal.totalCategory }}</span> ,产品数量合计 <span>{{ productTotal&&productTotal.totalQty }}</span>。</div>
+          </a-alert>
+          <a-button size="small" v-if="type==1" @click="printOrder" type="primary">发货单打印</a-button>
+        </div>
         <div>
-          <a-table :columns="outColumns" :pagination="false" :data-source="outTableData" bordered></a-table>
+          <a-table :columns="outColumns" :pagination="false" :data-source="sendBillStockOutList" bordered></a-table>
         </div>
-        <div class="toolsBar forms">
-          <div style="flex-basis:35%">托运日期:2022-02-14</div>
-          <div style="flex-basis:65%">目的地:广州广园</div>
-          <div style="flex-basis:35%">收货人:颜磊(18800005555)</div>
-          <div style="flex-basis:65%">详细地址:广州市白云区金钟横路机场东门08号高益大厦101号</div>
-          <div style="flex-basis:35%">收款方式:月结</div>
-          <div style="flex-basis:35%">交货方式:送货</div>
-          <div style="flex-basis:30%">运费合计:2125.00</div>
-          <div style="flex-basis:100%">发货备注:--</div>
-          <div style="flex-basis:35%">物流情况:
-            <a-radio-group>
-              <a-radio :value="1">
-                正常
-              </a-radio>
-              <a-radio :value="0">
-                异常
-              </a-radio>
-            </a-radio-group>
+        <div class="toolsBar forms" v-if="detail">
+          <div style="flex-basis:35%">托运日期:{{ detail.sendDate }}</div>
+          <div style="flex-basis:65%">目的地:{{ detail.customerAddress||'--' }}</div>
+          <div style="flex-basis:35%">收货人:{{ detail.customeName }}<span v-if="detail.customerCacatePhone">({{ detail.customerCacatePhone }})</span></div>
+          <div style="flex-basis:65%">详细地址:{{ detail.customerAddressDetail }}</div>
+          <div style="flex-basis:35%">收款方式:{{ detail.payTypeDictValue||'--' }}</div>
+          <div style="flex-basis:35%">交货方式:{{ detail.handoverTypeDictValue||'--' }}</div>
+          <div style="flex-basis:30%">运费合计:{{ detail.totalSendAmount }}</div>
+          <div style="flex-basis:100%">发货备注:{{ detail.sendRemark||'--' }}</div>
+          <div style="flex-basis:35%" class="requerd">物流情况:
+            <v-select
+              v-model="form.transportState"
+              ref="transportState"
+              showType="radio"
+              v-if="type==0"
+              code="TRANSPORT_STATE"
+              allowClear></v-select>
+            <span v-else>{{ detail.transportStateDictValue||'--' }}</span>
+          </div>
+          <div style="flex-basis:35%" class="requerd">
+            是否收货:
+            <div>
+              <a-checkbox v-model="form.receiveFlag" v-if="type==0">已收货</a-checkbox>
+              <span v-else>{{ detail.receiveFlag == 1?'是':'否' }}</span>
+            </div>
+          </div>
+          <div style="flex-basis:30%" class="requerd">
+            收货时间:
+            <a-date-picker inputReadOnly :allowClear="false" format="YYYY-MM-DD" v-model="form.receiveDate" v-if="type==0"/>
+            <span v-else>{{ detail.receiveDate||'--' }}</span>
+          </div>
+          <div style="flex-basis:100%">
+            <label>物流备注:</label>
+            <a-textarea v-model="form.transportRemark" placeholder="请输入备注" v-if="type==0"/>
+            <span v-else>{{ detail.transportRemark||'--' }}</span>
           </div>
-          <div style="flex-basis:35%">是否收货:<div><a-checkbox>已收货</a-checkbox></div></div>
-          <div style="flex-basis:30%">收货时间:<a-date-picker format="YYYY-MM-DD" v-model="form.sendDate"/></div>
-          <div style="flex-basis:100%"><label>物流备注:</label><a-textarea v-model="form.remark" placeholder="请输入备注"/></div>
         </div>
         <div>
           <a-table :columns="columns" :pagination="false" :data-source="tableData" bordered></a-table>
         </div>
       </div>
-      <div class="btn-box">
+      <div class="btn-box" v-if="type==0">
         <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
         <a-button type="primary" @click="handleCommonOk">{{ okText }}</a-button>
       </div>
+      <!-- 发货打印 -->
+      <div id="sendGood-print">
+        <div class="print-box" style="width: 100%;padding: 10px;font-size: 12pt;" v-if="detail">
+          <div style="display: flex;align-items: center;justify-content: center;">
+            <img src="@/assets/logo.png" height="50px"/>
+            <h1>东莞市箭冠汽车配件制造有限公司</h1>
+          </div>
+          <div style="text-align: center;padding: 10px 0;position: relative;">
+            <h2>托运单</h2>
+            <span style="position: absolute;top: 10px;right: 0;">No:{{ detail.sendBillNo }}</span>
+          </div>
+          <div style="display: flex;align-items: center;justify-content:space-between;">
+            <span>托运日期:{{ detail.sendDate }}</span>
+            <span>目的地:{{ detail.customerAddress }}</span>
+          </div>
+          <div style="border: 1px solid #000;">
+            <div style="border-bottom: 1px solid #000;display: flex;align-items: center;justify-content:space-between;">
+              <span style="width: 60%;border-right: 1px solid #000;">收货人:{{ detail.customerCacateName }}</span>
+              <span style="width: 40%;">电话:{{ detail.customerCacatePhone }}</span>
+            </div>
+            <div style="border-bottom: 1px solid #000;">
+              <span>详细地址:{{ detail.customerAddressDetail }}</span>
+            </div>
+            <table style="width: 100%;border-bottom: 1px solid #000;">
+              <tr style="border-bottom: 1px solid #000;">
+                <td style="border-right: 1px solid #000;">货物名称</td>
+                <td style="border-right: 1px solid #000;">件数</td>
+                <td style="border-right: 1px solid #000;">体积(m³)</td>
+                <td style="border-right: 1px solid #000;">重量(kg)</td>
+                <td style="border-right: 1px solid #000;">计费单价(元)</td>
+                <td style="border-right: 1px solid #000;">运费(元)</td>
+                <td style="border-right: 1px solid #000;">保价(万)</td>
+                <td style="border-right: 1px solid #000;">送货费</td>
+                <td style="border-right: 1px solid #000;">其他</td>
+                <td>合计</td>
+              </tr>
+              <tr v-for="item in tableData" :key="item.id" style="border-bottom: 1px solid #000;">
+                <td style="border-right: 1px solid #000;">{{ item.goodsName }}</td>
+                <td style="border-right: 1px solid #000;">{{ item.goodsQty }}</td>
+                <td style="border-right: 1px solid #000;">{{ item.goodsVolume }}</td>
+                <td style="border-right: 1px solid #000;">{{ item.goodsWeight }}</td>
+                <td style="border-right: 1px solid #000;">{{ item.unitPrice }}</td>
+                <td style="border-right: 1px solid #000;">{{ item.transportAmount }}</td>
+                <td style="border-right: 1px solid #000;">{{ item.supportValue }}</td>
+                <td style="border-right: 1px solid #000;">{{ item.sendAmount }}</td>
+                <td style="border-right: 1px solid #000;">{{ item.otherAmount }}</td>
+                <td>{{ item.totalAmount }}</td>
+              </tr>
+            </table>
+            <div style="border-bottom: 1px solid #000;display: flex;align-items: center;justify-content:space-between;">
+              <div style="width: 90%;border-right: 1px solid #000;">费用合计大写:{{ detail.totalSendAmount }}</div>
+              <div style="width: 10%;">¥:{{ detail.totalSendAmount }}</div>
+            </div>
+            <div style="border-bottom: 1px solid #000;display: flex;align-items: center;justify-content:space-between;">
+              <div style="width: 50%;border-right: 1px solid #000;">付款方式:{{ detail.payTypeDictValue }}</div>
+              <div style="width: 50%;">交货方式:{{ detail.handoverTypeDictValue }}</div>
+            </div>
+            <div style="border-bottom: 1px solid #000;display: flex;align-items: center;justify-content:space-between;">
+              <div style="width: 8%;border-right: 1px solid #000;">备注:</div>
+              <div style="width: 92%;">{{ detail.sendRemark }}</div>
+            </div>
+            <div style="border-bottom: 1px solid #000;display: flex;align-items: center;justify-content:space-between;">
+              <div style="width: 30px;text-align: center;">注意事项</div>
+              <div style="flex: 1;">
+                <ol style="margin: 0;border-left: 1px solid #000;padding-left: 30px;">
+                  <li>承运人需按合同规定时间内把货物送达客户所在区域(不得超出十公里).</li>
+                  <li>送货上门的货物,到达目的地后需提前和收货人联系并确定送货时间.</li>
+                  <li>货物必需完整的交接给收货人,并让收货人在物流单上签字并上传回单.</li>
+                  <li>如果发生货物丢失以及其它原因损坏需按价赔偿给客户.</li>
+                </ol>
+              </div>
+            </div>
+            <div style="display: flex;align-items: center;justify-content:space-between;">
+              <div>东莞市箭冠汽车配件制造有限公司</div>
+              <div>中国.广东.东莞.茶山工业园</div>
+              <div>电话:0769-81860196</div>
+              <div>传真:0769-81860108</div>
+            </div>
+          </div>
+        </div>
+      </div>
+
     </a-spin>
   </a-modal>
 </template>
@@ -54,6 +153,8 @@
 <script>
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import { jGPrint } from '@/libs/JGPrint.js'
+import { updateTransportInfo, sendBillFindBySn } from '@/api/sendBill'
 export default {
   name: 'CommonModal',
   components: { STable, VSelect },
@@ -62,10 +163,6 @@ export default {
       type: Boolean,
       default: false
     },
-    modalTit: { // 弹框标题
-      type: String,
-      default: null
-    },
     okText: { // 确定 按钮文字
       type: String,
       default: '保存'
@@ -85,49 +182,116 @@ export default {
       disabled: false,
       spinning: false,
       detail: null,
+      modalTit: '',
+      type: 0,
       form: {
-        remark: ''
+        transportState: 'NORMAL',
+        receiveDate: moment(),
+        receiveFlag: true,
+        transportRemark: ''
       },
       tableData: [],
       columns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '货物名称', dataIndex: 'goodName', scopedSlots: { customRender: 'goodName' }, width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '件数', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '体积(m³)', dataIndex: 'volume', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '重量(kg)', dataIndex: 'weight', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '计费单价(元)', dataIndex: 'price', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '运费(元)', dataIndex: 'freight', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '货物名称', dataIndex: 'goodsName', scopedSlots: { customRender: 'goodName' }, width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '件数', dataIndex: 'goodsQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '体积(m³)', dataIndex: 'goodsVolume', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '重量(kg)', dataIndex: 'goodsWeight', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '计费单价(元)', dataIndex: 'unitPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '运费(元)', dataIndex: 'transportAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '保价(万)', dataIndex: 'supportValue', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '送货费', dataIndex: 'deliveryExpense', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '其他', dataIndex: 'other', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '送货费', dataIndex: 'sendAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '其他', dataIndex: 'otherAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '合计', dataIndex: 'totalAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
-      outTableData: [],
+      sendBillStockOutList: [],
       outColumns: [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '出库单号', dataIndex: 'goodName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务单号', dataIndex: 'qty', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '出库类型', dataIndex: 'goodName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '发货编号', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '客户名称', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '收货客户名称', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品款数', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '产品数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '收款时间', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
-      ]
+        { title: '出库单号', dataIndex: 'stockOutNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务单号', dataIndex: 'outBizSubNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库类型', dataIndex: 'outBizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货编号', dataIndex: 'sendNo', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货客户名称', dataIndex: 'receiverName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品款数', dataIndex: 'productTotalCategory', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品数量', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收款时间', dataIndex: 'settleTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      sendBillSn: null
     }
   },
   methods: {
-    setData (data) {
-      this.detail = data
+    // 打印
+    printOrder () {
+      const html = document.getElementById('sendGood-print').innerHTML
+      jGPrint(html, 'print')
+    },
+    // 编辑
+    getDetail (data, type, title) {
+      this.type = type // 0 是物流跟踪,1是详情
+      this.modalTit = title
+      this.sendBillSn = data.sendBillSn
+      this.spinning = true
+      sendBillFindBySn({ sn: data.sendBillSn }).then(res => {
+        console.log(res)
+        this.spinning = false
+        if (res.data) {
+          this.detail = res.data
+          // 出库单明细
+          this.sendBillStockOutList = res.data.sendBillStockOutList || []
+          this.sendBillStockOutList.map((item, i) => {
+            item.no = i + 1
+          })
+          // 发货明细
+          this.tableData = res.data.detailList
+          this.tableData.map((item, i) => {
+            item.no = i + 1
+          })
+          // 统计出库单
+          this.getProductTotal()
+        }
+      })
+    },
+    // 出库单数据统计
+    getProductTotal () {
+      const ret = {
+        totalCategory: 0,
+        totalQty: 0
+      }
+      this.sendBillStockOutList.map(item => {
+        ret.totalCategory = ret.totalCategory + item.productTotalCategory
+        ret.totalQty = ret.totalQty + item.productTotalQty
+      })
+      this.productTotal = ret
     },
     // 确定
     handleCommonOk () {
-      this.$emit('ok')
+      const params = {
+        sendBillSn: this.sendBillSn,
+        receiveDate: this.form.receiveDate.format('YYYY-MM-DD'),
+        receiveFlag: this.form.receiveFlag ? 1 : 0,
+        transportState: this.form.transportState,
+        transportRemark: this.form.transportRemark || ''
+      }
+      console.log(params)
+      updateTransportInfo(params).then(res => {
+        if (res.status == 200) {
+          this.$emit('ok')
+        }
+      })
     },
     // 取消
     handleCommonCancel () {
       this.$emit('cancel')
+      this.form = {
+        transportState: 'NORMAL',
+        receiveDate: moment(),
+        receiveFlag: true,
+        transportRemark: ''
+      }
+      this.detail = null
+      this.sendBillStockOutList = []
+      this.tableData = []
     }
   },
   watch: {
@@ -138,7 +302,7 @@ export default {
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
       if (!newValue) {
-        this.$emit('cancel')
+        this.handleCommonCancel()
       }
     }
   }
@@ -166,6 +330,12 @@ export default {
            flex-basis: 70px;
          }
        }
+       .requerd{
+         &::before{
+           content: '*';
+           color: red;
+         }
+       }
     }
     .btn-box{
       text-align: center;

+ 80 - 92
src/views/salesManagement/sendOutOrder/list.vue

@@ -11,71 +11,48 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="sendOut-buyerName" @change="custChange" />
+              <a-form-item label="发货单号">
+                <a-input id="sendOut-sendBillNo" v-model.trim="queryParam.sendBillNo" allowClear placeholder="请输入发货单号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="销售单号">
-                <a-input id="sendOut-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <a-input id="sendOut-customeName" v-model.trim="queryParam.customeName" allowClear placeholder="请输入客户名称"/>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-item label="备货单号">
-                  <a-input id="sendOut-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
+                <a-form-item label="关联业务单号">
+                  <a-input id="sendOut-bizNos" v-model.trim="queryParam.bizNos" allowClear placeholder="请输入备货或调拨单号"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="收货客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                  <dealerSubareaScopeList ref="shbuyerName" id="sendOut-shbuyerName" @change="shcustChange" />
+                <a-form-item label="托运日期">
+                  <rangeDate ref="sendDate" :value="sendtime" @change="sendDateChange" />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="业务状态">
+                <a-form-item label="收货状态">
                   <v-select
-                    v-model="queryParam.billStatus"
-                    ref="billStatus"
-                    id="sendOut-billStatus"
-                    code="DISPATCH_BILL_STATUS"
-                    placeholder="请选择业务状态"
+                    v-model="queryParam.receiveFlag"
+                    ref="receiveFlag"
+                    id="sendOut-receiveFlag"
+                    code="RECEIVE_FLAG"
+                    placeholder="请选择收货状态"
                     allowClear></v-select>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="单据状态">
+                <a-form-item label="物流情况">
                   <v-select
-                    v-model="queryParam.billStatus"
-                    ref="billStatus"
-                    id="sendOut-billStatus"
-                    code="DISPATCH_BILL_STATUS"
-                    placeholder="请选择单据状态"
+                    v-model="queryParam.transportState"
+                    ref="transportState"
+                    id="sendOut-transportState"
+                    code="TRANSPORT_STATE"
+                    placeholder="请选择物流情况"
                     allowClear></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item label="备货打印状态">
-                  <v-select
-                    v-model="queryParam.billStatus"
-                    ref="billStatus"
-                    id="sendOut-billStatus"
-                    code="DISPATCH_BILL_STATUS"
-                    placeholder="请选择备货打印状态"
-                    allowClear></v-select>
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="所在区域">
-                  <subarea id="sendOut-subarea" v-model="queryParam.subareaSn"></subarea>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="地区">
-                  <a-form-model-item prop="shippingAddrProvinceSn">
-                    <Area id="sendOut-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
-                  </a-form-model-item>
-                </a-form-model-item>
-              </a-col>
             </template>
             <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
@@ -103,9 +80,9 @@
         :defaultLoadData="false"
         bordered>
         <!-- 发货单号 -->
-        <template slot="dispatchBillNo" slot-scope="text, record">
-          <span class="link-bule" v-if="$hasPermissions('B_dispatchDetail')" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
-          <span v-else>{{ record.dispatchBillNo }}</span>
+        <template slot="sendBillNo" slot-scope="text, record">
+          <span class="link-bule" v-if="$hasPermissions('B_dispatchDetail')" @click="handleDetail(record,1)">{{ record.sendBillNo }}</span>
+          <span v-else>{{ record.sendBillNo }}</span>
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
@@ -113,13 +90,24 @@
             size="small"
             type="link"
             class="button-warning"
+            v-if="record.receiveFlag == 0"
             @click="handleEdit(record)"
           >编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-warning"
+            v-if="record.receiveFlag == 0"
+            @click="handleDetail(record,0)"
+          >物流跟踪</a-button>
+          <span v-if="record.receiveFlag == 1">--</span>
         </template>
       </s-table>
     </a-spin>
+    <!-- 发货单详情 -->
+    <detailModal ref="detailModal" :openModal="showTipModal" @cancel="showTipModal=false" @ok="sendSuccess"></detailModal>
     <!-- 编辑发货单 -->
-    <detailModal ref="detailModal" :openModal="showTipModal" modalTit="发货单详情" @cancel="showTipModal=false"></detailModal>
+    <sendGoodModal ref="sendGoodModal" modalTit="编辑发货单" :openModal="showSendGoodModal" @ok="sendSuccess" @cancel="showSendGoodModal=false"></sendGoodModal>
   </a-card>
 </template>
 
@@ -129,15 +117,13 @@ import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
-import subarea from '@/views/common/subarea.js'
-import Area from '@/views/common/area.js'
-import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import detailModal from './detailModal.vue'
-import { dispatchlList, dispatchQueryCount } from '@/api/dispatch'
+import sendGoodModal from '../outboundOrder/sendGoodModal.vue'
+import { sendBillQueryPageList } from '@/api/sendBill'
 export default {
-  name: 'PushOrderManagementList',
+  name: 'SendOutOrder',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, detailModal, Area },
+  components: { STable, VSelect, rangeDate, detailModal, sendGoodModal },
   data () {
     return {
       spinning: false,
@@ -148,16 +134,18 @@ export default {
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
+      sendtime: [],
       // 查询参数
       queryParam: {
         beginDate: getDate.getThreeMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
-        buyerSn: undefined, //  客户名称
-        salesBillNo: '', //  销售单号
-        dispatchBillNo: '', //  备货单号
-        billStatus: undefined, //  业务状态
-        subareaSn: undefined,
-        shippingAddrProvinceSn: undefined
+        sendBeginDate: '',
+        sendEndDate: '',
+        customeName: undefined, //  客户名称
+        sendBillNo: '', //  发货单号
+        bizNos: '', //  业务单号
+        transportState: undefined, //  物流状态
+        receiveFlag: undefined // 收货状态
       },
       totalData: {
         totalAmount: 0,
@@ -165,15 +153,12 @@ export default {
         totalRecord: 0
       },
       showTipModal: false,
+      showSendGoodModal: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        // 查询总计
-        dispatchQueryCount(Object.assign(parameter, this.queryParam)).then(res => {
-          this.totalData = Object.assign(this.totalData, res.data || {})
-        })
-        return dispatchlList(Object.assign(parameter, this.queryParam)).then(res => {
+        return sendBillQueryPageList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -193,16 +178,17 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '发货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '14%', align: 'center' },
-        { title: '客户名称', dataIndex: 'buyerName', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '发货时间', dataIndex: 'stockUpDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货单号', scopedSlots: { customRender: 'sendBillNo' }, width: '10%', align: 'center' },
+        { title: '客户名称', dataIndex: 'customeName', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '托运日期', dataIndex: 'sendDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总件数', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '收货状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '收货时间', dataIndex: 'stockOutDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '物流情况', dataIndex: 'billStatusDictValue1', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'billStatusDictValue2', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+        { title: '运费合计', dataIndex: 'totalSendAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收货状态', dataIndex: 'receiveFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货时间', dataIndex: 'receiveDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '物流情况', dataIndex: 'transportStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'transportRemark', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       return arr
     }
@@ -213,37 +199,39 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    custChange (val) {
-      this.queryParam.buyerSn = val.key
-    },
-    shcustChange (val) {
-      this.queryParam.buyerSn = val.key
+    sendDateChange (date) {
+      this.queryParam.sendBeginDate = date[0]
+      this.queryParam.sendEndDate = date[1]
     },
     // 详情
     handleDetail (row, type) {
-      if (type == 0) {
-        this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn, type: 'pushOrder' } })
-      } else {
-        this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'pushOrder' } })
-      }
+      this.showTipModal = true
+      this.$refs.detailModal.getDetail(row, type, type ? '发货单详情' : '物流跟踪')
     },
     // 编辑
     handleEdit (row) {
-      this.showTipModal = true
-      this.$refs.detailModal.setData(row)
+      this.showSendGoodModal = true
+      this.$refs.sendGoodModal.getDetail(row)
+    },
+    sendSuccess () {
+      this.showSendGoodModal = false
+      this.showTipModal = false
+      this.$refs.table.refresh()
     },
     // 重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.time)
       this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.buyerSn = undefined
-      this.$refs.dealerSubareaScopeList.resetForm()
-      this.queryParam.salesBillNo = ''
-      this.queryParam.dispatchBillNo = ''
-      this.queryParam.billStatus = undefined
-      this.queryParam.subareaSn = undefined
-      this.queryParam.shippingAddrProvinceSn = undefined
+      this.sendtime = []
+      this.$refs.sendDate.resetDate(this.sendtime)
+      this.queryParam.sendBeginDate = ''
+      this.queryParam.sendEndDate = ''
+      this.queryParam.customeName = undefined
+      this.queryParam.sendBillNo = ''
+      this.queryParam.bizNos = ''
+      this.queryParam.transportState = undefined
+      this.queryParam.receiveFlag = undefined
       this.$refs.table.refresh(true)
     },
     pageInit () {

+ 2 - 2
src/views/salesManagement/waitDispatch/dsModal.vue

@@ -48,8 +48,8 @@
           </a-form-model-item>
         </a-form-model>
         <div class="btn-cont">
-          <a-button type="primary" id="dealerAccountEdit-save" @click="handleSave">确定下推</a-button>
-          <a-button id="dealerAccountEdit-back" @click="isShow = false" style="margin-left: 15px;">取消下推</a-button>
+          <a-button id="dealerAccountEdit-back" @click="isShow = false">取消下推</a-button>
+          <a-button type="primary" id="dealerAccountEdit-save" @click="handleSave" style="margin-left: 15px;">确定下推</a-button>
         </div>
       </a-spin>
     </div>

+ 1 - 1
vue.config.js

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