| ... | ... | @@ -3,7 +3,7 @@ | 
|  |  | <div> | 
|  |  | <el-form :inline="true" :model="queryInfo" class="demo-form-inline"> | 
|  |  | <el-form-item label=""> | 
|  |  | <el-input size="medium" v-model="queryInfo.ext1" placeholder="客户编码"></el-input> | 
|  |  | <el-input size="medium" v-model="queryInfo.ext1" class="" placeholder="客户编码"></el-input> | 
|  |  | </el-form-item> | 
|  |  | <el-form-item label=""> | 
|  |  | <el-input size="medium" v-model="queryInfo.orderno" placeholder="订单号"></el-input> | 
| ... | ... | @@ -41,6 +41,7 @@ | 
|  |  | <el-form-item> | 
|  |  | <div class="block"> | 
|  |  | <el-date-picker | 
|  |  | style="background: none" | 
|  |  | size="medium" | 
|  |  | v-model="value2" | 
|  |  | type="daterange" | 
| ... | ... | @@ -54,7 +55,7 @@ | 
|  |  | </div> | 
|  |  | </el-form-item> | 
|  |  | <el-form-item> | 
|  |  | <el-button size="medium" @click="getList">查询</el-button> | 
|  |  | <el-button size="medium" @click="getList" style="background: none">查询</el-button> | 
|  |  | </el-form-item> | 
|  |  | <el-form-item> | 
|  |  | <el-upload | 
| ... | ... | @@ -71,16 +72,29 @@ | 
|  |  | <div style="margin-bottom: 20px"> | 
|  |  | <el-row :gutter="24"> | 
|  |  | <el-col :span="3"> | 
|  |  | <el-button size="medium" @click="batchOrder">订单批量申报</el-button> | 
|  |  | <el-button size="medium" @click="batchOrder" style="background: none">订单批量申报</el-button> | 
|  |  | </el-col> | 
|  |  | <el-col :span="3"> | 
|  |  | <el-col :span="4"> | 
|  |  | <el-upload | 
|  |  | class="upload-demo" | 
|  |  | action="" | 
|  |  | :before-upload="beforeUpload" | 
|  |  | :http-request="batchOrderImport" | 
|  |  | :show-file-list="false"> | 
|  |  | <el-button size="medium">订单批量导入申报</el-button> | 
|  |  | <el-button size="medium" style="background: none">订单批量导入申报</el-button> | 
|  |  | </el-upload> | 
|  |  | </el-col> | 
|  |  | <el-col :span="3"> | 
|  |  | <el-button size="medium" @click="batchDeclare" style="background: none">清单批量申报</el-button> | 
|  |  | </el-col> | 
|  |  | <el-col :span="4"> | 
|  |  | <el-upload | 
|  |  | class="upload-demo" | 
|  |  | action="" | 
|  |  | :before-upload="beforeUpload" | 
|  |  | :http-request="batchDeclareImport" | 
|  |  | :show-file-list="false"> | 
|  |  | <el-button size="medium" style="background: none">清单批量导入申报</el-button> | 
|  |  | </el-upload> | 
|  |  | </el-col> | 
|  |  | </el-row> | 
| ... | ... | @@ -117,6 +131,7 @@ | 
|  |  | </template> | 
|  |  | </el-table-column> | 
|  |  | <el-table-column type="selection" width="55"></el-table-column> | 
|  |  | <el-table-column prop="ext1" label="客户编号" width="180"></el-table-column> | 
|  |  | <el-table-column prop="orderno" label="订单编号" width="180"></el-table-column> | 
|  |  | <el-table-column prop="ordertype" label="订单类型" width="120"> | 
|  |  | <template slot-scope="scope"> | 
| ... | ... | @@ -131,7 +146,6 @@ | 
|  |  | </span> | 
|  |  | </template> | 
|  |  | </el-table-column> | 
|  |  | <!--<el-table-column prop="guid" label="GUID" width="180"></el-table-column>--> | 
|  |  | <el-table-column prop="apptype" label="报送类型" width="120"> | 
|  |  | <template slot-scope="scope"> | 
|  |  | <span v-if="scope.row.apptype==='1'"> | 
| ... | ... | @@ -164,7 +178,7 @@ | 
|  |  | show-overflow-tooltip> | 
|  |  | <template slot-scope="scope"> | 
|  |  | <el-button type="text" size="small" @click="sendorder(scope.row)">订单申报</el-button> | 
|  |  | <el-button type="text" size="small" @click="sendorder(scope.row)">清单申报</el-button> | 
|  |  | <el-button type="text" size="small" @click="sendDeclare(scope.row)">清单申报</el-button> | 
|  |  | </template> | 
|  |  | </el-table-column> | 
|  |  | </el-table> | 
| ... | ... | @@ -183,7 +197,7 @@ | 
|  |  | </template> | 
|  |  |  | 
|  |  | <script> | 
|  |  | import {sendOrder,selectLists,batchOrder,batchOrderImport,importExcel} from '../../api/consigner/exportOrder' | 
|  |  | import {sendOrder,selectLists,batchOrder,batchOrderImport,importExcel,eldhBatchDeclare,eldhImportDeclare} from '../../api/consigner/exportOrder' | 
|  |  | export default { | 
|  |  | data() { | 
|  |  | return { | 
| ... | ... | @@ -266,6 +280,62 @@ | 
|  |  | this.getList(); | 
|  |  | }, | 
|  |  | methods: { | 
|  |  | //清单批量导入申报 | 
|  |  | batchDeclareImport({ file, onSuccess, onError }){ | 
|  |  | // 生成 FormData 对象 | 
|  |  | const formData = new FormData(); | 
|  |  | formData.append('file', file); | 
|  |  | eldhImportDeclare(formData).then((response) => { | 
|  |  | const res = response.data | 
|  |  | if (res.code !== '200') { | 
|  |  | return this.$message.error(res.msg); | 
|  |  | } | 
|  |  | this.$message.success(res.msg); | 
|  |  | this.getList(); | 
|  |  | onSuccess(response.data); // 调用 onSuccess 回调通知上传成功 | 
|  |  | }).catch(error => { | 
|  |  | // 关闭加载 | 
|  |  | this.$message.error(error.toString()) | 
|  |  | onError(error); // 调用 onError 回调通知上传失败 | 
|  |  | }) | 
|  |  | }, | 
|  |  | //清单申报 | 
|  |  | sendDeclare(row){ | 
|  |  | const { orderno, ext1 } = row; | 
|  |  | const senddata= [{ orderno, ext1 }]; | 
|  |  | eldhBatchDeclare(senddata).then((response)=>{ | 
|  |  | const res=response.data; | 
|  |  | if (res.code !== '200') { | 
|  |  | return this.$message.error('清单批量申报失败!') | 
|  |  | } | 
|  |  | this.$message.success('清单批量申报成功!'); | 
|  |  | this.getList(); | 
|  |  | }).catch(error=>{ | 
|  |  | this.$message.error(error.toString()) | 
|  |  | }) | 
|  |  |  | 
|  |  | }, | 
|  |  | //清单批量申报 | 
|  |  | batchDeclare(){ | 
|  |  | if(this.selectedRows.length!==0){ | 
|  |  | this.transformedData = this.selectedRows.map(item => ({ | 
|  |  | orderno: item.orderno, | 
|  |  | ext1: item.ext1 | 
|  |  | })); | 
|  |  | eldhBatchDeclare(this.transformedData).then((response)=>{ | 
|  |  | const res=response.data; | 
|  |  | if (res.code !== '200') { | 
|  |  | return this.$message.error('清单批量申报失败!') | 
|  |  | } | 
|  |  | this.$message.success('清单批量申报成功!'); | 
|  |  | this.getList(); | 
|  |  | }).catch(error=>{ | 
|  |  | this.$message.error(error.toString()) | 
|  |  | }) | 
|  |  | }else{ | 
|  |  | this.$message.error('请选勾取需要申报的清单信息!'); | 
|  |  | } | 
|  |  | }, | 
|  |  | //订单批量导入申报 | 
|  |  | batchOrderImport({ file, onSuccess, onError }){ | 
|  |  | // 生成 FormData 对象 | 
| ... | ... | @@ -387,8 +457,9 @@ | 
|  |  | </script> | 
|  |  |  | 
|  |  | <style scoped> | 
|  |  |  | 
|  |  |  | 
|  |  | .el-input__inner{ | 
|  |  | background-color: #f5f7fd; | 
|  |  | } | 
|  |  | .el-table { | 
|  |  | border: 1px solid #ddd; | 
|  |  | } | 
... | ... |  |