|  | @@ -3,23 +3,46 @@
 | 
	
		
			
				|  |  |      <a-page-header :ghost="false" :backIcon="false" class="purchaseNewOrderEdit-cont">
 | 
	
		
			
				|  |  |        <!-- 自定义的二级文字标题 -->
 | 
	
		
			
				|  |  |        <template slot="subTitle">
 | 
	
		
			
				|  |  | -        <a id="purchaseNewOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
 | 
	
		
			
				|  |  |          <p class="billno">单号:{{ detail&&detail.purchaseBillNo }}</p>
 | 
	
		
			
				|  |  | -        <a-button type="danger" ghost @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:30px;vertical-align:middle;">
 | 
	
		
			
				|  |  | -          基础信息
 | 
	
		
			
				|  |  | -          <a-icon :type="isShowBisiceInfo ? 'up' : 'down'"/>
 | 
	
		
			
				|  |  | +        <a-button type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
 | 
	
		
			
				|  |  | +          <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/>
 | 
	
		
			
				|  |  | +          查看信息
 | 
	
		
			
				|  |  |          </a-button>
 | 
	
		
			
				|  |  | +        <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
 | 
	
		
			
				|  |  |        </template>
 | 
	
		
			
				|  |  |        <!-- 操作区,位于 title 行的行尾 -->
 | 
	
		
			
				|  |  | -      <template slot="extra" v-if="$hasPermissions('B_purchasePrint')">
 | 
	
		
			
				|  |  | -        <Print :disabled="localDataSource.length==0" @handlePrint="handlePrint"></Print>
 | 
	
		
			
				|  |  | +      <template slot="extra">
 | 
	
		
			
				|  |  | +        <div style="margin-top: 5px;">
 | 
	
		
			
				|  |  | +          <PrintPanel v-if="$hasPermissions('B_purchasePrint')" :disabled="localDataSource.length==0" @handlePrint="handlePrint"></PrintPanel>
 | 
	
		
			
				|  |  | +          <a-divider type="vertical" v-if="detail&&detail.totalCategory" />
 | 
	
		
			
				|  |  | +          <a-button type="link" v-if="detail&&detail.totalCategory" @click="showSearch=!showSearch" :class="showSearch?'button-error':'button-default'"> <a-icon type="search" /> 筛选</a-button>
 | 
	
		
			
				|  |  | +          <a-divider type="vertical" v-if="detail&&detail.totalCategory" />
 | 
	
		
			
				|  |  | +          <a-button v-if="detail&&detail.totalCategory" id="purchaseNewOrderEdit-add-btn" type="link" @click="openChooseProduct=true"><a-icon type="plus" />添加产品</a-button>
 | 
	
		
			
				|  |  | +          <a-divider type="vertical" />
 | 
	
		
			
				|  |  | +          <a-dropdown>
 | 
	
		
			
				|  |  | +            <a-menu slot="overlay" @click="handleActions">
 | 
	
		
			
				|  |  | +              <a-menu-item key="3" v-if="$hasPermissions('M_shoppingCart')">
 | 
	
		
			
				|  |  | +                <a-icon type="shopping" /> 购物车
 | 
	
		
			
				|  |  | +              </a-menu-item>
 | 
	
		
			
				|  |  | +              <a-menu-item key="2">
 | 
	
		
			
				|  |  | +                <a-icon type="funnel-plot" />上次缺货
 | 
	
		
			
				|  |  | +              </a-menu-item>
 | 
	
		
			
				|  |  | +              <a-menu-item key="1">
 | 
	
		
			
				|  |  | +                <a-icon type="import" />产品导入
 | 
	
		
			
				|  |  | +              </a-menu-item>
 | 
	
		
			
				|  |  | +            </a-menu>
 | 
	
		
			
				|  |  | +            <a-button type="link" class="button-default"> <a-icon type="unordered-list" />  更多</a-button>
 | 
	
		
			
				|  |  | +          </a-dropdown> 
 | 
	
		
			
				|  |  | +        </div>
 | 
	
		
			
				|  |  |        </template>
 | 
	
		
			
				|  |  |      </a-page-header>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      <!-- 产品列表 -->
 | 
	
		
			
				|  |  |      <div ref="tableSearch" class="choosedList-cont">
 | 
	
		
			
				|  |  |        <!-- 基础信息 -->
 | 
	
		
			
				|  |  | -      <div style="padding:10px 10px 0 10px;border-bottom:8px solid #f3f3f3;" v-if="isShowBisiceInfo">
 | 
	
		
			
				|  |  | -        <a-descriptions title="基础信息" size="small">
 | 
	
		
			
				|  |  | +      <div style="padding:10px 10px 0 10px;border-bottom:6px solid #f0f0f0;" v-if="isShowBisiceInfo">
 | 
	
		
			
				|  |  | +        <a-descriptions size="small">
 | 
	
		
			
				|  |  | +          <div slot="title">基础信息</div>
 | 
	
		
			
				|  |  |            <a-descriptions-item label="供应商">
 | 
	
		
			
				|  |  |              {{ detail&&detail.purchaseTargetName || '--' }}
 | 
	
		
			
				|  |  |            </a-descriptions-item>
 | 
	
	
		
			
				|  | @@ -41,56 +64,30 @@
 | 
	
		
			
				|  |  |            </a-descriptions-item>
 | 
	
		
			
				|  |  |          </a-descriptions>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -      <!-- 添加产品 -->
 | 
	
		
			
				|  |  | -      <chooseProductModal
 | 
	
		
			
				|  |  | -        ref="chooseProduct"
 | 
	
		
			
				|  |  | -        :isDealerUp="isDealerUp"
 | 
	
		
			
				|  |  | -        :purchaseBillSn="$route.params.sn"
 | 
	
		
			
				|  |  | -        :showModal="openChooseProduct"
 | 
	
		
			
				|  |  | -        @close="openChooseProduct=false"
 | 
	
		
			
				|  |  | -        @add="handleAdd"
 | 
	
		
			
				|  |  | -      ></chooseProductModal>
 | 
	
		
			
				|  |  | -      <!-- 上次缺货 -->
 | 
	
		
			
				|  |  | -      <outStockModal :openModal="openOutStockModal" :paramsData="paramsData" @close="openOutStockModal=false" @ok="hanldeOkOutStock" />
 | 
	
		
			
				|  |  | -      <!-- 购物车 -->
 | 
	
		
			
				|  |  | -      <shopingCatModal :showModal="openShopCatModal" :paramsData="paramsData" @close="openShopCatModal=false" @ok="getOrderDetail(false, true)"></shopingCatModal>
 | 
	
		
			
				|  |  |        <!-- 已选产品 -->
 | 
	
		
			
				|  |  | -      <div>
 | 
	
		
			
				|  |  | -        <div class="chooseBox-title">
 | 
	
		
			
				|  |  | -          <div class="sub-title" style="display: flex;">
 | 
	
		
			
				|  |  | -            已选产品
 | 
	
		
			
				|  |  | -            <p class="tag-txt">注意:仅限采购【箭冠】产品。自建产品的采购入库请使用“散件入库”功能</p>
 | 
	
		
			
				|  |  | -          </div>
 | 
	
		
			
				|  |  | -          <div class="actions-button">
 | 
	
		
			
				|  |  | -            <a-button v-if="detail&&detail.totalCategory" id="purchaseNewOrderEdit-add-btn" type="danger" @click="openChooseProduct=true"><a-icon type="plus-circle" />添加产品</a-button>
 | 
	
		
			
				|  |  | -            <a-button id="purchaseNewOrderEdit-import-btn" type="danger" ghost @click="openGuideModal=true"><a-icon type="import" />产品导入</a-button>
 | 
	
		
			
				|  |  | -            <a-button id="purchaseNewOrderEdit-outStock-btn" type="danger" ghost @click="handleOutStock"><a-icon type="funnel-plot" />上次缺货</a-button>
 | 
	
		
			
				|  |  | -            <a-button id="purchaseNewOrderEdit-cart-btn" v-if="$hasPermissions('M_shoppingCart')" type="danger" ghost @click="hanldCart"><a-icon type="shopping" />购物车</a-button>
 | 
	
		
			
				|  |  | -          </div>
 | 
	
		
			
				|  |  | -        </div>
 | 
	
		
			
				|  |  | +      <div id="purchaseTable">
 | 
	
		
			
				|  |  |          <div class="choosed-table" v-if="detail&&detail.totalCategory">
 | 
	
		
			
				|  |  |            <!-- 搜索条件 -->
 | 
	
		
			
				|  |  | -          <div class="table-page-search-wrapper">
 | 
	
		
			
				|  |  | +          <div class="table-page-search-wrapper" v-if="showSearch">
 | 
	
		
			
				|  |  |              <a-row :gutter="15">
 | 
	
		
			
				|  |  |                <a-col :span="24">
 | 
	
		
			
				|  |  | -                <a-form-model :model="productForm" layout="inline" @keyup.enter.native="$refs.purchaseTable.refresh(true)" >
 | 
	
		
			
				|  |  | +                <a-form-model :model="productForm" layout="inline" @keyup.enter.native="getTableData()" >
 | 
	
		
			
				|  |  |                    <a-row :gutter="15">
 | 
	
		
			
				|  |  | -                    <a-col :md="6" :sm="24">
 | 
	
		
			
				|  |  | +                    <a-col :md="5" :sm="24">
 | 
	
		
			
				|  |  |                        <a-form-model-item label="产品编码">
 | 
	
		
			
				|  |  |                          <a-input v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
 | 
	
		
			
				|  |  |                        </a-form-model-item>
 | 
	
		
			
				|  |  |                      </a-col>
 | 
	
		
			
				|  |  | -                    <a-col :md="6" :sm="24">
 | 
	
		
			
				|  |  | +                    <a-col :md="5" :sm="24">
 | 
	
		
			
				|  |  |                        <a-form-model-item label="产品名称">
 | 
	
		
			
				|  |  |                          <a-input v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
 | 
	
		
			
				|  |  |                        </a-form-model-item>
 | 
	
		
			
				|  |  |                      </a-col>
 | 
	
		
			
				|  |  |                      <a-col :md="8" :sm="24">
 | 
	
		
			
				|  |  | -                      <a-form-model-item style="margin-bottom: 10px;">
 | 
	
		
			
				|  |  | -                        <a-button type="primary" @click="$refs.purchaseTable.refresh(true)" :disabled="purchaseDisabled" id="purchaseNewOrderEdit-refresh">查询</a-button>
 | 
	
		
			
				|  |  | +                      <div style="margin-bottom: 10px;">
 | 
	
		
			
				|  |  | +                        <a-button type="primary" @click="getTableData()" :disabled="purchaseDisabled" id="purchaseNewOrderEdit-refresh">查询</a-button>
 | 
	
		
			
				|  |  |                          <a-button style="margin-left: 5px" @click="resetPurchaseForm" id="purchaseNewOrderEdit-reset">重置</a-button>
 | 
	
		
			
				|  |  | -                      </a-form-model-item>
 | 
	
		
			
				|  |  | +                      </div>
 | 
	
		
			
				|  |  |                      </a-col>
 | 
	
		
			
				|  |  |                    </a-row>
 | 
	
		
			
				|  |  |                  </a-form-model>
 | 
	
	
		
			
				|  | @@ -98,44 +95,21 @@
 | 
	
		
			
				|  |  |              </a-row>
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  |            <!-- 列表 -->
 | 
	
		
			
				|  |  | -          <s-table
 | 
	
		
			
				|  |  | -            class="sTable"
 | 
	
		
			
				|  |  | -            ref="purchaseTable"
 | 
	
		
			
				|  |  | -            :style="{ height: tableHeight +'px', overflow: 'auto' }"
 | 
	
		
			
				|  |  | -            size="small"
 | 
	
		
			
				|  |  | -            :rowKey="(record) => record.id"
 | 
	
		
			
				|  |  | +          <a-spin :spinning="spinning" tip="Loading...">
 | 
	
		
			
				|  |  | +          <ve-table
 | 
	
		
			
				|  |  | +            border-y
 | 
	
		
			
				|  |  | +            :border-around="false"
 | 
	
		
			
				|  |  | +            :max-height="tableHeight"
 | 
	
		
			
				|  |  | +            :row-style-option="{clickHighlight: true}"
 | 
	
		
			
				|  |  | +            :cellSelectionOption="{enable: false}"
 | 
	
		
			
				|  |  | +            :virtual-scroll-option="{enable: true}"
 | 
	
		
			
				|  |  |              :columns="chooseColumns"
 | 
	
		
			
				|  |  | -            :data="chooseLoadData"
 | 
	
		
			
				|  |  | -            :defaultLoadData="false"
 | 
	
		
			
				|  |  | -            :showPagination="false"
 | 
	
		
			
				|  |  | -            :pageSize="5000"
 | 
	
		
			
				|  |  | -            bordered>
 | 
	
		
			
				|  |  | -            <!-- 采购数量 -->
 | 
	
		
			
				|  |  | -            <template slot="storageQuantity" slot-scope="text, record">
 | 
	
		
			
				|  |  | -              <a-input-number
 | 
	
		
			
				|  |  | -                size="small"
 | 
	
		
			
				|  |  | -                id="purchaseNewOrderEdit-qty"
 | 
	
		
			
				|  |  | -                v-model="record.qty"
 | 
	
		
			
				|  |  | -                :precision="0"
 | 
	
		
			
				|  |  | -                :min="1"
 | 
	
		
			
				|  |  | -                :max="999999"
 | 
	
		
			
				|  |  | -                @blur="e => qtyBlur(e.target.value, record)"
 | 
	
		
			
				|  |  | -                style="width: 100%;"
 | 
	
		
			
				|  |  | -                placeholder="请输入" />
 | 
	
		
			
				|  |  | -            </template>
 | 
	
		
			
				|  |  | -            <!-- 操作 -->
 | 
	
		
			
				|  |  | -            <template slot="action" slot-scope="text, record">
 | 
	
		
			
				|  |  | -              <a-button
 | 
	
		
			
				|  |  | -                size="small"
 | 
	
		
			
				|  |  | -                type="link"
 | 
	
		
			
				|  |  | -                class="button-error"
 | 
	
		
			
				|  |  | -                :loading="delLoading"
 | 
	
		
			
				|  |  | -                @click="handleDel(record)"
 | 
	
		
			
				|  |  | -                id="purchaseNewOrderEdit-del-btn">删除</a-button>
 | 
	
		
			
				|  |  | -            </template>
 | 
	
		
			
				|  |  | -          </s-table>
 | 
	
		
			
				|  |  | +            :table-data="localDataSource"
 | 
	
		
			
				|  |  | +            row-key-field-name="id"
 | 
	
		
			
				|  |  | +          />
 | 
	
		
			
				|  |  | +        </a-spin>
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  | -        <div v-else>
 | 
	
		
			
				|  |  | +        <div class="choosed-table" v-else>
 | 
	
		
			
				|  |  |            <div v-if="!spinning&&localDataSource.length==0">
 | 
	
		
			
				|  |  |              <a-empty
 | 
	
		
			
				|  |  |                :image="simpleImage"
 | 
	
	
		
			
				|  | @@ -144,7 +118,7 @@
 | 
	
		
			
				|  |  |                }"
 | 
	
		
			
				|  |  |              >
 | 
	
		
			
				|  |  |                <span slot="description"> 暂无产品 </span>
 | 
	
		
			
				|  |  | -              <a-button type="primary" class="button-error" @click="openChooseProduct=true"><a-icon type="plus-circle" />立即添加产品</a-button>
 | 
	
		
			
				|  |  | +              <a-button type="primary" class="button-error" @click="openChooseProduct=true"><a-icon type="plus" />立即添加产品</a-button>
 | 
	
		
			
				|  |  |              </a-empty>
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  |            <div style="text-align: center;padding: 30px 50px;" v-if="spinning">
 | 
	
	
		
			
				|  | @@ -153,7 +127,7 @@
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |        <!-- 底部栏 -->
 | 
	
		
			
				|  |  | -      <div class="footer-cont">
 | 
	
		
			
				|  |  | +      <div class="footer-cont" v-if="detail&&detail.totalCategory">
 | 
	
		
			
				|  |  |          <!-- 总计 -->
 | 
	
		
			
				|  |  |          <div>
 | 
	
		
			
				|  |  |            <span style="color:#666;">
 | 
	
	
		
			
				|  | @@ -173,6 +147,7 @@
 | 
	
		
			
				|  |  |              :loading="subLoading"
 | 
	
		
			
				|  |  |              @click="handleSubmit"
 | 
	
		
			
				|  |  |              style="padding: 0 60px;">提交</a-button>
 | 
	
		
			
				|  |  | +            <!-- <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button> -->
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |      </div>
 | 
	
	
		
			
				|  | @@ -180,6 +155,20 @@
 | 
	
		
			
				|  |  |      <importGuideModal :openModal="openGuideModal" :params="{purchaseBillSn: $route.params.sn}" @close="openGuideModal=false" @ok="hanldeOks" />
 | 
	
		
			
				|  |  |      <!-- 选择地址 -->
 | 
	
		
			
				|  |  |      <choose-address-modal :openModal="openAddrModal" @ok="handleAddrOk" @close="openAddrModal=false" />
 | 
	
		
			
				|  |  | +    <!-- 添加产品 -->
 | 
	
		
			
				|  |  | +    <chooseProductModal
 | 
	
		
			
				|  |  | +      ref="chooseProduct"
 | 
	
		
			
				|  |  | +      :isDealerUp="isDealerUp"
 | 
	
		
			
				|  |  | +      :purchaseBillSn="$route.params.sn"
 | 
	
		
			
				|  |  | +      :showModal="openChooseProduct"
 | 
	
		
			
				|  |  | +      @close="openChooseProduct=false"
 | 
	
		
			
				|  |  | +      @add="handleAdd"
 | 
	
		
			
				|  |  | +    ></chooseProductModal>
 | 
	
		
			
				|  |  | +    <!-- 上次缺货 -->
 | 
	
		
			
				|  |  | +    <outStockModal :openModal="openOutStockModal" :paramsData="paramsData" @close="openOutStockModal=false" @ok="hanldeOkOutStock" />
 | 
	
		
			
				|  |  | +    <!-- 购物车 -->
 | 
	
		
			
				|  |  | +    <shopingCatModal :showModal="openShopCatModal" :paramsData="paramsData" @close="openShopCatModal=false" @ok="getOrderDetail(false, true)"></shopingCatModal>
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -195,12 +184,51 @@ import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel, purchaseDeta
 | 
	
		
			
				|  |  |  // 选择产品
 | 
	
		
			
				|  |  |  import chooseProductModal from './chooseProductModal.vue'
 | 
	
		
			
				|  |  |  // 打印
 | 
	
		
			
				|  |  | -import Print from '@/views/common/print.vue'
 | 
	
		
			
				|  |  | +import PrintPanel from '@/views/common/printPanel.vue'
 | 
	
		
			
				|  |  |  import { hdPrint } from '@/libs/JGPrint'
 | 
	
		
			
				|  |  |  const shopingCatModal = () => import(/* webpackChunkName: "shopingCatModal" */ '@/views/common/shopingCatModal.vue')
 | 
	
		
			
				|  |  | +const qtyComp = {
 | 
	
		
			
				|  |  | +        name: "qtyComp",
 | 
	
		
			
				|  |  | +        template: `
 | 
	
		
			
				|  |  | +        <a-input-number
 | 
	
		
			
				|  |  | +              size="small"
 | 
	
		
			
				|  |  | +              v-model="row.qty"
 | 
	
		
			
				|  |  | +              :precision="0"
 | 
	
		
			
				|  |  | +              :min="1"
 | 
	
		
			
				|  |  | +              :max="999999"
 | 
	
		
			
				|  |  | +              @blur="e => that.qtyBlur(e.target.value, row)"
 | 
	
		
			
				|  |  | +              style="width: 100%;"
 | 
	
		
			
				|  |  | +              placeholder="请输入" />
 | 
	
		
			
				|  |  | +    `,
 | 
	
		
			
				|  |  | +        props: {
 | 
	
		
			
				|  |  | +            row: Object,
 | 
	
		
			
				|  |  | +            column: Object,
 | 
	
		
			
				|  |  | +            rowIndex: Number,
 | 
	
		
			
				|  |  | +            that: Object
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +const actionComp = {
 | 
	
		
			
				|  |  | +        name: "actionComp",
 | 
	
		
			
				|  |  | +        template: `
 | 
	
		
			
				|  |  | +        <a-button
 | 
	
		
			
				|  |  | +          size="small"
 | 
	
		
			
				|  |  | +          type="link"
 | 
	
		
			
				|  |  | +          class="button-error"
 | 
	
		
			
				|  |  | +          :loading="row.delLoading"
 | 
	
		
			
				|  |  | +          @click="that.handleDel(row)"
 | 
	
		
			
				|  |  | +          >删除</a-button>
 | 
	
		
			
				|  |  | +    `,
 | 
	
		
			
				|  |  | +        props: {
 | 
	
		
			
				|  |  | +            row: Object,
 | 
	
		
			
				|  |  | +            column: Object,
 | 
	
		
			
				|  |  | +            rowIndex: Number,
 | 
	
		
			
				|  |  | +            that: Object
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    name: 'PurchaseEdit',
 | 
	
		
			
				|  |  | -  components: { STable, VSelect, ImportGuideModal, outStockModal, Print, chooseAddressModal, chooseProductModal, shopingCatModal },
 | 
	
		
			
				|  |  | +  components: { STable, VSelect, ImportGuideModal, outStockModal, PrintPanel, chooseAddressModal, chooseProductModal, shopingCatModal },
 | 
	
		
			
				|  |  |    mixins: [commonMixin],
 | 
	
		
			
				|  |  |    data () {
 | 
	
		
			
				|  |  |      return {
 | 
	
	
		
			
				|  | @@ -216,31 +244,13 @@ export default {
 | 
	
		
			
				|  |  |        subLoading: false,
 | 
	
		
			
				|  |  |        orderCountData: null,
 | 
	
		
			
				|  |  |        delLoading: false,
 | 
	
		
			
				|  |  | +      showSearch: false,
 | 
	
		
			
				|  |  |        productForm: {
 | 
	
		
			
				|  |  |          productName: '',
 | 
	
		
			
				|  |  |          productCode: '',
 | 
	
		
			
				|  |  |          orderBy: 'purchase_bill_detail.CREATE_DATE desc'
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        purchaseDisabled: false, //  查询、重置按钮是否可操作
 | 
	
		
			
				|  |  | -      // 加载数据方法 必须为 Promise 对象
 | 
	
		
			
				|  |  | -      chooseLoadData: parameter => {
 | 
	
		
			
				|  |  | -        this.disabled = true
 | 
	
		
			
				|  |  | -        this.spinning = true
 | 
	
		
			
				|  |  | -        // 查询总计
 | 
	
		
			
				|  |  | -        const params = Object.assign({ pageNo: 1, pageSize: 5000 }, this.productForm, { purchaseBillSn: this.$route.params.sn })
 | 
	
		
			
				|  |  | -        return purchaseDetailList(params).then(res => {
 | 
	
		
			
				|  |  | -          const 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
 | 
	
		
			
				|  |  | -            data.list[i].qtyBackups = data.list[i].qty
 | 
	
		
			
				|  |  | -          }
 | 
	
		
			
				|  |  | -          this.localDataSource = data.list
 | 
	
		
			
				|  |  | -          this.disabled = false
 | 
	
		
			
				|  |  | -          this.spinning = false
 | 
	
		
			
				|  |  | -          return data
 | 
	
		
			
				|  |  | -        })
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  |        localDataSource: [],
 | 
	
		
			
				|  |  |        openGuideModal: false, //  导入产品引导
 | 
	
		
			
				|  |  |        openOutStockModal: false,
 | 
	
	
		
			
				|  | @@ -255,21 +265,61 @@ export default {
 | 
	
		
			
				|  |  |      chooseColumns () {
 | 
	
		
			
				|  |  |        const _this = this
 | 
	
		
			
				|  |  |        const arr = [
 | 
	
		
			
				|  |  | -        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
 | 
	
		
			
				|  |  | -        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '20%', align: 'center' },
 | 
	
		
			
				|  |  | -        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '35%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
 | 
	
		
			
				|  |  | -        { title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: '8%', align: 'center' },
 | 
	
		
			
				|  |  | -        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
 | 
	
		
			
				|  |  | -        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
 | 
	
		
			
				|  |  | +        { title: '序号', key: "a", field: 'no', width: '5%', align: 'center', operationColumn: false },
 | 
	
		
			
				|  |  | +        { title: '产品编码',key: "b", field: 'productCode', width: '10%', align: 'center', operationColumn: false},
 | 
	
		
			
				|  |  | +        { title: '产品名称',key: "c", field: 'productName', width: '35%', align: 'center', operationColumn: false,ellipsis: {showTitle: true} },
 | 
	
		
			
				|  |  | +        { title: '采购数量',key: "d", width: '10%', align: 'center', operationColumn: false, 
 | 
	
		
			
				|  |  | +        renderBodyCell: ({ row, column, rowIndex }, h) => {
 | 
	
		
			
				|  |  | +            return <qtyComp row={row} column={column} rowIndex={rowIndex} that={_this} />
 | 
	
		
			
				|  |  | +        }},
 | 
	
		
			
				|  |  | +        { title: '单位',key: "e", field: 'productUnit', width: '10%', align: 'center', operationColumn: false },
 | 
	
		
			
				|  |  | +        { title: '操作',key: "f", width: '10%', align: 'center', operationColumn: false,
 | 
	
		
			
				|  |  | +        renderBodyCell: ({ row, column, rowIndex }, h) => {
 | 
	
		
			
				|  |  | +            return <actionComp row={row} column={column} rowIndex={rowIndex} that={_this} />
 | 
	
		
			
				|  |  | +        }}
 | 
	
		
			
				|  |  |        ]
 | 
	
		
			
				|  |  |        if (this.$hasPermissions('M_ShowAllCost')) {
 | 
	
		
			
				|  |  | -        arr.splice(3, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
 | 
	
		
			
				|  |  | -        arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
 | 
	
		
			
				|  |  | +        arr.splice(3, 0, { title: '采购单价',key: "h", field: 'discountedPriceText', width: '10%', align: 'right', operationColumn: false})
 | 
	
		
			
				|  |  | +        arr.splice(6, 0, { title: '采购金额',key: "i", field: 'discountedAmountText', width: '10%', align: 'right', operationColumn: false})
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        return arr
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | +    handleActions(e){
 | 
	
		
			
				|  |  | +      if(e.key == 1){
 | 
	
		
			
				|  |  | +        this.openGuideModal=true
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      if(e.key == 2){
 | 
	
		
			
				|  |  | +        this.handleOutStock()
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      if(e.key == 3){
 | 
	
		
			
				|  |  | +        this.hanldCart()
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    getTableData(){
 | 
	
		
			
				|  |  | +        this.disabled = true
 | 
	
		
			
				|  |  | +        this.spinning = true
 | 
	
		
			
				|  |  | +        // 查询总计
 | 
	
		
			
				|  |  | +        const params = Object.assign({ pageNo: 1, pageSize: 10000 }, this.productForm, { purchaseBillSn: this.$route.params.sn })
 | 
	
		
			
				|  |  | +        purchaseDetailList(params).then(res => {
 | 
	
		
			
				|  |  | +          const data = res.data
 | 
	
		
			
				|  |  | +          const no = (data.pageNo - 1) * data.pageSize
 | 
	
		
			
				|  |  | +          for (var i = 0; i < data.list.length; i++) {
 | 
	
		
			
				|  |  | +            const row = data.list[i]
 | 
	
		
			
				|  |  | +            row.no = no + i + 1
 | 
	
		
			
				|  |  | +            row.qtyBackups = row.qty
 | 
	
		
			
				|  |  | +            row.productCode = row.dealerProductEntity.code || '--'
 | 
	
		
			
				|  |  | +            row.productName = row.dealerProductEntity.name || '--'
 | 
	
		
			
				|  |  | +            row.productUnit = row.dealerProductEntity.unit || '--'
 | 
	
		
			
				|  |  | +            row.discountedPriceText = (row.discountedPrice||row.discountedPrice==0)?this.toThousands(row.discountedPrice, 2):'--'
 | 
	
		
			
				|  |  | +            row.discountedAmountText = (row.discountedAmount||row.discountedAmount==0)?this.toThousands(row.discountedAmount, 2):'--'
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          this.localDataSource = data.list
 | 
	
		
			
				|  |  | +          this.disabled = false
 | 
	
		
			
				|  |  | +          this.spinning = false
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      // 获取采购单基本信息
 | 
	
		
			
				|  |  |      getOrderDetail (noRefashTable, isReset, flag) {
 | 
	
		
			
				|  |  |        this.spinning = true
 | 
	
	
		
			
				|  | @@ -281,7 +331,7 @@ export default {
 | 
	
		
			
				|  |  |                if (isReset) {
 | 
	
		
			
				|  |  |                  this.resetPurchaseForm()
 | 
	
		
			
				|  |  |                } else {
 | 
	
		
			
				|  |  | -                this.$refs.purchaseTable.refresh(!!flag)
 | 
	
		
			
				|  |  | +                this.getTableData()
 | 
	
		
			
				|  |  |                }
 | 
	
		
			
				|  |  |              } else {
 | 
	
		
			
				|  |  |                this.localDataSource = []
 | 
	
	
		
			
				|  | @@ -304,14 +354,14 @@ export default {
 | 
	
		
			
				|  |  |          centered: true,
 | 
	
		
			
				|  |  |          closable: true,
 | 
	
		
			
				|  |  |          onOk () {
 | 
	
		
			
				|  |  | -          _this.delLoading = true
 | 
	
		
			
				|  |  | +          row.delLoading = true
 | 
	
		
			
				|  |  |            purchaseDetailDel({ id: row.id }).then(res => {
 | 
	
		
			
				|  |  |              if (res.status == 200) {
 | 
	
		
			
				|  |  |                _this.getOrderDetail(false, false, true)
 | 
	
		
			
				|  |  |                _this.$message.success(res.message)
 | 
	
		
			
				|  |  | -              _this.delLoading = false
 | 
	
		
			
				|  |  | +              row.delLoading = false
 | 
	
		
			
				|  |  |              } else {
 | 
	
		
			
				|  |  | -              _this.delLoading = false
 | 
	
		
			
				|  |  | +              row.delLoading = false
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |            })
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -329,7 +379,7 @@ export default {
 | 
	
		
			
				|  |  |        this.productForm.productName = ''
 | 
	
		
			
				|  |  |        this.productForm.productCode = ''
 | 
	
		
			
				|  |  |        this.$nextTick(() => {
 | 
	
		
			
				|  |  | -        this.$refs.purchaseTable.refresh(true)
 | 
	
		
			
				|  |  | +        this.getTableData()
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //  添加或修改
 | 
	
	
		
			
				|  | @@ -462,7 +512,7 @@ export default {
 | 
	
		
			
				|  |  |        this.$router.push({ name: 'purchaseOrderNewList' })
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      setTableH () {
 | 
	
		
			
				|  |  | -      this.tableHeight = window.innerHeight - (this.isShowBisiceInfo ? 440 : 310)
 | 
	
		
			
				|  |  | +      this.tableHeight = window.innerHeight - (this.isShowBisiceInfo ? 127 : 0) - (this.showSearch ? 42 : 0) - 210
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      pageInit () {
 | 
	
		
			
				|  |  |        this.$nextTick(() => {
 | 
	
	
		
			
				|  | @@ -474,6 +524,13 @@ export default {
 | 
	
		
			
				|  |  |    watch: {
 | 
	
		
			
				|  |  |      isShowBisiceInfo (newValue, oldValue) {
 | 
	
		
			
				|  |  |        this.setTableH()
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    showSearch(newValue, oldValue){
 | 
	
		
			
				|  |  | +      if(this.isShowBisiceInfo){
 | 
	
		
			
				|  |  | +        this.isShowBisiceInfo = false
 | 
	
		
			
				|  |  | +      }else{
 | 
	
		
			
				|  |  | +        this.setTableH()
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    mounted () {
 | 
	
	
		
			
				|  | @@ -500,13 +557,16 @@ export default {
 | 
	
		
			
				|  |  |      position: relative;
 | 
	
		
			
				|  |  |      height: 100%;
 | 
	
		
			
				|  |  |      box-sizing: border-box;
 | 
	
		
			
				|  |  | +    .ant-descriptions-title{
 | 
	
		
			
				|  |  | +      margin-bottom: 10px;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |      .billno{
 | 
	
		
			
				|  |  | -      margin: 0 0 0 30px;
 | 
	
		
			
				|  |  | -      font-size: 18px;
 | 
	
		
			
				|  |  | +      margin: 0;
 | 
	
		
			
				|  |  | +      font-size: 16px;
 | 
	
		
			
				|  |  |        font-weight: 600;
 | 
	
		
			
				|  |  |        display: inline-block;
 | 
	
		
			
				|  |  |        vertical-align: middle;
 | 
	
		
			
				|  |  | -      color: #666;
 | 
	
		
			
				|  |  | +      color: #333;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      .choosedList-cont{
 | 
	
		
			
				|  |  |        position: relative;
 | 
	
	
		
			
				|  | @@ -556,7 +616,7 @@ export default {
 | 
	
		
			
				|  |  |            &:first-child{
 | 
	
		
			
				|  |  |              padding: 0 15px;
 | 
	
		
			
				|  |  |              strong{
 | 
	
		
			
				|  |  | -              color: #ff8d00;
 | 
	
		
			
				|  |  | +              color: #ed1c24;
 | 
	
		
			
				|  |  |                font-size: 18px;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |            }
 | 
	
	
		
			
				|  | @@ -567,12 +627,25 @@ export default {
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      .purchaseNewOrderEdit-cont{
 | 
	
		
			
				|  |  | -      margin-bottom: 8px;
 | 
	
		
			
				|  |  | +      margin-bottom: 6px;
 | 
	
		
			
				|  |  |        .sub-title{
 | 
	
		
			
				|  |  |          font-size: 12px;
 | 
	
		
			
				|  |  |          color: #808695;
 | 
	
		
			
				|  |  |          margin-left: 10px;
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +    .table-page-search-wrapper{
 | 
	
		
			
				|  |  | +      .ant-form.ant-form-inline .ant-form-item .ant-input, .ant-form.ant-form-inline .ant-form-item .ant-select-selection{
 | 
	
		
			
				|  |  | +        border:0;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      .ant-form.ant-form-inline .ant-form-item{
 | 
	
		
			
				|  |  | +        border:1px solid #dadada;
 | 
	
		
			
				|  |  | +        border-radius: 3px;
 | 
	
		
			
				|  |  | +        .ant-form-item-label{
 | 
	
		
			
				|  |  | +          padding-left: 11px;
 | 
	
		
			
				|  |  | +          padding-right: 0!important;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  </style>
 |