|
@@ -147,6 +147,7 @@
|
|
|
<el-table-column label="快递公司" align="center" prop="deliveryName" width="100" column-key="deliveryName" :filters="getFilters('deliveryName')" :filtered-value="columnFilters.deliveryName" />
|
|
<el-table-column label="快递公司" align="center" prop="deliveryName" width="100" column-key="deliveryName" :filters="getFilters('deliveryName')" :filtered-value="columnFilters.deliveryName" />
|
|
|
<el-table-column label="运单号" align="center" prop="deliverySn" width="150" show-overflow-tooltip column-key="deliverySn" :filters="getFilters('deliverySn')" :filtered-value="columnFilters.deliverySn" />
|
|
<el-table-column label="运单号" align="center" prop="deliverySn" width="150" show-overflow-tooltip column-key="deliverySn" :filters="getFilters('deliverySn')" :filtered-value="columnFilters.deliverySn" />
|
|
|
<el-table-column label="订单金额" align="center" prop="totalPrice" width="100" column-key="totalPrice" :filters="getFilters('totalPrice', null, true)" :filtered-value="columnFilters.totalPrice" />
|
|
<el-table-column label="订单金额" align="center" prop="totalPrice" width="100" column-key="totalPrice" :filters="getFilters('totalPrice', null, true)" :filtered-value="columnFilters.totalPrice" />
|
|
|
|
|
+ <el-table-column label="定金" align="center" prop="payPrice" width="100" column-key="payPrice" :filters="getFilters('payPrice', null, true)" :filtered-value="columnFilters.payPrice" />
|
|
|
<el-table-column label="代收金额" align="center" prop="collectionPrice" width="100" column-key="collectionPrice" :filters="getFilters('collectionPrice', null, true)" :filtered-value="columnFilters.collectionPrice" />
|
|
<el-table-column label="代收金额" align="center" prop="collectionPrice" width="100" column-key="collectionPrice" :filters="getFilters('collectionPrice', null, true)" :filtered-value="columnFilters.collectionPrice" />
|
|
|
<el-table-column label="回款金额" align="center" prop="returnPrice" width="100" column-key="returnPrice" :filters="getFilters('returnPrice', null, true)" :filtered-value="columnFilters.returnPrice" />
|
|
<el-table-column label="回款金额" align="center" prop="returnPrice" width="100" column-key="returnPrice" :filters="getFilters('returnPrice', null, true)" :filtered-value="columnFilters.returnPrice" />
|
|
|
<el-table-column label="收件人电话" align="center" prop="receiverPhone" width="130" show-overflow-tooltip column-key="receiverPhone" :filters="getFilters('receiverPhone')" :filtered-value="columnFilters.receiverPhone" />
|
|
<el-table-column label="收件人电话" align="center" prop="receiverPhone" width="130" show-overflow-tooltip column-key="receiverPhone" :filters="getFilters('receiverPhone')" :filtered-value="columnFilters.receiverPhone" />
|
|
@@ -236,15 +237,53 @@
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="success" icon="el-icon-download" size="mini" @click="downloadImportTemplate">模板下载</el-button>
|
|
<el-button type="success" icon="el-icon-download" size="mini" @click="downloadImportTemplate">模板下载</el-button>
|
|
|
- <el-button type="primary" @click="submitImport" :loading="importLoading" :disabled="importDisableUpload">开 始</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="submitImport" :loading="importLoading" :disabled="importDisableUpload">开始预览</el-button>
|
|
|
<el-button @click="importOpen = false">关 闭</el-button>
|
|
<el-button @click="importOpen = false">关 闭</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 预览对话框 -->
|
|
|
|
|
+ <el-dialog title="导入预览" :visible.sync="previewOpen" width="800px" append-to-body>
|
|
|
|
|
+ <el-table :data="previewList" border style="width:100%" max-height="400">
|
|
|
|
|
+ <el-table-column label="快递单号" align="center" prop="deliverySn" width="180" />
|
|
|
|
|
+ <el-table-column label="订单编号" align="center" prop="orderCode" width="170">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span>{{ scope.row.orderCode || '-' }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="订单金额" align="center" prop="totalPrice" width="100">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span>{{ scope.row.matched ? scope.row.totalPrice : '-' }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="定金" align="center" prop="payPrice" width="100">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span>{{ scope.row.matched ? scope.row.payPrice : '-' }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="代收金额" align="center" prop="collectionPrice" width="100">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span>{{ scope.row.matched ? scope.row.collectionPrice : '-' }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="回款金额" align="center" prop="returnPrice" width="100" />
|
|
|
|
|
+ <el-table-column label="状态" align="center" width="120">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-tag v-if="scope.row.matched" type="success">已匹配</el-tag>
|
|
|
|
|
+ <el-tag v-else type="danger">{{ scope.row.failReason || '未匹配' }}</el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="confirmImport" :loading="previewLoading">确认导入</el-button>
|
|
|
|
|
+ <el-button @click="previewOpen = false">取 消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { listFinanceOrder, editFinanceOrder, exportFinanceOrder, downloadFinanceImportTemplate, importFinanceOrder } from '@/api/store/financeOrder'
|
|
|
|
|
|
|
+import { listFinanceOrder, editFinanceOrder, exportFinanceOrder, downloadFinanceImportTemplate, importFinanceOrder, previewImportFinanceOrder } from '@/api/store/financeOrder'
|
|
|
import { treeselect } from '@/api/company/companyDept'
|
|
import { treeselect } from '@/api/company/companyDept'
|
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
@@ -311,10 +350,14 @@ export default {
|
|
|
importAction: process.env.VUE_APP_BASE_API + '/store/financeOrder/importData',
|
|
importAction: process.env.VUE_APP_BASE_API + '/store/financeOrder/importData',
|
|
|
importHeaders: { Authorization: 'Bearer ' + getToken() },
|
|
importHeaders: { Authorization: 'Bearer ' + getToken() },
|
|
|
importDisableUpload: true,
|
|
importDisableUpload: true,
|
|
|
|
|
+ previewOpen: false,
|
|
|
|
|
+ previewLoading: false,
|
|
|
|
|
+ previewList: [],
|
|
|
|
|
+ importFileRaw: null,
|
|
|
columnFilters: {
|
|
columnFilters: {
|
|
|
orderCode: [], externalCreateTime: [], returnTime: [], returnUser: [],
|
|
orderCode: [], externalCreateTime: [], returnTime: [], returnUser: [],
|
|
|
userName: [], deliveryName: [], deliverySn: [], totalPrice: [],
|
|
userName: [], deliveryName: [], deliverySn: [], totalPrice: [],
|
|
|
- collectionPrice: [], returnPrice: [], receiverPhone: [], productNames: [],
|
|
|
|
|
|
|
+ payPrice: [], collectionPrice: [], returnPrice: [], receiverPhone: [], productNames: [],
|
|
|
payType: [], returnStatus: [], remark: [], deliveryTime: [],
|
|
payType: [], returnStatus: [], remark: [], deliveryTime: [],
|
|
|
companyUserName: [], companyName: [], deptName: []
|
|
companyUserName: [], companyName: [], deptName: []
|
|
|
}
|
|
}
|
|
@@ -417,7 +460,7 @@ export default {
|
|
|
/** 合计行:使用后端返回的整个数据集汇总(非当前页) */
|
|
/** 合计行:使用后端返回的整个数据集汇总(非当前页) */
|
|
|
getSummaries({ columns }) {
|
|
getSummaries({ columns }) {
|
|
|
const sums = []
|
|
const sums = []
|
|
|
- const sumProps = ['totalPrice', 'collectionPrice', 'returnPrice']
|
|
|
|
|
|
|
+ const sumProps = ['totalPrice', 'payPrice', 'collectionPrice', 'returnPrice']
|
|
|
columns.forEach((column, index) => {
|
|
columns.forEach((column, index) => {
|
|
|
if (index === 0) {
|
|
if (index === 0) {
|
|
|
sums[index] = '总计'
|
|
sums[index] = '总计'
|
|
@@ -551,14 +594,33 @@ export default {
|
|
|
this.msgError('请选择文件')
|
|
this.msgError('请选择文件')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ this.importFileRaw = uploadFiles[0].raw
|
|
|
const formData = new FormData()
|
|
const formData = new FormData()
|
|
|
- formData.append('file', uploadFiles[0].raw)
|
|
|
|
|
|
|
+ formData.append('file', this.importFileRaw)
|
|
|
this.importLoading = true
|
|
this.importLoading = true
|
|
|
- importFinanceOrder(formData).then(response => {
|
|
|
|
|
|
|
+ previewImportFinanceOrder(formData).then(response => {
|
|
|
|
|
+ this.previewList = response.data || []
|
|
|
this.$refs.upload.clearFiles()
|
|
this.$refs.upload.clearFiles()
|
|
|
this.importDisableUpload = true
|
|
this.importDisableUpload = true
|
|
|
- this.importLoading = false
|
|
|
|
|
this.importOpen = false
|
|
this.importOpen = false
|
|
|
|
|
+ this.previewOpen = true
|
|
|
|
|
+ this.importLoading = false
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.importLoading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ confirmImport() {
|
|
|
|
|
+ if (!this.importFileRaw) {
|
|
|
|
|
+ this.msgError('文件不存在,请重新上传')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.previewLoading = true
|
|
|
|
|
+ const formData = new FormData()
|
|
|
|
|
+ formData.append('file', this.importFileRaw)
|
|
|
|
|
+ importFinanceOrder(formData).then(response => {
|
|
|
|
|
+ this.previewOpen = false
|
|
|
|
|
+ this.previewLoading = false
|
|
|
|
|
+ this.importFileRaw = null
|
|
|
// msg 中包含"失败"表示有失败记录,data 中存了失败文件下载名
|
|
// msg 中包含"失败"表示有失败记录,data 中存了失败文件下载名
|
|
|
const hasFail = response.msg && response.msg.indexOf('失败') !== -1
|
|
const hasFail = response.msg && response.msg.indexOf('失败') !== -1
|
|
|
const failFile = response.data
|
|
const failFile = response.data
|
|
@@ -575,7 +637,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.getList()
|
|
this.getList()
|
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
|
- this.importLoading = false
|
|
|
|
|
|
|
+ this.previewLoading = false
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|