|
|
@@ -42,7 +42,6 @@
|
|
|
size="mini"
|
|
|
type="primary"
|
|
|
@click="modifyFun(scope.row)"
|
|
|
- v-permission="'sys:cost:edit'"
|
|
|
>修改</el-button>
|
|
|
<el-button
|
|
|
v-if="scope.row.importStatus == 1"
|
|
|
@@ -55,13 +54,13 @@
|
|
|
class="upload"
|
|
|
ref="reUpload"
|
|
|
:show-file-list="false"
|
|
|
+ v-if="scope.row.importStatus == 0"
|
|
|
:limit="1"
|
|
|
action="#"
|
|
|
:http-request="reCarfrontChange"
|
|
|
:multiple="false"
|
|
|
>
|
|
|
<el-button
|
|
|
- v-if="scope.row.importStatus == 0"
|
|
|
size="mini"
|
|
|
type="primary"
|
|
|
@click="reImportFun(scope.row)"
|
|
|
@@ -173,7 +172,7 @@
|
|
|
@current-change="tableCurrentBatchChange"
|
|
|
:current-page="queryBatchFrom.pageNum"
|
|
|
:page-size="queryBatchFrom.pageSize"
|
|
|
- :page-sizes="[20, 30, 50, 100]"
|
|
|
+ :page-sizes="[10, 20, 50, 100]"
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
:total="queryBatchFrom.totalSize"
|
|
|
></el-pagination>
|
|
|
@@ -210,46 +209,20 @@
|
|
|
<el-col :span="4">手续费:{{ formBatchDetailData.other }}</el-col>
|
|
|
</el-row>
|
|
|
</el-dialog>
|
|
|
- <el-dialog v-dialogDrag :visible.sync="dialogImport" width="30%" @close="closeImportVisible">
|
|
|
- 保险公司 :
|
|
|
- <el-select v-model="InsCompany" placeholder="请选择保险公司" style="width:300px" filterable>
|
|
|
- <el-option
|
|
|
- v-for="(InsCompanyitem, InsCompanyindex) in InsCompanyList"
|
|
|
- :key="InsCompanyindex"
|
|
|
- :label="InsCompanyitem.name"
|
|
|
- :value="InsCompanyitem.id"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button size="small" @click="dialogImport = false">取 消</el-button>
|
|
|
- <div style="display:inline-block">
|
|
|
- <el-upload
|
|
|
- class="upload"
|
|
|
- ref="upload"
|
|
|
- :show-file-list="false"
|
|
|
- :limit="1"
|
|
|
- action="#"
|
|
|
- :before-upload="beforeAvatarUpload"
|
|
|
- :http-request="carfrontChange"
|
|
|
- :multiple="false"
|
|
|
- >
|
|
|
- <el-button size="small" type="primary" @click="dialogImport = false">确 定</el-button>
|
|
|
- </el-upload>
|
|
|
- </div>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
+ <importDialog ref="importDialog" :InsCompanyList="InsCompanyList" @carfrontChange="carfrontChange"></importDialog>
|
|
|
+ <importDialog ref="standardImportDialog" :InsCompanyList="InsCompanyList" @carfrontChange="standardCarfrontChange"></importDialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import batchDialog from './components/batchDialog.vue'
|
|
|
+import importDialog from './components/importDialog.vue'
|
|
|
import templateTable from '../../../components/TemplateTable/index.vue'
|
|
|
import { mapState } from 'vuex'
|
|
|
|
|
|
export default {
|
|
|
name: "baosi",
|
|
|
- components: { batchDialog,templateTable },
|
|
|
+ components: { templateTable,importDialog },
|
|
|
created() {
|
|
|
- console.log(this.perms,1111111111)
|
|
|
this.$api.cost.gainTopList().then(res => {
|
|
|
if (res.data) {
|
|
|
this.InsCompanyList = res.data;
|
|
|
@@ -340,6 +313,10 @@ export default {
|
|
|
{
|
|
|
name:'excel导入',
|
|
|
click: () => {return this.importFun()}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name:'标准模板导入',
|
|
|
+ click: () => {return this.standardImportFun()}
|
|
|
}],
|
|
|
InsCompanyList: [],
|
|
|
queryFrom: {
|
|
|
@@ -354,6 +331,7 @@ export default {
|
|
|
},
|
|
|
batchNum: 0,
|
|
|
batchNumId: 0,
|
|
|
+ rowInsCompany:'',
|
|
|
tableData: [],
|
|
|
loading: false,
|
|
|
formData: {},
|
|
|
@@ -409,8 +387,6 @@ export default {
|
|
|
pageSize: 20
|
|
|
},
|
|
|
dialogBVatch: false,
|
|
|
- dialogImport: false,
|
|
|
- InsCompany: "",
|
|
|
fileList: []
|
|
|
};
|
|
|
},
|
|
|
@@ -558,33 +534,37 @@ export default {
|
|
|
this.dialogBVatchVisible = true;
|
|
|
},
|
|
|
importFun() {
|
|
|
- this.dialogImport = true;
|
|
|
- this.InsCompany = "";
|
|
|
- this.$refs.upload.clearFiles();
|
|
|
+ this.$refs.importDialog.open()
|
|
|
+ this.$refs.importDialog.$refs.upload.clearFiles();
|
|
|
+ },
|
|
|
+ standardImportFun(){
|
|
|
+ this.$refs.standardImportDialog.open()
|
|
|
+ this.$refs.standardImportDialog.$refs.upload.clearFiles();
|
|
|
},
|
|
|
// 重新导入
|
|
|
reImportFun(row) {
|
|
|
this.batchNum = row.id;
|
|
|
+ this.rowInsCompany=row.insCompanyId
|
|
|
},
|
|
|
reCarfrontChange(file) {
|
|
|
const params = new FormData(); // 声明formData数据类型
|
|
|
params.append("file", file.file);
|
|
|
params.append("flag", "1");
|
|
|
params.append("batchNum", this.batchNum);
|
|
|
- this.$api.cost.importDataEdit(params).then(res => {
|
|
|
+ params.append("insCompanyId", this.rowInsCompany);
|
|
|
+ this.$api.cost.importDataAdd(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
|
type: "success"
|
|
|
});
|
|
|
+ this.getList();
|
|
|
} else {
|
|
|
this.$message.error(res.msg);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- closeImportVisible() {
|
|
|
- this.dialogImport = false;
|
|
|
- },
|
|
|
+
|
|
|
tablePageChange(val) {
|
|
|
this.queryFrom.pageSize = val;
|
|
|
this.getList();
|
|
|
@@ -594,27 +574,38 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
tablePageBatchChange(val) {
|
|
|
- this.queryFrom.pageSize = val;
|
|
|
+ this.queryBatchFrom.pageSize = val;
|
|
|
this.getBachList();
|
|
|
},
|
|
|
tableCurrentBatchChange(val) {
|
|
|
- this.queryFrom.pageNum = val;
|
|
|
+ this.queryBatchFrom.pageNum = val;
|
|
|
this.getBachList();
|
|
|
},
|
|
|
- beforeUpload() {},
|
|
|
- // excel导入前限制
|
|
|
- beforeAvatarUpload() {},
|
|
|
// excel导入
|
|
|
- carfrontChange(file) {
|
|
|
- if (!this.InsCompany) {
|
|
|
- this.$refs.upload.clearFiles();
|
|
|
- this.$message.warning("请先选择保险公司!!!");
|
|
|
- return;
|
|
|
- }
|
|
|
+ carfrontChange(file,InsCompany) {
|
|
|
const params = new FormData(); // 声明formData数据类型
|
|
|
params.append("file", file.file);
|
|
|
params.append("flag", "1");
|
|
|
- params.append("insCompanyId", this.InsCompany);
|
|
|
+ params.append("insCompanyId", InsCompany);
|
|
|
+ this.$api.cost.importDataAdd(params).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //标准模板导入
|
|
|
+ standardCarfrontChange(file,InsCompany) {
|
|
|
+ const params = new FormData(); // 声明formData数据类型
|
|
|
+ params.append("file", file.file);
|
|
|
+ params.append("flag", "1");
|
|
|
+ params.append("insCompanyId", InsCompany);
|
|
|
+ params.append("standard", "true");
|
|
|
this.$api.cost.importDataAdd(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message({
|
|
|
@@ -626,8 +617,8 @@ export default {
|
|
|
this.$message.error(res.msg);
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
}
|
|
|
+}
|
|
|
};
|
|
|
</script>
|
|
|
|