feat(inventory): 新增SN导入模板下载功能并优化订单详情文件操作权限控制
- 在GenerateDeliveryForm组件中实现SN导入模板的下载功能 - 修改库存列表默认排序为按交付时间倒序排列 - 更新订单详情页面文件上传和删除按钮的权限控制逻辑 - 优化订单详情页面文件操作按钮的禁用状态判断条件 - 添加exportDownloadTemplate API接口方法master
parent
d74613d83f
commit
87c5fade50
|
|
@ -73,6 +73,12 @@ export function queryInfo(id) {
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function exportDownloadTemplate() {
|
||||||
|
return request({
|
||||||
|
url: '/inventory/outer/importTemplate',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
export function importSnData(formData) {
|
export function importSnData(formData) {
|
||||||
return request({
|
return request({
|
||||||
url: '/inventory/outer/vue/importData',
|
url: '/inventory/outer/vue/importData',
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { addDelivery, listProductSn } from '@/api/inventory/delivery';
|
import { addDelivery, listProductSn } from '@/api/inventory/delivery';
|
||||||
import {importSnData} from '@/api/inventory/outer'
|
import {importSnData,exportDownloadTemplate} from '@/api/inventory/outer'
|
||||||
export default {
|
export default {
|
||||||
name: "GenerateDeliveryForm",
|
name: "GenerateDeliveryForm",
|
||||||
dicts: ['delivery_type', 'logistics_company'],
|
dicts: ['delivery_type', 'logistics_company'],
|
||||||
|
|
@ -156,7 +156,13 @@ export default {
|
||||||
this.selectedSnList = selection;
|
this.selectedSnList = selection;
|
||||||
},
|
},
|
||||||
handleDownloadTemplate() {
|
handleDownloadTemplate() {
|
||||||
this.download('/inventory/outer/vue/importTemplate', {}, `sn_import_template.xlsx`);
|
|
||||||
|
exportDownloadTemplate().then(response => {
|
||||||
|
const fileName = response.msg;
|
||||||
|
window.location.href = process.env.VUE_APP_BASE_API + "/common/download?fileName=" + encodeURIComponent(fileName) + "&delete=" + true;
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
handleImport() {
|
handleImport() {
|
||||||
this.$refs.uploadInput.click();
|
this.$refs.uploadInput.click();
|
||||||
|
|
|
||||||
|
|
@ -318,8 +318,8 @@ export default {
|
||||||
orderCode: null,
|
orderCode: null,
|
||||||
stockStatus: null,
|
stockStatus: null,
|
||||||
deliveryTimeRange: [], // For el-date-picker daterange
|
deliveryTimeRange: [], // For el-date-picker daterange
|
||||||
orderByColumn: null,
|
orderByColumn: 't2.deliveryTime',
|
||||||
isAsc: null,
|
isAsc: 'desc',
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
|
|
||||||
|
|
@ -96,11 +96,11 @@
|
||||||
<el-table-column label="操作" width="200">
|
<el-table-column label="操作" width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.id === -1 && ((canUpdate && scope.row.fileSort !== '3') || (uploadFinalFile && scope.row.fileSort === '3'))"
|
v-if="scope.row.id === -1 && ((updateFile && scope.row.fileSort !== '3') || (uploadFinalFile && scope.row.fileSort === '3'))"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-upload"
|
icon="el-icon-upload"
|
||||||
@click="importList(scope.$index)"
|
@click="importList(scope.$index)"
|
||||||
:disabled="isOrderApprovedOrInReview || !form.id"
|
:disabled="form.orderStatus === '2'"
|
||||||
>上传
|
>上传
|
||||||
</el-button> <el-button
|
</el-button> <el-button
|
||||||
v-if="scope.row.id !== -1"
|
v-if="scope.row.id !== -1"
|
||||||
|
|
@ -119,11 +119,11 @@
|
||||||
>下载
|
>下载
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.id !== -1 && activeContractVersionTab == form.versionCode && ((canUpdate && scope.row.fileSort !== '3') || (uploadFinalFile && scope.row.fileSort === '3'))"
|
v-if="scope.row.id !== -1 && activeContractVersionTab == form.versionCode && ((updateFile && scope.row.fileSort !== '3') || (uploadFinalFile && scope.row.fileSort === '3'))"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="delUploadRow(scope.$index, scope.row.id)"
|
@click="delUploadRow(scope.$index, scope.row.id)"
|
||||||
:disabled="isOrderApprovedOrInReview"
|
:disabled="form.orderStatus === '2'"
|
||||||
>删除
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue