md
This commit is contained in:
parent
448202dc2c
commit
f830060feb
@ -218,6 +218,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
import JSZip from 'jszip';
|
||||
import FileSaver from 'file-saver';
|
||||
import { tansParams, blobValidate } from "@/utils/custom";
|
||||
|
||||
import { listEmisSettleBill, getEmisSettleBill, delEmisSettleBill, addEmisSettleBill, updateEmisSettleBill } from "@/api/emis/emisSettleBill";
|
||||
import MergeBillForm from '@/views/emis/emisSettleBill/MergeBillForm.vue';
|
||||
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
||||
@ -481,18 +486,69 @@ export default {
|
||||
handleRemovceBillCode(){
|
||||
|
||||
},
|
||||
handleExportToBill() {
|
||||
async handleExportToBill() {
|
||||
|
||||
if(this.selectionList&&this.selectionList.length>0){
|
||||
this.selectionList.forEach(item=>{
|
||||
this.download('emis/emisSettleBill/exportBill', {
|
||||
settleBillNo:item.settleBillNo
|
||||
}, `账单${item.settleBillName}.xlsx`)
|
||||
const zip = new JSZip()
|
||||
const cache = {}
|
||||
const promises = []
|
||||
for(let i=0;i<this.selectionList.length;i++){
|
||||
let url=`emis/emisSettleBill/exportBill?settleBillNo=${item.settleBillNo}`;
|
||||
const promise = getFile(url).then(data => {
|
||||
const fileName = `账单${item.settleBillName}.xlsx`
|
||||
zip.file(fileName, data, { binary: true }) // 逐个添加文件
|
||||
cache[fileName] = data
|
||||
})
|
||||
promises.push(promise)
|
||||
}
|
||||
Promise.all(promises).then(() => {
|
||||
zip.generateAsync({type:"blob"}).then(content => { // 生成二进制流
|
||||
FileSaver.saveAs(content, "账单.zip") // 利用file-saver保存文件
|
||||
})
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
// this.selectionList.forEach(async item=>{
|
||||
// this.download('emis/emisSettleBill/exportBill', {
|
||||
// settleBillNo:item.settleBillNo
|
||||
// }, `账单${item.settleBillName}.xlsx`)
|
||||
// });
|
||||
}
|
||||
|
||||
},
|
||||
batchDownload() {
|
||||
const data = ['下载路径1', '下载路径2'] // 需要下载打包的路径, 可以是本地相对路径, 也可以是跨域的全路径
|
||||
const zip = new JSZip()
|
||||
const cache = {}
|
||||
const promises = []
|
||||
data.forEach(item => {
|
||||
const promise = getFile(item).then(data => {
|
||||
const arr_name = item.split("/")
|
||||
const file_name = arr_name[arr_name.length - 1] // 获取文件名
|
||||
zip.file(file_name, data, { binary: true }) // 逐个添加文件
|
||||
cache[file_name] = data
|
||||
})
|
||||
promises.push(promise)
|
||||
})
|
||||
Promise.all(promises).then(() => {
|
||||
zip.generateAsync({type:"blob"}).then(content => { // 生成二进制流
|
||||
FileSaver.saveAs(content, "批量下载.zip") // 利用file-saver保存文件
|
||||
})
|
||||
})
|
||||
},
|
||||
getRemoteFile(url){
|
||||
return new Promise((resolve, reject) => {
|
||||
axios({
|
||||
method:'get',
|
||||
url,
|
||||
responseType: 'arraybuffer'
|
||||
}).then(data => {
|
||||
resolve(data.data)
|
||||
}).catch(error => {
|
||||
reject(error.toString())
|
||||
})
|
||||
})
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
||||
@ -68,6 +68,12 @@
|
||||
<el-form-item label="操作员" prop="createBy">
|
||||
<SysUserSimplePicker v-model="queryParams.createBy" ></SysUserSimplePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="成本" prop="blEntering">
|
||||
<el-select clearable v-model="queryParams.blEntering" placeholder="请选择">
|
||||
<el-option label="已录入" :value="1"></el-option>
|
||||
<el-option label="未录入" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</SearchForm>
|
||||
@ -377,7 +383,7 @@ export default {
|
||||
carNo: null,
|
||||
destCountry: null,
|
||||
supplierCode:null,
|
||||
|
||||
blEntering:null,
|
||||
params:{
|
||||
queryOrderType: '1',
|
||||
billCode: null
|
||||
|
||||
@ -46,7 +46,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="5" style="border-left: 1px solid #efefef;">
|
||||
<div style="height: 300px;padding: 40px;">
|
||||
<el-steps direction="vertical" :active="1" align-center finish-status="success">
|
||||
|
||||
@ -236,15 +236,6 @@ export default {
|
||||
/** 查询TMS承运线路计划列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.params = {};
|
||||
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
|
||||
this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
|
||||
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
|
||||
}
|
||||
if (null != this.daterangeUpdateTime && '' != this.daterangeUpdateTime) {
|
||||
this.queryParams.params["beginUpdateTime"] = this.daterangeUpdateTime[0];
|
||||
this.queryParams.params["endUpdateTime"] = this.daterangeUpdateTime[1];
|
||||
}
|
||||
listEmisTmsTransPlan(this.addDateRange(this.queryParams, this.dateTimeRange)).then(response => {
|
||||
this.emisTmsTransPlanList = response.rows;
|
||||
this.total = response.total;
|
||||
|
||||
@ -716,7 +716,7 @@
|
||||
show-word-limit placeholder="" oninput="value=value.replace(/[\r|\n]/g,'')" >
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('代收款')" prop="codFeeDesc" label-width="70px">
|
||||
<el-form-item :label="$t('代收备注')" prop="codFeeDesc" label-width="70px">
|
||||
<el-input v-model="form.codFeeDesc" maxlength="50"
|
||||
show-word-limit placeholder="" oninput="value=value.replace(/[\r|\n]/g,'')" >
|
||||
</el-input>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user