feat: 阳采追溯码导出

dev_unify
chenhc 3 months ago
parent 3fd5063813
commit 067d2deb74

@ -76,3 +76,12 @@ export function checkTempCode(query) {
});
}
export function excelExport(params) {
return axios({
url: "/udiwms/inout/code/filterList/excelExport",
method: "get",
responseType: 'blob',
params: params
});
}

@ -798,6 +798,10 @@
>查询
</el-button
>
<el-button type="primary" @click="handleExportView"
icon="el-icon-download"
>导出
</el-button>
</el-button-group>
</el-form-item>
</el-row>
@ -977,6 +981,61 @@
v-on:childByValue="parentByFn"
></accept-order>
</el-dialog>
<el-dialog
:title=this.exportTitle
:visible.sync="handleExportViewVisible"
append-to-body width="45%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="handleExportViewVisible"
@close="cancelDialog">
<el-form
:model="editQuery"
ref="editQuery"
label-width="100px"
style="margin-top: 20px"
>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="20" class="el-col">
<el-form-item class="query-form-item" label="订单编号:">
<el-input
v-model="editQuery.ycBillNo"
placeholder="请输入订单编号"
clearable
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="20" class="el-col">
<el-form-item class="query-form-item" label="交易明细编号:">
<el-input
v-model="editQuery.detailNo"
placeholder="请输入交易明细编号"
clearable
>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="text-align: right;margin-right: 12%;margin-top: 30px">
<el-button type="primary" size="small" icon="search" @click="cancelDialog"
>取消
</el-button>
<el-button type="primary" size="small" icon="search" @click="handleExport"
>导出
</el-button>
</div>
</el-dialog>
</div>
</template>
@ -991,7 +1050,7 @@ import {isBlank} from "@/utils/strUtil";
import {selectSysParamByKey} from "@/api/param/systemParamConfig";
import {getResultDetailList} from "@/api/inout/orderDetailResult";
import {getCodeDetailList} from "@/api/inout/orderDetailCode";
import {getCodeList} from "@/api/inout/code";
import {getCodeList,excelExport} from "@/api/inout/code";
import {
inspectionOrderPDFFromStatemenTemplateFile,
inspectionOrderPDFFromTemplateFile, orderPDFFromStatemenTemplateFile,
@ -1048,6 +1107,11 @@ export default {
1: "未验收",
5: "已验收",
},
editQuery: {
billNo:null,
ycBillNo:null,
detailNo:null
},
checkStatus: {
1: "草稿",
@ -1104,6 +1168,8 @@ export default {
status: 10,
},
dialogTableVisible: false,
exportTitle: "单据追溯码导出",
handleExportViewVisible: false,
formLoading: false,
dialogVisible: false,
formData: formJson,
@ -1175,6 +1241,47 @@ export default {
},
components: {AcceptOrder, DialogCheck, ElImageViewer},
methods: {
cancelDialog(){
this.editQuery = {
billNo:null,
ycBillNo:null,
detailNo:null
}
this.handleExportViewVisible = false
},
handleExport(){
if (isBlank(this.currentRow.billNo)) {
this.$message.error("请先选择需要导出的单据!")
return;
}
this.editQuery.billNo = this.currentRow.billNo
if (isBlank(this.editQuery.ycBillNo)) {
this.$message.error("请先输入需要导出的订单编号!")
return;
}
if (isBlank(this.editQuery.detailNo)) {
this.$message.error("请先输入需要导出的交易明细编号!")
return;
}
excelExport(this.editQuery).then(res => {
let blob = new Blob([res], {type: "application/vnd.ms-excel"});
let url = window.URL.createObjectURL(blob); // urlblob
let a = document.createElement("a");
let decodedFileName = "UDI_"+this.currentRow.billNo+"_追溯码导出"; //
// const contentDisposition = res.headers['content-disposition'];
// if (contentDisposition) {
// const fileName = contentDisposition.split('filename=')[1];
// decodedFileName = decodeURI(fileName);
// }
a.download = decodedFileName;
a.href = url;
a.click();
this.$message.success("成功")
this.cancelDialog()
})
},
onReset() {
this.$router.push({
path: "",
@ -1626,6 +1733,14 @@ export default {
this.resultQuery.page = 1;
this.getResultDetailList();
},
handleExportView() {
if (isBlank(this.currentRow.billNo)) {
this.$message.error("请先选择需要导出的单据!")
return;
}
this.handleExportViewVisible = true;
this.exportTitle = "单据 "+this.currentRow.billNo + " 追溯码导出"
},
getResultDetailList() {
if (isBlank(this.currentRow.billNo)) {
this.$message.error("请先选择需要查询的单据!")

Loading…
Cancel
Save