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