提交 28a03a0b authored 作者: 翟畅's avatar 翟畅

zc防伪码批量下载TXT

上级 cb4593dd
...@@ -97,17 +97,30 @@ ...@@ -97,17 +97,30 @@
</el-dialog> </el-dialog>
<!-- 下载防伪码 --> <!-- 下载防伪码 -->
<el-dialog title="下载防伪码方式" :visible.sync="downloadTypeDialog" width="30%" center> <el-dialog title="下载防伪码方式" :visible.sync="downloadTypeDialog" width="30%" center>
<div class="downloadType" style="width:100%;text-align:center;"> <div class="downloadType" style="width:100%;text-align:center;">
<el-radio-group v-model="downLoadType"> <el-radio-group v-model="downLoadType">
<el-radio :label="1">携带暗码</el-radio> <el-radio :label="1">携带暗码</el-radio>
<el-radio :label="2">不带暗码</el-radio> <el-radio :label="2">不带暗码</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="downloadTypeDialog = false">取 消</el-button> <el-button @click="downloadTypeDialog = false">取 消</el-button>
<el-button type="primary" @click="confirmDownLoad()">确 定</el-button> <el-button type="primary" @click="confirmDownLoad()">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 导出TXT文件 -->
<el-dialog title="批量导出TXT文件" :visible.sync="exportTxtTypeDialog" width="30%" center>
<div class="downloadType" style="width:100%;text-align:center;">
<el-radio-group v-model="exportTxtType">
<el-radio :label="1">携带暗码</el-radio>
<el-radio :label="2">不带暗码</el-radio>
</el-radio-group>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="exportTxtTypeDialog = false">取 消</el-button>
<el-button type="primary" @click="confirmExportTxt()">确 定</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -172,6 +185,8 @@ import queryString from "query-string"; ...@@ -172,6 +185,8 @@ import queryString from "query-string";
ipDataList:[], ipDataList:[],
downloadTypeDialog:false, downloadTypeDialog:false,
downLoadType:1, downLoadType:1,
exportTxtTypeDialog:false,
exportTxtType:1,
lockingState:null, lockingState:null,
} }
}, },
...@@ -365,37 +380,42 @@ import queryString from "query-string"; ...@@ -365,37 +380,42 @@ import queryString from "query-string";
//批量导出TXT文件 //批量导出TXT文件
exportCodeTxtData(){ exportCodeTxtData(){
if(this.lockingState == '1'){ if(this.lockingState == '1'){
let ids = getSelectionIds(this.chooiceList); this.exportTxtTypeDialog = true
let data = { }else{
ids:ids, this.$message.warning('图书为锁定状态时,该功能方可使用')
phyId: this.listQuery.phyId, }
code: this.listQuery.code, },
status: this.listQuery.status, confirmExportTxt(){
beginTime: this.listQuery.beginTime, this.exportTxtTypeDialog = false
endTime: this.listQuery.endTime, let ids = getSelectionIds(this.chooiceList);
batch: this.listQuery.batch, let data = {
} ids:ids,
let {...params} = data isCode:this.exportTxtType,
let tempParams = {} phyId: this.listQuery.phyId,
for (const key in params) { code: this.listQuery.code,
if (({}).hasOwnProperty.call(params, key) && params[key]!== null && params[key]!== '' && params[key]!== undefined) { status: this.listQuery.status,
tempParams[key] = params[key] beginTime: this.listQuery.beginTime,
} endTime: this.listQuery.endTime,
batch: this.listQuery.batch,
}
let {...params} = data
let tempParams = {}
for (const key in params) {
if (({}).hasOwnProperty.call(params, key) && params[key]!== null && params[key]!== '' && params[key]!== undefined) {
tempParams[key] = params[key]
} }
let paramStr = queryString.stringify(tempParams) }
if(this.chooiceList.length > 0) { let paramStr = queryString.stringify(tempParams)
if(paramStr) { //导出选中的一条或多条数据 if(this.chooiceList.length > 0) {
confirm.apply(this,['确认导出选中的数据吗?']).then(() => { if(paramStr) { //导出选中的一条或多条数据
window.open(`${process.env.VUE_APP_BASE_API}${requestPath.resource}/physical-conversion-code/exportTxt?${paramStr}`) confirm.apply(this,['确认导出选中的数据吗?']).then(() => {
})
}
} else { //导出全部数据
confirm.apply(this,['确认导出全部数据吗?']).then(() => {
window.open(`${process.env.VUE_APP_BASE_API}${requestPath.resource}/physical-conversion-code/exportTxt?${paramStr}`) window.open(`${process.env.VUE_APP_BASE_API}${requestPath.resource}/physical-conversion-code/exportTxt?${paramStr}`)
}); })
} }
}else{ } else { //导出全部数据
this.$message.warning('图书为锁定状态时,该功能方可使用') confirm.apply(this,['确认导出全部数据吗?']).then(() => {
window.open(`${process.env.VUE_APP_BASE_API}${requestPath.resource}/physical-conversion-code/exportTxt?${paramStr}`)
});
} }
}, },
//查看详情--查看绑定IP //查看详情--查看绑定IP
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论