Commit 1bb14779 authored by dragondean@qq.com's avatar dragondean@qq.com

控货订单导出

parent 6c722393
......@@ -138,4 +138,14 @@ export function getCondimentsIno(cargoControlPickId){
url: '/ecw/order-cargo-control-pick/seasoning/condiments/info/' + cargoControlPickId,
method: 'get'
})
}
// 参数搜索导出控货订单列表
export function exportCargoControl(params){
return request({
url: '/ecw/order/export/cargo/control/search',
method: 'get',
responseType: 'arraybuffer',
params
})
}
\ No newline at end of file
......@@ -30,7 +30,7 @@
<dict-selector v-model="queryParams.isCargoControl" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" clearable @change="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('订单状态')" prop="status">
<dict-selector :type="DICT_TYPE.PAY_ORDER_STATUS" v-model="queryParams.status" clearable @change="handleQuery" />
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('提单号')" prop="tidanNo">
<el-input v-model="queryParams.tidanNo" :placeholder="$t('提单号')" clearable @keyup.enter.native="handleQuery" />
......@@ -58,15 +58,22 @@
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
:loading="exportLoading" v-hasPermi="['ecw:order:export']">{{$t('导出')}}</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="2">
<el-col :span="12">
<el-button type="primary" plain icon="el-icon-setting" size="mini" :disabled="multiple" @click="batchReview">{{$t('批量复核')}}</el-button>
<el-dropdown v-hasPermi="['ecw:cargo:export:checked','ecw:cargo:export:search']" class="ml-10">
<el-button type="primary" :loading="exportLoading" size="mini">
导出 <i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-hasPermi="['ecw:cargo:export:checked']" @click.native="exportChecked">导出勾选</el-dropdown-item>
<el-dropdown-item v-hasPermi="['ecw:cargo:export:search']" @click.native="exportSearch">导出搜索</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
......@@ -161,7 +168,7 @@ import CustomerSelector from '@/components/CustomerSelector'
import Transfer from '@/views/ecw/order/components/Transfer'
import Release from './components/Release'
import CargoControlEdit from './components/CargoControlEdit'
import { getCargoControlOrderPage, batchReview, orderReview, getPickRleaseInfo } from "@/api/ecw/orderCargoControl"
import { getCargoControlOrderPage, batchReview, orderReview, getPickRleaseInfo, exportCargoControl } from "@/api/ecw/orderCargoControl"
import TransferCargo from '@/views/ecw/order/components/TransferCargo'
import Fallback from './components/Fallback'
import {getWarehouseList} from '@/api/ecw/warehouse'
......@@ -328,7 +335,32 @@ export default {
onTransferCargoSuccess(){
this.showTransferCargoOrderId = null
this.handleQuery()
}
},
// 导出勾选
exportChecked(){
if(!this.ids.length){
return this.$message.error(this.$t('请勾选需要导出的订单'))
}
return this.exportExcel(exportCargoControl, {orderIdList: this.ids}, this.$t("导出勾选控货订单"))
},
// 导出搜索
exportSearch(){
return this.exportExcel(exportCargoControl, this.queryParams, this.$t("导出搜索控货订单"))
},
// 通用导出函数
exportExcel(func, params, fileName = null){
this.exportLoading = true;
func(params).then(res => {
console.log({res})
if(!fileName){
fileName = this.$t('控货订单')
}
this.$download.excel(res, fileName + '.xlsx');
}).finally(() => {
this.exportLoading = false
})
},
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment