|
@@ -36,6 +36,14 @@
|
|
|
v-hasPermi="['zcustom:platPublicCar:remove']"
|
|
|
>删除</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ icon="el-icon-upload"
|
|
|
+ size="mini"
|
|
|
+ @click="handleUpload"
|
|
|
+ >导入</el-button>
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
@@ -57,7 +65,6 @@
|
|
|
<el-table-column label="企业负责人用车数量" align="center" prop="headCarNum" />
|
|
|
<el-table-column label="燃油车数量" align="center" prop="oilCarNum" />
|
|
|
<el-table-column label="新能源车数量" align="center" prop="newPowerCarNum" />
|
|
|
- <el-table-column label="公务车缺编数" align="center" prop="lackCarNum" />
|
|
|
<el-table-column label="公务车编制数" align="center" prop="establishmentsCarNum" />
|
|
|
<el-table-column label="公务车年度增加数" align="center" prop="yearAddNum" />
|
|
|
<el-table-column label="公务车年度减少数" align="center" prop="yearReduceNum" />
|
|
@@ -136,9 +143,6 @@
|
|
|
<el-form-item label="新能源车数量" prop="newPowerCarNum">
|
|
|
<el-input v-model="form.newPowerCarNum" placeholder="请输入新能源车数量" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="公务车缺编数" prop="lackCarNum">
|
|
|
- <el-input v-model="form.lackCarNum" placeholder="请输入公务车缺编数" />
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="公务车编制数" prop="establishmentsCarNum">
|
|
|
<el-input v-model="form.establishmentsCarNum" placeholder="请输入公务车编制数" />
|
|
|
</el-form-item>
|
|
@@ -187,16 +191,79 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="导入json" :visible.sync="op" :close-on-click-modal="false" width="600px" append-to-body>
|
|
|
+ <el-form ref="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="json来源">
|
|
|
+ <el-select v-model="value" placeholder="请选择源接口">
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="json数据">
|
|
|
+ <el-input v-model="json" type="textarea" placeholder="请输入json数据" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="sure">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listPlatPublicCar, getPlatPublicCar, delPlatPublicCar, addPlatPublicCar, updatePlatPublicCar } from "@/api/zcustom/public";
|
|
|
+import {
|
|
|
+ listPlatPublicCar,
|
|
|
+ getPlatPublicCar,
|
|
|
+ delPlatPublicCar,
|
|
|
+ addPlatPublicCar,
|
|
|
+ updatePlatPublicCar,
|
|
|
+ uploadJson
|
|
|
+} from '@/api/zcustom/public'
|
|
|
|
|
|
export default {
|
|
|
name: "PlatPublicCar",
|
|
|
data() {
|
|
|
return {
|
|
|
+ value: null,
|
|
|
+ options:[
|
|
|
+ {
|
|
|
+ value: '1',
|
|
|
+ label: '资源台账-按照月度统计'
|
|
|
+ }, {
|
|
|
+ value: '2',
|
|
|
+ label: '资源台账-按照年度统计'
|
|
|
+ }, {
|
|
|
+ value: '3',
|
|
|
+ label: '资源台账-公务车实有数展开-1'
|
|
|
+ }, {
|
|
|
+ value: '4',
|
|
|
+ label: '资源台账-公务车实有数展开-2'
|
|
|
+ }, {
|
|
|
+ value: '5',
|
|
|
+ label: '资源台账-公务车实有数展开-3'
|
|
|
+ }, {
|
|
|
+ value: '6',
|
|
|
+ label: '运行管理-公务车派车单总数'
|
|
|
+ }, {
|
|
|
+ value: '7',
|
|
|
+ label: '监控管理-公务车终端安装率、在线率'
|
|
|
+ }, {
|
|
|
+ value: '8',
|
|
|
+ label: '监控管理-公务车处置未归档数量'
|
|
|
+ }, {
|
|
|
+ value: '9',
|
|
|
+ label: '监控管理-未带工单预警、超速预警数、节假日预警数'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ json: "",
|
|
|
+ op:false,
|
|
|
// 根路径
|
|
|
baseURL: process.env.VUE_APP_BASE_API,
|
|
|
// 遮罩层
|
|
@@ -233,7 +300,6 @@ export default {
|
|
|
headCarNum: null,
|
|
|
oilCarNum: null,
|
|
|
newPowerCarNum: null,
|
|
|
- lackCarNum: null,
|
|
|
establishmentsCarNum: null,
|
|
|
yearAddNum: null,
|
|
|
yearReduceNum: null,
|
|
@@ -253,6 +319,12 @@ export default {
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
+ value: [
|
|
|
+ { required: true, message: "来源不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ json: [
|
|
|
+ { required: true, message: "数据不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
id: [
|
|
|
{ required: true, message: "id不能为空", trigger: "blur" }
|
|
|
],
|
|
@@ -292,9 +364,6 @@ export default {
|
|
|
newPowerCarNum: [
|
|
|
{ required: true, message: "新能源车数量不能为空", trigger: "blur" }
|
|
|
],
|
|
|
- lackCarNum: [
|
|
|
- { required: true, message: "公务车缺编数不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
establishmentsCarNum: [
|
|
|
{ required: true, message: "公务车编制数不能为空", trigger: "blur" }
|
|
|
],
|
|
@@ -344,6 +413,13 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ sure(){
|
|
|
+ const jsonString = encodeURIComponent(JSON.stringify(this.json));
|
|
|
+ uploadJson(this.value, jsonString).then(res => {
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
/** 查询公务用车列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -356,6 +432,7 @@ export default {
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
+ this.op = false;
|
|
|
this.reset();
|
|
|
},
|
|
|
// 表单重置
|
|
@@ -374,7 +451,6 @@ export default {
|
|
|
headCarNum: null,
|
|
|
oilCarNum: null,
|
|
|
newPowerCarNum: null,
|
|
|
- lackCarNum: null,
|
|
|
establishmentsCarNum: null,
|
|
|
yearAddNum: null,
|
|
|
yearReduceNum: null,
|
|
@@ -454,11 +530,9 @@ export default {
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- this.download('zcustom/platPublicCar/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `platPublicCar_${new Date().getTime()}.xlsx`)
|
|
|
+ /** 导入操作 */
|
|
|
+ handleUpload(){
|
|
|
+ this.op = true
|
|
|
}
|
|
|
}
|
|
|
};
|