|
@@ -1,6 +1,5 @@
|
|
<template>
|
|
<template>
|
|
<div v-if="showPage" class="jg-page-wrap salesEdit-wrap">
|
|
<div v-if="showPage" class="jg-page-wrap salesEdit-wrap">
|
|
- <a-spin :spinning="spinning" tip="Loading...">
|
|
|
|
<a-page-header :ghost="false" :backIcon="false" class="header-bar">
|
|
<a-page-header :ghost="false" :backIcon="false" class="header-bar">
|
|
<!-- 自定义的二级文字标题 -->
|
|
<!-- 自定义的二级文字标题 -->
|
|
<template slot="subTitle">
|
|
<template slot="subTitle">
|
|
@@ -29,6 +28,15 @@
|
|
<a-divider type="vertical" v-if="detailData&&detailData.totalCategory" />
|
|
<a-divider type="vertical" v-if="detailData&&detailData.totalCategory" />
|
|
<a-button v-if="detailData&&detailData.totalCategory" id="salesNewOrderEdit-add-btn" type="link" @click="openChooseProduct=true"><a-icon type="plus" />添加产品</a-button>
|
|
<a-button v-if="detailData&&detailData.totalCategory" id="salesNewOrderEdit-add-btn" type="link" @click="openChooseProduct=true"><a-icon type="plus" />添加产品</a-button>
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
|
|
+ <a-dropdown v-model="showCell" v-if="$hasPermissions('M_ShowAllCost')">
|
|
|
|
+ <a-button type="link" class="button-default"> <a-icon type="setting" /> 显示</a-button>
|
|
|
|
+ <a-menu slot="overlay">
|
|
|
|
+ <a-menu-item>
|
|
|
|
+ <a-checkbox v-model="isCosts" id="salesQuery-edit-cost">成本价</a-checkbox>
|
|
|
|
+ </a-menu-item>
|
|
|
|
+ </a-menu>
|
|
|
|
+ </a-dropdown>
|
|
|
|
+ <a-divider type="vertical" v-if="$hasPermissions('M_ShowAllCost')"/>
|
|
<a-dropdown>
|
|
<a-dropdown>
|
|
<a-menu slot="overlay" @click="handleActions">
|
|
<a-menu slot="overlay" @click="handleActions">
|
|
<a-menu-item key="4">
|
|
<a-menu-item key="4">
|
|
@@ -49,174 +57,208 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</a-page-header>
|
|
</a-page-header>
|
|
- <a-card size="small" :bordered="false" class="salesEdit-cont">
|
|
|
|
- <!-- 查询配件列表 -->
|
|
|
|
- <queryPart
|
|
|
|
- ref="partQuery"
|
|
|
|
- :newLoading="isInster"
|
|
|
|
- @add="insterProduct"
|
|
|
|
- @isCost="isCost"></queryPart>
|
|
|
|
- </a-card>
|
|
|
|
- <a-card size="small" :bordered="false" class="salesEdit-cont">
|
|
|
|
- <!-- 总计 -->
|
|
|
|
- <a-alert v-if="detailData" style="margin-bottom: 10px;" type="info">
|
|
|
|
- <div slot="message" class="total-bar">
|
|
|
|
- <div>
|
|
|
|
- 总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;
|
|
|
|
- 总款数:<strong>{{ detailData&&(detailData.totalCategory || detailData.totalCategory==0) ? detailData.totalCategory : '--' }}</strong>;
|
|
|
|
- 总数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
|
|
|
|
- 赠品总数量:<strong>{{ detailData&&(detailData.giftQty || detailData.giftQty==0) ? detailData.giftQty : '--' }}</strong>;
|
|
|
|
- <span v-if="isCosts">
|
|
|
|
- 总成本价:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;
|
|
|
|
- 毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;
|
|
|
|
- </span>
|
|
|
|
|
|
+ <!-- 已选产品 -->
|
|
|
|
+ <div class="choosedList-cont">
|
|
|
|
+ <div class="choosed-table" v-if="detailData&&detailData.totalCategory">
|
|
|
|
+ <!-- 搜索条件 -->
|
|
|
|
+ <div class="table-page-search-wrapper" style="margin-bottom:0;" v-if="showSearch">
|
|
|
|
+ <a-row :gutter="0">
|
|
|
|
+ <a-col :lg="24" :xl="14">
|
|
|
|
+ <a-form-model :model="productForm" ref="ruleForm" layout="inline" @keyup.enter.native="$refs.table.refresh(true)" >
|
|
|
|
+ <a-row :gutter="10">
|
|
|
|
+ <a-col :md="6" :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-form-model-item label="产品名称">
|
|
|
|
+ <a-input v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="是否有急件">
|
|
|
|
+ <a-select allowClear v-model="productForm.oosFlag" placeholder="请选择是否">
|
|
|
|
+ <a-select-option value="1">
|
|
|
|
+ 是
|
|
|
|
+ </a-select-option>
|
|
|
|
+ <a-select-option value="0">
|
|
|
|
+ 否
|
|
|
|
+ </a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesEdit-refresh">查询</a-button>
|
|
|
|
+ <a-button style="margin-left: 5px" @click="resetForm" id="salesEdit-reset">重置</a-button>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form-model>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :lg="24" :xl="10">
|
|
|
|
+ <div style="display:flex;align-items:center;padding: 6px 0;justify-content: flex-end;width:100%;">
|
|
|
|
+ <div>
|
|
|
|
+ 折扣金额:
|
|
|
|
+ <a-input-number
|
|
|
|
+ id="discount"
|
|
|
|
+ size="small"
|
|
|
|
+ v-model.trim="detailData.discountAmount"
|
|
|
|
+ :min="0"
|
|
|
|
+ :precision="2"
|
|
|
|
+ :max="999999"/>
|
|
|
|
+ <a-button size="small" type="primary" class="button-primary" @click="salesDiscount">打折</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="padding:0 10px;">
|
|
|
|
+ 折扣:<strong>{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</strong>;
|
|
|
|
+ 折后总售价:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>;
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 已选配件列表 -->
|
|
|
|
+ <s-table
|
|
|
|
+ class="sTable"
|
|
|
|
+ ref="table"
|
|
|
|
+ size="small"
|
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :data="loadData"
|
|
|
|
+ :scroll="{ y: tableHeight }"
|
|
|
|
+ :defaultLoadData="false"
|
|
|
|
+ :pageSize="30"
|
|
|
|
+ bordered>
|
|
|
|
+ <div slot="costTitle">
|
|
|
|
+ <a-tooltip placement="top">
|
|
|
|
+ <template slot="title">
|
|
|
|
+ 系统中不同批次的产品,成本价可能不同,此值是按照实际出库批次的成本计算得到。
|
|
|
|
+ </template>
|
|
|
|
+ <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
|
|
|
|
+ </a-tooltip>
|
|
</div>
|
|
</div>
|
|
- <div>
|
|
|
|
- <div>
|
|
|
|
- 折扣金额:
|
|
|
|
|
|
+ <!-- 产品名称 -->
|
|
|
|
+ <template slot="productName" slot-scope="text, record">
|
|
|
|
+ <a-tag color="blue" v-if="record.shelfPlaceCode">{{ record.shelfPlaceCode }}</a-tag>
|
|
|
|
+ <span>{{ text }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 产品编码 -->
|
|
|
|
+ <template slot="productCode" slot-scope="text, record">
|
|
|
|
+ <div v-if="detailData">
|
|
|
|
+ <div v-if="isOwerEdit">
|
|
|
|
+ <a-badge count="急" v-if="record.oosFlag == 1">
|
|
|
|
+ <div style="padding-right: 15px;">{{ text }}</div>
|
|
|
|
+ </a-badge>
|
|
|
|
+ <span v-else>{{ text }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else>
|
|
|
|
+ <a-badge count="急" v-if="isAudit&&record.oosFlag == 1">
|
|
|
|
+ <div style="padding-right: 15px;">{{ text }}</div>
|
|
|
|
+ </a-badge>
|
|
|
|
+ <a-badge count="缺" v-else-if="!isAudit&&(!record.currentStockQty || record.currentStockQty < record.qty)">
|
|
|
|
+ <div style="padding-right: 15px;">{{ text }}</div>
|
|
|
|
+ </a-badge>
|
|
|
|
+ <span v-else>{{ text }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 售价 -->
|
|
|
|
+ <template slot="price" slot-scope="text, record">
|
|
|
|
+ <div style="display:flex;align-items: center;" :class="record.cost > record.price?'redBg-row':''">
|
|
<a-input-number
|
|
<a-input-number
|
|
- id="discount"
|
|
|
|
- size="small"
|
|
|
|
- v-model.trim="detailData.discountAmount"
|
|
|
|
- :min="0"
|
|
|
|
- :precision="2"
|
|
|
|
- :max="999999"/>
|
|
|
|
- <a-button size="small" type="primary" class="button-primary" @click="salesDiscount">打折</a-button>
|
|
|
|
|
|
+ size="small"
|
|
|
|
+ v-model="record.price"
|
|
|
|
+ :precision="2"
|
|
|
|
+ :min="0"
|
|
|
|
+ :max="999999"
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ @blur="e => priceBlur(e.target.value, record)"
|
|
|
|
+ style="flex-grow: 1;margin-right: 3px;"
|
|
|
|
+ />
|
|
|
|
+ <div v-if="record.cost > record.price">
|
|
|
|
+ <a-tooltip placement="top">
|
|
|
|
+ <template slot="title">
|
|
|
|
+ 售价低于成本价
|
|
|
|
+ </template>
|
|
|
|
+ <a-icon type="question-circle" />
|
|
|
|
+ </a-tooltip>
|
|
</div>
|
|
</div>
|
|
- <div>
|
|
|
|
- 折扣:<strong>{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</strong>;
|
|
|
|
- 折后总售价:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>;
|
|
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 销售数量 -->
|
|
|
|
+ <template slot="salesNums" slot-scope="text, record">
|
|
|
|
+ <a-input-number
|
|
|
|
+ id="salesEdit-salesNums"
|
|
|
|
+ size="small"
|
|
|
|
+ v-model="record.qty"
|
|
|
|
+ :precision="0"
|
|
|
|
+ :min="1"
|
|
|
|
+ :max="999999"
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ @blur="e => qtyBlur(e.target.value, record)"
|
|
|
|
+ style="width: 100%;" />
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 操作 -->
|
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
|
+ <a-button size="small" v-if="record.oosFlag == 0" type="link" class="button-primary" @click="handleViewDetail(record)">出库明细</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ :loading="delLoading"
|
|
|
|
+ class="button-error"
|
|
|
|
+ @click="handleDel(record)"
|
|
|
|
+ id="productInfoList-Del">删除</a-button>
|
|
|
|
+ </template>
|
|
|
|
+ </s-table>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="choosed-table" v-else>
|
|
|
|
+ <div v-if="!spinning&&dataSource.length==0">
|
|
|
|
+ <a-empty
|
|
|
|
+ :image="simpleImage"
|
|
|
|
+ :image-style="{
|
|
|
|
+ height: '60px',
|
|
|
|
+ }"
|
|
|
|
+ >
|
|
|
|
+ <span slot="description"> 暂无产品 </span>
|
|
|
|
+ <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">
|
|
|
|
+ <a-spin :spinning="spinning" tip="Loading..."></a-spin>
|
|
</div>
|
|
</div>
|
|
- </a-alert>
|
|
|
|
- <!-- 搜索条件 -->
|
|
|
|
- <div class="table-page-search-wrapper" v-if="showSearch">
|
|
|
|
- <a-row :gutter="15">
|
|
|
|
- <a-col :md="24" :lg="12">
|
|
|
|
- <a-form-model :model="productForm" ref="ruleForm" layout="inline" @keyup.enter.native="$refs.table.refresh(true)" >
|
|
|
|
- <a-row :gutter="15">
|
|
|
|
- <a-col :md="8" :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="8" :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.table.refresh(true)" :disabled="disabled" id="salesEdit-refresh">查询</a-button>
|
|
|
|
- <a-button style="margin-left: 5px" @click="resetForm" id="salesEdit-reset">重置</a-button>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- </a-row>
|
|
|
|
- </a-form-model>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="24" :lg="12">
|
|
|
|
- <div style="float:right;overflow: hidden;margin-bottom:10px;">
|
|
|
|
- <a-checkbox :value="0" :checked="tbForm.indexOf('AUDIT')>=0" @change="(e)=>{tbFormChange(e,0)}" id="salesQuery-tbsh">同步审核</a-checkbox>
|
|
|
|
- <a-checkbox :value="1" :checked="tbForm.indexOf('STOCK_OUT')>=0" @change="(e)=>{tbFormChange(e,1)}" id="salesQuery-tbck">同步出库</a-checkbox>
|
|
|
|
- <a-checkbox :value="2" :checked="tbForm.indexOf('SETTLE')>=0" @change="(e)=>{tbFormChange(e,2)}" id="salesQuery-tbsk">同步收款</a-checkbox>
|
|
|
|
- <a-button
|
|
|
|
- style="padding: 0 25px;"
|
|
|
|
- type="primary"
|
|
|
|
- :disabled="spinning"
|
|
|
|
- class="button-primary"
|
|
|
|
- @click="enableFundAccount && tbForm.length == 3 ? handleSettleAcountPay(null,0) : handleSubmit({})"
|
|
|
|
- id="productInfoList-handleSubmit">提交</a-button>
|
|
|
|
- </div>
|
|
|
|
- </a-col>
|
|
|
|
- </a-row>
|
|
|
|
</div>
|
|
</div>
|
|
- <!-- 已选配件列表 -->
|
|
|
|
- <s-table
|
|
|
|
- class="sTable"
|
|
|
|
- ref="table"
|
|
|
|
- size="small"
|
|
|
|
- :rowKey="(record) => record.id"
|
|
|
|
- :columns="columns"
|
|
|
|
- :data="loadData"
|
|
|
|
- :defaultLoadData="false"
|
|
|
|
- :pageSize="5"
|
|
|
|
- :rowClassName="(record, index) => record.cost > record.price ? 'redBg-row':''"
|
|
|
|
- bordered>
|
|
|
|
- <div slot="costTitle">
|
|
|
|
- <a-tooltip placement="top">
|
|
|
|
- <template slot="title">
|
|
|
|
- 系统中不同批次的产品,成本价可能不同,此值是按照实际出库批次的成本计算得到。
|
|
|
|
- </template>
|
|
|
|
- <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
|
|
|
|
- </a-tooltip>
|
|
|
|
|
|
+
|
|
|
|
+ <!-- 底部栏 -->
|
|
|
|
+ <div class="footer-bar" v-if="detailData&&detailData.totalCategory">
|
|
|
|
+ <!-- 总计 -->
|
|
|
|
+ <div v-if="detailData" class="total-bar">
|
|
|
|
+ <div>
|
|
|
|
+ 总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;
|
|
|
|
+ 总款数:<strong>{{ detailData&&(detailData.totalCategory || detailData.totalCategory==0) ? detailData.totalCategory : '--' }}</strong>;
|
|
|
|
+ 总数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
|
|
|
|
+ 赠品总数量:<strong>{{ detailData&&(detailData.giftQty || detailData.giftQty==0) ? detailData.giftQty : '--' }}</strong>;
|
|
|
|
+ <span v-if="isCosts">
|
|
|
|
+ 总成本价:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;
|
|
|
|
+ 毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;
|
|
|
|
+ </span>
|
|
</div>
|
|
</div>
|
|
- <!-- 产品名称 -->
|
|
|
|
- <template slot="productName" slot-scope="text, record">
|
|
|
|
- <a-tag color="blue" v-if="record.shelfPlaceCode">{{ record.shelfPlaceCode }}</a-tag>
|
|
|
|
- <span>{{ text }}</span>
|
|
|
|
- </template>
|
|
|
|
- <!-- 产品编码 -->
|
|
|
|
- <template slot="productCode" slot-scope="text, record">
|
|
|
|
- <div v-if="detailData">
|
|
|
|
- <div v-if="isOwerEdit">
|
|
|
|
- <a-badge count="急" v-if="record.oosFlag == 1">
|
|
|
|
- <div style="padding-right: 15px;">{{ text }}</div>
|
|
|
|
- </a-badge>
|
|
|
|
- <span v-else>{{ text }}</span>
|
|
|
|
- </div>
|
|
|
|
- <div v-else>
|
|
|
|
- <a-badge count="急" v-if="isAudit&&record.oosFlag == 1">
|
|
|
|
- <div style="padding-right: 15px;">{{ text }}</div>
|
|
|
|
- </a-badge>
|
|
|
|
- <a-badge count="缺" v-else-if="!isAudit&&(!record.currentStockQty || record.currentStockQty < record.qty)">
|
|
|
|
- <div style="padding-right: 15px;">{{ text }}</div>
|
|
|
|
- </a-badge>
|
|
|
|
- <span v-else>{{ text }}</span>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- <!-- 售价 -->
|
|
|
|
- <template slot="price" slot-scope="text, record">
|
|
|
|
- <a-input-number
|
|
|
|
- id="salesEdit-price"
|
|
|
|
- size="small"
|
|
|
|
- v-model="record.price"
|
|
|
|
- :precision="2"
|
|
|
|
- :min="0"
|
|
|
|
- :max="999999"
|
|
|
|
- placeholder="请输入"
|
|
|
|
- @blur="e => priceBlur(e.target.value, record)"
|
|
|
|
- style="width: 100%;" />
|
|
|
|
- </template>
|
|
|
|
- <!-- 销售数量 -->
|
|
|
|
- <template slot="salesNums" slot-scope="text, record">
|
|
|
|
- <a-input-number
|
|
|
|
- id="salesEdit-salesNums"
|
|
|
|
- size="small"
|
|
|
|
- v-model="record.qty"
|
|
|
|
- :precision="0"
|
|
|
|
- :min="1"
|
|
|
|
- :max="999999"
|
|
|
|
- placeholder="请输入"
|
|
|
|
- @blur="e => qtyBlur(e.target.value, record)"
|
|
|
|
- style="width: 100%;" />
|
|
|
|
- </template>
|
|
|
|
- <!-- 操作 -->
|
|
|
|
- <template slot="action" slot-scope="text, record">
|
|
|
|
- <a-button size="small" v-if="record.oosFlag == 0" type="link" class="button-primary" @click="handleViewDetail(record)">出库明细</a-button>
|
|
|
|
- <a-button
|
|
|
|
- size="small"
|
|
|
|
- type="link"
|
|
|
|
- :loading="delLoading"
|
|
|
|
- class="button-error"
|
|
|
|
- @click="handleDel(record)"
|
|
|
|
- id="productInfoList-Del">删除</a-button>
|
|
|
|
- </template>
|
|
|
|
- </s-table>
|
|
|
|
- </a-card>
|
|
|
|
- </a-spin>
|
|
|
|
- <!-- <div class="affix-cont"></div> -->
|
|
|
|
|
|
+ <div>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <a-checkbox :value="0" :checked="tbForm.indexOf('AUDIT')>=0" @change="(e)=>{tbFormChange(e,0)}" id="salesQuery-tbsh">同步审核</a-checkbox>
|
|
|
|
+ <a-checkbox :value="1" :checked="tbForm.indexOf('STOCK_OUT')>=0" @change="(e)=>{tbFormChange(e,1)}" id="salesQuery-tbck">同步出库</a-checkbox>
|
|
|
|
+ <a-checkbox :value="2" :checked="tbForm.indexOf('SETTLE')>=0" @change="(e)=>{tbFormChange(e,2)}" id="salesQuery-tbsk">同步收款</a-checkbox>
|
|
|
|
+ <a-button
|
|
|
|
+ style="padding: 0 25px;"
|
|
|
|
+ type="primary"
|
|
|
|
+ :disabled="spinning"
|
|
|
|
+ class="button-primary"
|
|
|
|
+ @click="enableFundAccount && tbForm.length == 3 ? handleSettleAcountPay(null,0) : handleSubmit({})"
|
|
|
|
+ id="productInfoList-handleSubmit">提交</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<!-- 选择客户弹框 -->
|
|
<!-- 选择客户弹框 -->
|
|
<choose-custom-modal ref="custModal" :show="openModal" @updateData="updateData" @cancel="openModal=false" />
|
|
<choose-custom-modal ref="custModal" :show="openModal" @updateData="updateData" @cancel="openModal=false" />
|
|
<!-- 导入产品 -->
|
|
<!-- 导入产品 -->
|
|
@@ -225,6 +267,13 @@
|
|
<settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>
|
|
<settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>
|
|
<!-- 出库明细 -->
|
|
<!-- 出库明细 -->
|
|
<outInDetialModal ref="outInDetialModal" outBizType="SALES" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
|
|
<outInDetialModal ref="outInDetialModal" outBizType="SALES" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
|
|
|
|
+ <!-- 添加产品 -->
|
|
|
|
+ <chooseProductModal
|
|
|
|
+ ref="partQuery"
|
|
|
|
+ :showModal="openChooseProduct"
|
|
|
|
+ @close="openChooseProduct=false"
|
|
|
|
+ @add="insterProduct"
|
|
|
|
+ ></chooseProductModal>
|
|
<!-- 选择货架产品 -->
|
|
<!-- 选择货架产品 -->
|
|
<chooseShelfProduct
|
|
<chooseShelfProduct
|
|
v-if="showShelfModal"
|
|
v-if="showShelfModal"
|
|
@@ -239,8 +288,9 @@
|
|
<script>
|
|
<script>
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { mapActions } from 'vuex'
|
|
import { mapActions } from 'vuex'
|
|
|
|
+import { Empty } from 'ant-design-vue'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
-import queryPart from './queryPart.vue'
|
|
|
|
|
|
+import chooseProductModal from './chooseProductModal.vue'
|
|
import chooseCustomModal from './chooseCustomModal.vue'
|
|
import chooseCustomModal from './chooseCustomModal.vue'
|
|
import importGuideModal from './importGuideModal.vue'
|
|
import importGuideModal from './importGuideModal.vue'
|
|
import settleModal from '@/views/financialManagement/settleModal/settleModal.vue'
|
|
import settleModal from '@/views/financialManagement/settleModal/settleModal.vue'
|
|
@@ -254,11 +304,14 @@ import PrintPanel from '@/views/common/printPanel.vue'
|
|
import { hdPrint } from '@/libs/JGPrint'
|
|
import { hdPrint } from '@/libs/JGPrint'
|
|
export default {
|
|
export default {
|
|
name: 'SalesEdit',
|
|
name: 'SalesEdit',
|
|
- components: { STable, VSelect, queryPart, chooseCustomModal, PrintPanel, importGuideModal, settleModal, outInDetialModal, chooseShelfProduct },
|
|
|
|
|
|
+ components: { STable, VSelect, chooseProductModal, chooseCustomModal, PrintPanel, importGuideModal, settleModal, outInDetialModal, chooseShelfProduct },
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
|
|
+ simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
|
|
+ tableHeight: 0,
|
|
showOutInModal: false, // 出入库明细
|
|
showOutInModal: false, // 出入库明细
|
|
|
|
+ showCell: false,
|
|
showPage: false,
|
|
showPage: false,
|
|
spinning: false,
|
|
spinning: false,
|
|
showSearch: false,
|
|
showSearch: false,
|
|
@@ -278,6 +331,7 @@ export default {
|
|
productForm: {
|
|
productForm: {
|
|
productName: '',
|
|
productName: '',
|
|
productCode: '',
|
|
productCode: '',
|
|
|
|
+ oosFlag: undefined,
|
|
orderBy: 'sales_bill_detail.CREATE_DATE desc'
|
|
orderBy: 'sales_bill_detail.CREATE_DATE desc'
|
|
},
|
|
},
|
|
tbForm: [], // 同步操作
|
|
tbForm: [], // 同步操作
|
|
@@ -286,7 +340,9 @@ export default {
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
|
|
+ this.spinning = true
|
|
this.productForm.salesBillSn = this.$route.params.sn
|
|
this.productForm.salesBillSn = this.$route.params.sn
|
|
|
|
+
|
|
return salesDetailList(Object.assign(parameter, this.productForm)).then(res => {
|
|
return salesDetailList(Object.assign(parameter, this.productForm)).then(res => {
|
|
let data
|
|
let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
@@ -300,6 +356,7 @@ export default {
|
|
this.disabled = false
|
|
this.disabled = false
|
|
this.dataSource = data.list || []
|
|
this.dataSource = data.list || []
|
|
}
|
|
}
|
|
|
|
+ this.spinning = false
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -444,7 +501,7 @@ export default {
|
|
qty: record.qty,
|
|
qty: record.qty,
|
|
price: record.price
|
|
price: record.price
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- this.resetSearchForm(false)
|
|
|
|
|
|
+ this.getOrderDetail(false,true)
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.$message.info(res.message)
|
|
this.$message.info(res.message)
|
|
}
|
|
}
|
|
@@ -479,7 +536,7 @@ export default {
|
|
qty: record.qty,
|
|
qty: record.qty,
|
|
price: record.price
|
|
price: record.price
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- this.resetSearchForm(false)
|
|
|
|
|
|
+ this.getOrderDetail(false,true)
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.$message.info(res.message)
|
|
this.$message.info(res.message)
|
|
this.spinning = false
|
|
this.spinning = false
|
|
@@ -491,20 +548,12 @@ export default {
|
|
record.price = record.priceBackups
|
|
record.price = record.priceBackups
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- isCost (val) {
|
|
|
|
- this.isCosts = val
|
|
|
|
- },
|
|
|
|
- // 重置
|
|
|
|
- resetSearchForm (flag) {
|
|
|
|
- if (flag) { this.$refs.partQuery.onlyList = true }
|
|
|
|
- this.$refs.table.refresh(!!flag)
|
|
|
|
- this.getOrderDetail(false)
|
|
|
|
- },
|
|
|
|
// 重置列表
|
|
// 重置列表
|
|
resetForm () {
|
|
resetForm () {
|
|
this.productForm = {
|
|
this.productForm = {
|
|
productName: '',
|
|
productName: '',
|
|
productCode: '',
|
|
productCode: '',
|
|
|
|
+ oosFlag:undefined,
|
|
orderBy: 'sales_bill_detail.CREATE_DATE desc'
|
|
orderBy: 'sales_bill_detail.CREATE_DATE desc'
|
|
}
|
|
}
|
|
this.$refs.table.refresh()
|
|
this.$refs.table.refresh()
|
|
@@ -522,7 +571,7 @@ export default {
|
|
id: this.detailData.id
|
|
id: this.detailData.id
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- this.resetSearchForm(true)
|
|
|
|
|
|
+ this.getOrderDetail(true)
|
|
this.spinning = false
|
|
this.spinning = false
|
|
} else {
|
|
} else {
|
|
this.spinning = false
|
|
this.spinning = false
|
|
@@ -562,7 +611,7 @@ export default {
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
salesDetailDelAll({ salesBillSn: _this.detailData.salesBillSn }).then(res => {
|
|
salesDetailDelAll({ salesBillSn: _this.detailData.salesBillSn }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- _this.resetSearchForm(true)
|
|
|
|
|
|
+ _this.getOrderDetail(true)
|
|
_this.productForm = {
|
|
_this.productForm = {
|
|
productName: '',
|
|
productName: '',
|
|
productCode: '',
|
|
productCode: '',
|
|
@@ -582,7 +631,7 @@ export default {
|
|
this.$refs.outInDetialModal.getData(row)
|
|
this.$refs.outInDetialModal.getData(row)
|
|
},
|
|
},
|
|
// 删除产品
|
|
// 删除产品
|
|
- handleDel (row) {
|
|
|
|
|
|
+ handleDel (row) {row
|
|
const _this = this
|
|
const _this = this
|
|
this.$confirm({
|
|
this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
@@ -594,7 +643,7 @@ export default {
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
salesDetailDel({ id: row.id }).then(res => {
|
|
salesDetailDel({ id: row.id }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- _this.resetSearchForm(false)
|
|
|
|
|
|
+ _this.getOrderDetail(false,true)
|
|
}
|
|
}
|
|
_this.$message.info(res.message)
|
|
_this.$message.info(res.message)
|
|
_this.delLoading = false
|
|
_this.delLoading = false
|
|
@@ -608,25 +657,6 @@ export default {
|
|
// 防止多次添加产品
|
|
// 防止多次添加产品
|
|
if (this.isInster) { return }
|
|
if (this.isInster) { return }
|
|
const _this = this
|
|
const _this = this
|
|
- // 判断是否已添加此产品
|
|
|
|
- // if (this.dataSource && this.dataSource.length > 0) {
|
|
|
|
- // const hasRow = this.dataSource.find(item => item.productSn == row.productSn)
|
|
|
|
- // if (hasRow) {
|
|
|
|
- // this.$message.info('该产品已在当前销售单中存在!')
|
|
|
|
- // this.productForm = {
|
|
|
|
- // productName: '',
|
|
|
|
- // productCode: hasRow.dealerProductEntity && hasRow.dealerProductEntity.code || '',
|
|
|
|
- // orderBy: 'sales_bill_detail.CREATE_DATE desc'
|
|
|
|
- // }
|
|
|
|
- // this.$refs.table.refresh(true)
|
|
|
|
- // } else {
|
|
|
|
- // this.productForm = {
|
|
|
|
- // productName: '',
|
|
|
|
- // productCode: '',
|
|
|
|
- // orderBy: 'sales_bill_detail.CREATE_DATE desc'
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
// 自建的单据显示库存不足时
|
|
// 自建的单据显示库存不足时
|
|
if (row.currentQty < row.salesNums && this.isOwerEdit) {
|
|
if (row.currentQty < row.salesNums && this.isOwerEdit) {
|
|
_this.$confirm({
|
|
_this.$confirm({
|
|
@@ -680,9 +710,7 @@ export default {
|
|
stockSn: row.stockSn
|
|
stockSn: row.stockSn
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- // this.resetSearchForm(true) // 不刷新库存
|
|
|
|
- this.$refs.table.refresh(true)
|
|
|
|
- this.getOrderDetail(false)
|
|
|
|
|
|
+ this.resetForm()
|
|
if (this.showShelfModal) {
|
|
if (this.showShelfModal) {
|
|
this.$refs.chooseShelfProduct.reload()
|
|
this.$refs.chooseShelfProduct.reload()
|
|
}
|
|
}
|
|
@@ -693,6 +721,7 @@ export default {
|
|
productCode: row.productCode || '',
|
|
productCode: row.productCode || '',
|
|
orderBy: 'sales_bill_detail.CREATE_DATE desc'
|
|
orderBy: 'sales_bill_detail.CREATE_DATE desc'
|
|
}
|
|
}
|
|
|
|
+ this.showSearch = true
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -718,8 +747,7 @@ export default {
|
|
this.$message.loading('正在批量添加产品...', 1)
|
|
this.$message.loading('正在批量添加产品...', 1)
|
|
salesDetailInsertBatch(params).then(res => {
|
|
salesDetailInsertBatch(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- this.$refs.table.refresh(true)
|
|
|
|
- this.getOrderDetail(false)
|
|
|
|
|
|
+ this.resetForm()
|
|
if (this.showShelfModal) {
|
|
if (this.showShelfModal) {
|
|
this.$refs.chooseShelfProduct.reload()
|
|
this.$refs.chooseShelfProduct.reload()
|
|
}
|
|
}
|
|
@@ -727,7 +755,8 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 销售单详情
|
|
// 销售单详情
|
|
- getOrderDetail (flag) {
|
|
|
|
|
|
+ getOrderDetail (flag,resetTable) {
|
|
|
|
+ this.spinning = true
|
|
salesDetail({ id: this.$route.params.id }).then(res => {
|
|
salesDetail({ id: this.$route.params.id }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.detailData = res.data
|
|
this.detailData = res.data
|
|
@@ -736,14 +765,26 @@ export default {
|
|
const buyerSn = (vm.detailData && vm.detailData.buyerSn && vm.detailData.sourceType && vm.detailData.sourceType == 'PURCHASE') ? '' : vm.detailData.buyerSn
|
|
const buyerSn = (vm.detailData && vm.detailData.buyerSn && vm.detailData.sourceType && vm.detailData.sourceType == 'PURCHASE') ? '' : vm.detailData.buyerSn
|
|
const priceType = vm.$route.params.priceType
|
|
const priceType = vm.$route.params.priceType
|
|
vm.$refs.partQuery.pageInit(buyerSn, priceType, vm.salesBillSn)
|
|
vm.$refs.partQuery.pageInit(buyerSn, priceType, vm.salesBillSn)
|
|
- // 查询关联的客户
|
|
|
|
|
|
+ if(vm.detailData.totalCategory){
|
|
|
|
+ vm.$nextTick(()=>{
|
|
|
|
+ vm.$refs.table.refresh(true)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ // 查询关联的客户货架信息
|
|
if (vm.detailData && vm.detailData.buyerSn) {
|
|
if (vm.detailData && vm.detailData.buyerSn) {
|
|
this.getShelfQueryByCustomer()
|
|
this.getShelfQueryByCustomer()
|
|
}
|
|
}
|
|
|
|
+ }else{
|
|
|
|
+ if(resetTable){
|
|
|
|
+ this.$refs.table.refresh()
|
|
|
|
+ }else{
|
|
|
|
+ this.spinning = false
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 查询关联的客户货架信息
|
|
getShelfQueryByCustomer () {
|
|
getShelfQueryByCustomer () {
|
|
queryByCustomerSn({ sn: this.detailData.buyerSn }).then(res => {
|
|
queryByCustomerSn({ sn: this.detailData.buyerSn }).then(res => {
|
|
if (res.data) {
|
|
if (res.data) {
|
|
@@ -798,22 +839,24 @@ export default {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
salesDetailInsertImport(obj).then(res => {
|
|
salesDetailInsertImport(obj).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- this.$refs.table.refresh(true)
|
|
|
|
- this.getOrderDetail(false)
|
|
|
|
|
|
+ this.getOrderDetail(true)
|
|
}
|
|
}
|
|
this.spinning = false
|
|
this.spinning = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ setTableH () {
|
|
|
|
+ this.tableHeight = window.innerHeight - (this.showSearch ? 42 : 0) - 280
|
|
|
|
+ },
|
|
pageInit () {
|
|
pageInit () {
|
|
const vm = this
|
|
const vm = this
|
|
vm.$nextTick(() => {
|
|
vm.$nextTick(() => {
|
|
|
|
+ vm.setTableH()
|
|
vm.orderId = vm.$route.params.id
|
|
vm.orderId = vm.$route.params.id
|
|
vm.salesBillSn = vm.$route.params.sn
|
|
vm.salesBillSn = vm.$route.params.sn
|
|
// 是否默认打印原厂编码
|
|
// 是否默认打印原厂编码
|
|
vm.printOrgCode = localStorage.getItem('printOrgCode-' + this.$store.state.user.info.orgId) == 'true'
|
|
vm.printOrgCode = localStorage.getItem('printOrgCode-' + this.$store.state.user.info.orgId) == 'true'
|
|
vm.printAllName = localStorage.getItem('printAllName-' + this.$store.state.user.info.orgId) == 'true'
|
|
vm.printAllName = localStorage.getItem('printAllName-' + this.$store.state.user.info.orgId) == 'true'
|
|
vm.getOrderDetail(true)
|
|
vm.getOrderDetail(true)
|
|
- vm.$refs.table.refresh(true)
|
|
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -823,6 +866,12 @@ export default {
|
|
},
|
|
},
|
|
printAllName (newValue, oldValue) {
|
|
printAllName (newValue, oldValue) {
|
|
localStorage.setItem('printAllName-' + this.$store.state.user.info.orgId, newValue)
|
|
localStorage.setItem('printAllName-' + this.$store.state.user.info.orgId, newValue)
|
|
|
|
+ },
|
|
|
|
+ showSearch(newValue, oldValue){
|
|
|
|
+ this.setTableH()
|
|
|
|
+ },
|
|
|
|
+ '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
|
|
+ this.setTableH()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|
|
@@ -857,12 +906,17 @@ export default {
|
|
position: relative;
|
|
position: relative;
|
|
height: 100%;
|
|
height: 100%;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
- >.ant-spin-nested-loading{
|
|
|
|
- overflow-y: auto;
|
|
|
|
- height: 100%;
|
|
|
|
- }
|
|
|
|
- .salesEdit-cont{
|
|
|
|
- margin-top: 10px;
|
|
|
|
|
|
+
|
|
|
|
+ .choosedList-cont{
|
|
|
|
+ position: relative;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ height: calc(100% - 60px);
|
|
|
|
+ .redBg-row{
|
|
|
|
+ color: #f5452e;
|
|
|
|
+ input{
|
|
|
|
+ color: #f5452e;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.total-bar{
|
|
.total-bar{
|
|
display: flex;
|
|
display: flex;
|
|
@@ -879,8 +933,6 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .redBg-row{
|
|
|
|
- background-color: #f5cdc8;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|