lilei 3 лет назад
Родитель
Сommit
e354a97e4d

+ 19 - 3
src/api/allocateBill.js

@@ -54,12 +54,28 @@ export const allocateBillAudit = params => {
     method: 'get'
   })
 }
+// 允许打印
+export const allocateBillAblePrint = params => {
+  return axios({
+    url: `/allocateBill/ablePrint/${params.sn}`,
+    data: params,
+    method: 'post'
+  })
+}
+// 对单通过
+export const allocateBillCheck = params => {
+  return axios({
+    url: `/allocateBill/check/${params.sn}`,
+    data: params,
+    method: 'post'
+  })
+}
 // 调拨管理  提交
 export const allocateBillSubmit = params => {
   return axios({
-    url: `/allocateBill/submit/${params.sn}`,
-    data: {},
-    method: 'get'
+    url: `/allocateBill/submit`,
+    data: params,
+    method: 'post'
   })
 }
 //  调拨管理 导出

+ 309 - 3
src/views/allocationManagement/matchSendOutOrder/list.vue

@@ -1,8 +1,314 @@
 <template>
+  <a-card size="small" :bordered="false" class="allocateBillList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="创建时间">
+                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="调往对象">
+                <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="调拨类型">
+                <AllocateType id="allocateBillList-allocateTypeSn" v-model="queryParam.allocateTypeSn"></AllocateType>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="收货客户名称">
+                  <dealerSubareaScopeList ref="receiverSn" defValKey="buyerSn" @change="custChange" v-model="queryParam.receiverSn" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="业务状态">
+                  <v-select
+                    v-model="queryParam.state"
+                    ref="state"
+                    id="allocateBillList-state"
+                    code="ALLOCATE_STATUS"
+                    placeholder="请选择业务状态"
+                    allowClear
+                  ></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="调拨单号">
+                  <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="对单状态">
+                  <v-select
+                    v-model="queryParam.checkStatus"
+                    ref="checkStatus"
+                    id="allocateBillList-checkStatus"
+                    code="CHECK_STATUS"
+                    placeholder="请选择对单状态"
+                    allowClear
+                  ></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        :scroll="{ y: tableHeight }"
+        bordered>
+        <!-- 单号 -->
+        <template slot="allocateNo" slot-scope="text, record">
+          <span v-if="$hasPermissions('M_transferOut_detail')" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
+          <span v-else>{{ record.allocateNo }}</span>
+        </template>
+        <!-- 起止时间 -->
+        <template slot="promoDate" slot-scope="text, record">
+          <span v-if="record.promoStartDate || record.promoEndDate">{{ record.promoStartDate }} ~ {{ record.promoEndDate }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.checkStatus == 'WAIT'"
+            class="button-warning"
+            @click="handleYxAudit(record)"
+            id="allocateBillList-checkStatus">对单通过</a-button>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
 </template>
 
 <script>
+import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import { allocateBillList, allocateBillDel, allocateBillCheck } from '@/api/allocateBill'
+import AllocateType from '@/views/common/allocateType.js'
+export default {
+  name: 'TransferOutList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, rangeDate, AllocateType, dealerSubareaScopeList },
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      time: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ],
+      queryParam: { //  查询条件
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        targetName: '', //  调往对象
+        allocateTypeSn: undefined, //  调拨类型
+        state: undefined, //  业务状态
+        allocateNo: '', //  调拨单号
+        receiverSn: undefined,
+        checkStatus: undefined,
+        printState: undefined
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return allocateBillList(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
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      visibleAudit: false,
+      auditInfo: null,
+      spinningAudit: false,
+      openModal: false //  新增编辑  弹框
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '3.5%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨单号', scopedSlots: { customRender: 'allocateNo' }, align: 'center', width: '13.5%' },
+        { title: '调往对象', dataIndex: 'targetName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '发货编号', dataIndex: 'sendNo', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收货客户名称', dataIndex: 'receiverName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '总数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调拨类型', dataIndex: 'allocateTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '对单状态', dataIndex: 'checkStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '对单人员', dataIndex: 'checkPerson', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '对单时间', dataIndex: 'checkDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    custChange (val) {
+      this.form.receiverSn = val.key || ''
+      this.form.receiverName = val.name || ''
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.targetName = ''
+      this.queryParam.allocateTypeSn = undefined
+      this.queryParam.state = undefined
+      this.queryParam.allocateNo = ''
+      this.$refs.table.refresh(true)
+    },
+    //  基本信息  保存
+    handleOk (data) {
+      this.$router.push({ path: `/allocationManagement/transferOut/add/${data.allocateSn}/${data.dealerLevel}` })
+    },
+    //  删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除后不可恢复,确定要进行删除吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          allocateBillDel({ sn: row.allocateSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    // 允许打印
+    handleYxAudit (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认对单通过吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          allocateBillCheck({ sn: row.allocateSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    //  详情
+    handleDetail (row) {
+      if (this.$hasPermissions('M_transferOut_detail')) {
+        this.$router.push({ path: `/allocationManagement/transferOut/detail/${row.allocateSn}` })
+      }
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      this.openModal = false
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 238
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
 </script>
-
-<style>
-</style>
+<style lang="less">
+	.active{
+		color: #ed1c24;
+		cursor: pointer;
+	}
+	.common{
+		color: rgba(0, 0, 0);
+	}
+</style>

+ 159 - 0
src/views/allocationManagement/transferOut/dsModal.vue

@@ -0,0 +1,159 @@
+<template>
+  <a-modal
+    centered
+    class="dealerAccountEdit-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="下推销售单"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="800">
+    <!-- 表单 -->
+    <div>
+      <a-spin :spinning="spinning" tip="Loading...">
+        <a-form-model
+          id="dealerAccountEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="收货客户名称">
+            <dealerSubareaScopeList ref="custList" defValKey="buyerSn" @change="custChange" v-model="form.receiverSn" />
+          </a-form-model-item>
+          <a-form-model-item label="发货编号" prop="sendNo">
+            <a-input
+              id="dealerAccountEdit-phone"
+              :maxLength="11"
+              v-model.trim="form.sendNo"
+              placeholder="请输入发货编号"
+              allowClear />
+            <div style="height: 24px;line-height: normal;">
+              常用:<a-button size="small" v-for="i in 5" @click="setSendNo(i)" type="link">{{ i }}</a-button>
+            </div>
+          </a-form-model-item>
+          <a-form-model-item label="备货打印" prop="printState">
+            <a-radio-group v-model="form.printState">
+              <a-radio value="NO_PRINT">
+                允许打印
+              </a-radio>
+              <a-radio value="UNABLE_PRINT">
+                暂不打印
+              </a-radio>
+            </a-radio-group>
+          </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>
+        </div>
+      </a-spin>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+export default {
+  name: 'DealerAccountEditModal',
+  mixins: [commonMixin],
+  components: { dealerSubareaScopeList },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        sendNo: '',
+        printState: '',
+        receiverSn: '',
+        receiverName: ''
+      },
+      rules: {
+        sendNo: [{ required: true, message: '请输入发货编号', trigger: 'change' }],
+        printState: [{ required: true, message: '请选择备货打印', trigger: 'change' }]
+      },
+      detailData: null //  详情数据
+    }
+  },
+  methods: {
+    setSendNo (i) {
+      this.form.sendNo = i
+      this.$refs.ruleForm.validateField('sendNo')
+    },
+    custChange (val) {
+      this.form.receiverSn = val.key || ''
+      this.form.receiverName = val.name || ''
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const formData = JSON.parse(JSON.stringify(_this.form))
+          _this.$emit('ok', formData)
+        } else {
+          return false
+        }
+      })
+    },
+    //  获取详情
+    setDetail (data) {
+      this.detailData = data
+    },
+    // 重置表单
+    resetForm () {
+      this.detailData = null
+      this.$refs.ruleForm.resetFields()
+      this.form = {
+        sendNo: '',
+        printState: '',
+        receiverSn: '',
+        receiverName: ''
+      }
+      this.$refs.custList.resetForm()
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetForm()
+      }
+    },
+    itemId (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .dealerAccountEdit-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 25 - 8
src/views/allocationManagement/transferOut/edit.vue

@@ -205,22 +205,22 @@
       </a-card>
     <!-- </a-spin> -->
     </div>
-    <div class="affix-cont">
+    <div class="affix-cont" v-if="basicInfoData">
       <a-button
         type="primary"
         id="allocateBillEdit-submit"
         size="large"
         :disabled="spinning"
         class="button-primary"
-        @click="handleSubmit"
+        @click="handleOpen"
         style="padding: 0 60px;">提交</a-button>
     </div>
     <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" :params="{allocateSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" />
     <!-- 打印导出 -->
     <print-modal :openModal="openModal" :itemData="basicInfoData" :nowType="nowType" @ok="handleOk" @close="openModal=false" />
-    <!-- 打印 -->
-    <div id="print"></div>
+    <!-- 提交调拨单 -->
+    <dsModal ref="dsModal" :openModal="showDsModal" @close="showDsModal=false" @ok="handleSubmit" />
   </div>
 </template>
 
@@ -229,6 +229,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import ImportGuideModal from './importGuideModal.vue'
 import printModal from './printModal.vue'
+import dsModal from './dsModal.vue'
 import { printFun, exportExcel } from '@/libs/JGPrint.js'
 import { queryStockProductPage } from '@/api/stock'
 import { productPriceInfo } from '@/api/product'
@@ -238,10 +239,11 @@ import { allocateBillSave, allocateBillDetailList, allocateBillDetailCount, allo
 export default {
   name: 'TransferOutEdit',
   mixins: [commonMixin],
-  components: { STable, VSelect, ImportGuideModal, AllocateType, printModal },
+  components: { STable, VSelect, ImportGuideModal, AllocateType, printModal, dsModal },
   data () {
     return {
       spinning: false,
+      showDsModal: false,
       queryParam: {
         productCode: '',
         productName: '',
@@ -471,10 +473,25 @@ export default {
       })
     },
     //  提交
-    handleSubmit () {
+    handleOpen () {
+      if (this.localDataSource.length) {
+        // 待提交
+        if (this.basicInfoData.state == 'WAIT_SUBMIT') {
+          this.showDsModal = true
+        }
+        // 待审核或审核不通过时
+        if (this.basicInfoData.state == 'AUDIT_REJECT' || this.basicInfoData.state == 'WAIT_AUDIT') {
+          this.handleSubmit()
+        }
+      } else {
+        this.$message.info('请选择产品')
+      }
+    },
+    handleSubmit (params) {
       const _this = this
+      const data = Object.assign({ allocateSn: this.$route.params.sn }, params || {})
       _this.spinning = true
-      allocateBillSubmit({ sn: this.$route.params.sn }).then(res => {
+      allocateBillSubmit(data).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           setTimeout(() => {
@@ -516,7 +533,7 @@ export default {
     qtyBlur (val, record) {
       //  光标移出,值发生改变再调用编辑接口
       if (val != record.qtyBackups) {
-        this.handleAdd(record, 'edit')
+        this.handleAdd(record, 'edit', 'noRefresh')
       }
     },
     // 已选产品 售价  change

+ 74 - 7
src/views/allocationManagement/transferOut/list.vue

@@ -22,6 +22,11 @@
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
+                <a-form-item label="收货客户名称">
+                  <dealerSubareaScopeList ref="receiverSn" defValKey="buyerSn" @change="custChange" v-model="queryParam.receiverSn" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select
                     v-model="queryParam.state"
@@ -33,11 +38,35 @@
                   ></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="调拨单号">
                   <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
                 </a-form-item>
               </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="打印状态">
+                  <v-select
+                    v-model="queryParam.printState"
+                    ref="printState"
+                    id="allocateBillList-printState"
+                    code="PRINT_STATUS"
+                    placeholder="请选择打印状态"
+                    allowClear
+                  ></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="对单状态">
+                  <v-select
+                    v-model="queryParam.checkStatus"
+                    ref="checkStatus"
+                    id="allocateBillList-checkStatus"
+                    code="CHECK_STATUS"
+                    placeholder="请选择对单状态"
+                    allowClear
+                  ></v-select>
+                </a-form-item>
+              </a-col>
             </template>
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
@@ -87,6 +116,13 @@
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT'&&record.printState=='UNABLE_PRINT'"
+            class="button-warning"
+            @click="handleYxPrint(record)"
+            id="allocateBillList-examine-btn">允许打印</a-button>
           <a-button
             size="small"
             type="link"
@@ -127,13 +163,14 @@ import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 import auditModal from '@/views/common/auditModal.vue'
-import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport, allocateBillAblePrint } from '@/api/allocateBill'
 import AllocateType from '@/views/common/allocateType.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 export default {
   name: 'TransferOutList',
   mixins: [commonMixin],
-  components: { STable, VSelect, basicInfoModal, rangeDate, auditModal, AllocateType },
+  components: { STable, VSelect, basicInfoModal, rangeDate, auditModal, AllocateType, dealerSubareaScopeList },
   data () {
     return {
       spinning: false,
@@ -149,7 +186,10 @@ export default {
         targetName: '', //  调往对象
         allocateTypeSn: undefined, //  调拨类型
         state: undefined, //  业务状态
-        allocateNo: '' //  调拨单号
+        allocateNo: '', //  调拨单号
+        receiverSn: undefined,
+        checkStatus: undefined,
+        printState: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
@@ -186,7 +226,8 @@ export default {
         { title: '起止时间', scopedSlots: { customRender: 'promoDate' }, align: 'center', width: '8%' },
         { title: '调往对象', dataIndex: 'targetName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户类型', dataIndex: 'dealerLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '发货编号', dataIndex: 'sendNo', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收货客户名称', dataIndex: 'receiverName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '总数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -194,19 +235,24 @@ export default {
         { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印状态', dataIndex: 'printStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印次数', dataIndex: 'printCount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '对单状态', dataIndex: 'checkStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
-        arr.splice(6, 0, { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        const ind = this.$hasPermissions('B_isShowCost') ? 8 : 7
+        const ind = this.$hasPermissions('B_isShowCost') ? 10 : 9
         arr.splice(ind, 0, { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }
   },
   methods: {
+    custChange (val) {
+      this.form.receiverSn = val.key || ''
+      this.form.receiverName = val.name || ''
+    },
     //  创建时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
@@ -248,6 +294,27 @@ export default {
         }
       })
     },
+    // 允许打印
+    handleYxPrint (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定要允许打印吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          allocateBillAblePrint({ sn: row.allocateSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
     //  审核
     handleExamine (row) {
       this.auditInfo = row