From 7edeaaa39078fcbc9fc773a86aa0cc9775d48306 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Tue, 16 Nov 2021 10:21:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/securityEquipment/car.js                           |   18 -
 src/views/securityEquipment/car.vue                          |   57 +++---
 src/views/accreditationRecords/accreditationRecordsPaper.vue |    1 
 src/views/securityGuard/securityGuard.vue                    |   22 +
 src/views/securityEquipment/gun.js                           |  256 +++++++++++++++----------------
 src/views/securityEquipment/gun.vue                          |  101 +++++++++--
 6 files changed, 251 insertions(+), 204 deletions(-)

diff --git a/src/views/accreditationRecords/accreditationRecordsPaper.vue b/src/views/accreditationRecords/accreditationRecordsPaper.vue
index 130e219..0aa923a 100644
--- a/src/views/accreditationRecords/accreditationRecordsPaper.vue
+++ b/src/views/accreditationRecords/accreditationRecordsPaper.vue
@@ -207,6 +207,7 @@
         idCardNo: "",
         registered: "",
       },
+      
       Audit: {},
       dialogFormVisible: false,
       dialogBatchAudit:false,
diff --git a/src/views/securityEquipment/car.js b/src/views/securityEquipment/car.js
index e98edaf..a8dbd52 100644
--- a/src/views/securityEquipment/car.js
+++ b/src/views/securityEquipment/car.js
@@ -1,11 +1,3 @@
-var DIC = [{
-    label: '招聘中',
-    value: 1,
-}, {
-    label: '停止招聘',
-    value: 2,
-}]
-
 export var column = [
     // {
     //     label: "id",
@@ -38,7 +30,7 @@
         dataType: "number",
         searchSpan: 3,
         rules: [{
-            required: true,
+            required: false,
             message: "请输入号码种类",
             trigger: "blur"
         }],
@@ -47,7 +39,7 @@
         label: "车辆类型",
         prop: "carType",
         rules: [{
-            required: true,
+            required: false,
             message: "请输入车辆类型",
             trigger: "blur"
         }],
@@ -100,7 +92,7 @@
         label: "责任人",
         prop: "personInCharge",
         rules: [{
-            required: true,
+            required: false,
             message: "请输入责任人",
             trigger: "blur"
         }]
@@ -113,7 +105,7 @@
         overHidden: true,
         search: true,
         rules: [{
-            required: true,
+            required: false,
             message: "请输入厂商",
             trigger: "blur"
         }],
@@ -141,7 +133,7 @@
         overHidden: true,
         // search: true,
         rules: [{
-            required: true,
+            required: false,
             message: "请输入环保标志(如:国IV)",
             trigger: "blur"
         }],
diff --git a/src/views/securityEquipment/car.vue b/src/views/securityEquipment/car.vue
index 3ef1064..6a108a9 100644
--- a/src/views/securityEquipment/car.vue
+++ b/src/views/securityEquipment/car.vue
@@ -26,7 +26,6 @@
             >删 除
           </el-button>
           <el-button
-            style="display: none"
             type="success"
             size="small"
             plain
@@ -66,6 +65,7 @@
   props: ["fromDeptId"],
   data() {
     return {
+      deptIds: "",
       excelBox: false,
       excelForm: {},
       excelOption: {
@@ -83,7 +83,7 @@
               res: "data",
             },
             tip: "请上传 .xls,.xlsx 标准格式文件",
-            action: "/api/car/import-examSubject",
+            action: "/api/car/import-car?deptId=" + this.deptIds,
           },
           {
             label: "模板下载",
@@ -130,6 +130,9 @@
       return ids.join(",");
     },
   },
+  mounted() {
+    this.deptIds = this.userInfo.dept_id;
+  },
   created() {
     var that = this;
     if (
@@ -159,7 +162,7 @@
       done();
     },
     handleTemplate() {
-      window.open(`/api/car/export-template`);
+      window.open(`/api/car/export-template-car`);
     },
     sizeChange(val) {
       this.page1.currentPage = 1;
@@ -173,14 +176,6 @@
       //   this.$message.success("页码" + val);
     },
     rowSave(form, done, loading) {
-      // var that = this;
-      //   var form = this.data[0];
-      //   delete form.id;
-      //   for (var k = 0; k < 13; k++) {
-      // console.log
-      // form["deptId"] = form.tenantName;
-      // delete form.tenantName;
-      // console.log(form);
       if (this.fromDeptId != undefined) {
         form["deptId"] = this.fromDeptId;
       }
@@ -188,7 +183,7 @@
         form["deptId"] = this.useifid;
       }
       adddata(form).then(
-        (res) => {
+        () => {
           this.onLoad(this.page);
           this.$message({
             type: "success",
@@ -311,17 +306,7 @@
         params["deptId"] = this.fromDeptId;
         // this.closeDep("deptId");
       } else if (this.useifid != 266) {
-        console.log(123);
         params["deptId"] = this.useifid;
-        // this.closeDep("deptId");
-        // for (let k in this.option.column) {
-        // if (this.option.column[k].prop == "deptId") {
-        // this.option.column[4].search = false;
-        // this.option.column[k].hide = true;
-        // this.option.column[k].addDisplay = false;
-        // this.option.column[k].editDisplay = false;
-        // }
-        // }
       } else {
         this.openDep("deptId");
       }
@@ -330,28 +315,38 @@
       if (this.userInfo.role_name == "公安管理员") {
         params["jurisdiction"] = that.userInfo.jurisdiction;
       }
+      //保安公司进入
+      if (this.userInfo.role_name == "保安公司管理员") {
+        params["deptId"] = that.userInfo.dept_id;
+        //导入action 修改
+        const importColumn = that.findObject(
+          that.excelOption.column,
+          "excelFile"
+        );
+        importColumn.action =
+          "/api/car/import-car?deptId=" + that.userInfo.dept_id;
+      }
 
       getdata(
         page.currentPage,
         page.pageSize,
         Object.assign(params, this.query)
       ).then((res) => {
-        // console.log(res);
         const data = res.data.data;
         this.page.total = data.total;
+        data.records.forEach(item=>{
+          if(item.numberType==-1){
+            item.numberType=null;
+          }
+          if(item.carType==-1){
+            item.carType=null;
+          }
+        })
         this.data = data.records;
         console.log(this.data);
         this.loading = false;
       });
     },
-  },
-  mounted() {
-    // this.Ourdata = data;
-    // this.getData();
-    // this.onLoad(this.page);
-    // var dept_id = JSON.parse(
-    //   window.localStorage.getItem("saber-userInfo")
-    // ).content.dept_id;
   },
 };
 </script>
diff --git a/src/views/securityEquipment/gun.js b/src/views/securityEquipment/gun.js
index 9adda3b..dfe44db 100644
--- a/src/views/securityEquipment/gun.js
+++ b/src/views/securityEquipment/gun.js
@@ -1,134 +1,128 @@
-var DIC = [{
-    label: '招聘中',
-    value: 1,
-}, {
-    label: '停止招聘',
-    value: 2,
-}]
-
 export var column = [{
-    label: "id",
-    prop: "id",
-    hide: true,
-    editDisplay: false,
-    addDisplay: false,
-    labelWidth: 160,
-},
-{
-    label: "公务用枪证编号",
-    prop: "gunCardNumber",
-    labelWidth: 160,
-    searchSpan: 4,
-    searchLabelWidth: 130,
-    search: true,
-    rules: [{
-        required: true,
-        message: "请输入公务用枪证编号",
-        trigger: "blur"
-    }]
-},
-{
-    label: "发证单位名称",
-    searchLabelWidth: 110,
-    labelWidth: 160,
-    prop: "issueUnit",
-    searchSpan: 4,
-    rules: [{
-        required: true,
-        message: "请输入发证单位名称",
-        trigger: "blur"
-    }],
-    search: true,
-}, //上面不显示 
-{
-    label: "公务用枪编号",
-    prop: "cardNumber",
-    labelWidth: 160,
-    searchLabelWidth: 110,
-    rules: [{
-        required: true,
-        message: "请输入公务用枪编号",
-        trigger: "blur"
-    }]
-    // search: true,
-},
-{
-    label: "枪型",
-    prop: "gunMode",
-    // searchSpan: 4,
-    width: 70,
-    labelWidth: 160,
-    rules: [{
-        required: true,
-        message: "请输入枪型",
-        trigger: "blur"
-    }],
-    // search: true,
-},
-{
-    label: "所属保安公司",
-    prop: "deptId",
-    searchSpan: 6,
-    searchLabelWidth: 110,
-    rules: [{
-        required: true,
-        message: "请输入所属保安公司",
-        trigger: "blur"
-    }],
-    hide: true,
-    addDisplay: false,
-    editDisplay: false,
-    search: false,
-    overHidden: true,
-    dicUrl: "",
-    props: {
-        label: "title",
-        value: "id"
+        label: "id",
+        prop: "id",
+        hide: true,
+        editDisplay: false,
+        addDisplay: false,
+        labelWidth: 160,
     },
-    type: "tree",
-    width: 250,
-},
-{
-    label: "责任人",
-    prop: "personInCharge",
-    labelWidth: 160,
-    rules: [{
-        required: true,
-        message: "请输入责任人",
-        trigger: "blur"
-    }]
-},
-{
-    label: "发证日期",
-    labelWidth: 160,
-    prop: "issueTime",
-    // search: true,
-    type: "date",
-    format: "yyyy-MM-dd",
-    valueFormat: "yyyy-MM-dd",
-    // width: 110,
-    // overHidden: true,
-    // search: true,
-    rules: [{
-        required: true,
-        message: "请输入发证日期",
-        trigger: "blur"
-    }]
-},
-{
-    label: "有效日期",
-    prop: "validTime",
-    labelWidth: 160,
-    // search: true,
-    type: "date",
-    format: "yyyy-MM-dd",
-    valueFormat: "yyyy-MM-dd",
-    searchSpan: 4,
-    overHidden: true,
-    rules: [{
-        required: true,
-        message: "请输入有效日期",
-        trigger: "blur"
-    }]
-}
+    // {
+    //     label: "公务用枪证编号",
+    //     prop: "gunCardNumber",
+    //     labelWidth: 160,
+    //     searchSpan: 4,
+    //     searchLabelWidth: 130,
+    //     search: true,
+    //     rules: [{
+    //         required: true,
+    //         message: "请输入公务用枪证编号",
+    //         trigger: "blur"
+    //     }]
+    // },
+    {
+        label: "发证单位名称",
+        searchLabelWidth: 110,
+        labelWidth: 160,
+        prop: "issueUnit",
+        searchSpan: 4,
+        rules: [{
+            required: false,
+            message: "请输入发证单位名称",
+            trigger: "blur"
+        }],
+        search: true,
+    }, //上面不显示 
+    {
+        label: "公务用枪编号",
+        prop: "cardNumber",
+        labelWidth: 160,
+        search: true,
+        searchSpan: 4,
+        searchLabelWidth: 110,
+        rules: [{
+                required: true,
+                message: "请输入公务用枪编号",
+                trigger: "blur"
+            }]
+            // search: true,
+    },
+    {
+        label: "枪型",
+        prop: "gunMode",
+        // searchSpan: 4,
+        width: 70,
+        labelWidth: 160,
+        rules: [{
+            required: false,
+            message: "请输入枪型",
+            trigger: "blur"
+        }],
+        // search: true,
+    },
+    {
+        label: "所属保安公司",
+        prop: "deptId",
+        searchSpan: 6,
+        searchLabelWidth: 110,
+        rules: [{
+            required: true,
+            message: "请输入所属保安公司",
+            trigger: "blur"
+        }],
+        hide: true,
+        addDisplay: false,
+        editDisplay: false,
+        search: false,
+        overHidden: true,
+        dicUrl: "",
+        props: {
+            label: "title",
+            value: "id"
+        },
+        type: "tree",
+        width: 250,
+    },
+    {
+        label: "责任人",
+        prop: "personInCharge",
+        labelWidth: 160,
+        rules: [{
+            required: false,
+            message: "请输入责任人",
+            trigger: "blur"
+        }]
+    },
+    {
+        label: "发证日期",
+        labelWidth: 160,
+        prop: "issueTime",
+        // search: true,
+        type: "date",
+        format: "yyyy-MM-dd",
+        valueFormat: "yyyy-MM-dd",
+        // width: 110,
+        // overHidden: true,
+        // search: true,
+        rules: [{
+            required: true,
+            message: "请输入发证日期",
+            trigger: "blur"
+        }]
+    },
+    {
+        label: "有效日期",
+        prop: "validTime",
+        labelWidth: 160,
+        // search: true,
+        type: "date",
+        format: "yyyy-MM-dd",
+        valueFormat: "yyyy-MM-dd",
+        searchSpan: 4,
+        overHidden: true,
+        rules: [{
+            required: true,
+            message: "请输入有效日期",
+            trigger: "blur"
+        }]
+    }
 ]
\ No newline at end of file
diff --git a/src/views/securityEquipment/gun.vue b/src/views/securityEquipment/gun.vue
index 897bc12..4a3b3db 100644
--- a/src/views/securityEquipment/gun.vue
+++ b/src/views/securityEquipment/gun.vue
@@ -25,8 +25,34 @@
             @click="handleDelete"
             >删 除
           </el-button>
+          <el-button
+            type="success"
+            size="small"
+            plain
+            icon="el-icon-upload2"
+            @click="handleImport"
+            >批量导入
+          </el-button>
         </template>
       </avue-crud>
+      <el-dialog
+        title="枪支导入"
+        append-to-body
+        :visible.sync="excelBox"
+        width="555px"
+      >
+        <avue-form
+          :option="excelOption"
+          v-model="excelForm"
+          :upload-after="uploadAfter"
+        >
+          <template slot="excelTemplate">
+            <el-button type="primary" @click="handleTemplate">
+              点击下载<i class="el-icon-download el-icon--right"></i>
+            </el-button>
+          </template>
+        </avue-form>
+      </el-dialog>
     </div>
   </basic-container>
 </template>
@@ -41,6 +67,34 @@
   data() {
     return {
       loading: true,
+      excelBox: false,
+      excelForm: {},
+      excelOption: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: "文件上传",
+            prop: "excelFile",
+            type: "upload",
+            drag: true,
+            loadText: "文件上传中,请稍等",
+            span: 24,
+            propsHttp: {
+              res: "data",
+            },
+            tip: "请上传 .xls,.xlsx 标准格式文件",
+            action: "/api/gun/import-gun?deptId=" + this.deptIds,
+          },
+          {
+            label: "模板下载",
+            prop: "excelTemplate",
+            formslot: true,
+            span: 24,
+          },
+        ],
+      },
+      deptIds:"",
       selectionList: [],
       page: {
         pageSize: 10,
@@ -95,24 +149,29 @@
     }
   },
   methods: {
+    handleImport() {
+      this.excelBox = true;
+    },
+    uploadAfter(res, done, loading, column) {
+      window.console.log(column);
+      this.excelBox = false;
+      this.refreshChange();
+      done();
+    },
+    handleTemplate() {
+      window.open(`/api/gun/export-template-gun`);
+    },
     sizeChange(val) {
       this.page1.currentPage = 1;
       this.page1.pageSize = val;
       this.getData();
-      //   this.$message.success("行数" + val);
     },
     currentChange(val) {
       this.page1.currentPage = val;
       this.getData();
-      //   this.$message.success("页码" + val);
     },
     rowSave(form, done, loading) {
       var that = this;
-      //   var form = this.data[0];
-      //   delete form.id;
-      //   for (var k = 0; k < 13; k++) {
-      // form["deptId"] = form.tenantName;
-      // delete form.tenantName;
       if (this.fromDeptId != undefined) {
         form["deptId"] = this.fromDeptId;
       }
@@ -146,9 +205,6 @@
       this.onLoad(this.page);
     },
     rowUpdate(row, index, done, loading) {
-      // console.log(row);
-      // row["deptId"] = row.tenantName;
-      // delete row.tenantName;
       if (this.fromDeptId != undefined) {
         row["deptId"] = this.fromDeptId;
       }
@@ -243,17 +299,8 @@
         params["deptId"] = this.fromDeptId;
         // this.closeDep("deptId");
       } else if (this.useifid != 266) {
-        console.log(123);
+        // console.log(123);
         params["deptId"] = this.useifid;
-        // this.closeDep("deptId");
-        // for (let k in this.option.column) {
-        // if (this.option.column[k].prop == "deptId") {
-        // this.option.column[4].search = false;
-        // this.option.column[k].hide = true;
-        // this.option.column[k].addDisplay = false;
-        // this.option.column[k].editDisplay = false;
-        // }
-        // }
       } else {
         this.openDep("deptId");
       }
@@ -261,16 +308,26 @@
       if (this.userInfo.role_name == "公安管理员") {
         params["jurisdiction"] = that.userInfo.jurisdiction;
       }
+      //保安公司进入
+      if (this.userInfo.role_name == "保安公司管理员") {
+        params["deptId"] = that.userInfo.dept_id;
+        //导入action 修改
+        const importColumn = that.findObject(
+          that.excelOption.column,
+          "excelFile"
+        );
+        importColumn.action =
+          "/api/gun/import-gun?deptId=" + that.userInfo.dept_id;
+      }
       getdata(
         page.currentPage,
         page.pageSize,
         Object.assign(params, this.query)
       ).then((res) => {
-        // console.log(res);
         const data = res.data.data;
         this.page.total = data.total;
         this.data = data.records;
-        console.log(this.data);
+        // console.log(this.data);
         this.loading = false;
       });
     },
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index 95a56ff..19ca32e 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -75,6 +75,15 @@
               @click="handleSecurityPaperApply"
             >证书制证申请
             </el-button>
+            <el-button
+              type="primary"
+              size="small"
+              plain
+              v-if="permission.securityGuard_escort_personnel_import"
+              icon="el-icon-collection-tag"
+              @click="handleEscortPersonnelImport"
+              >押运人员批量导入
+            </el-button>
 
             <el-button
               type="danger"
@@ -1226,7 +1235,6 @@
   created() {
     console.log(this.userInfo, 9999);
     if (this.userInfo.role_name == "办证管理员") {
-      console.log(this.userInfo.role_name, 5555225);
       this.search["userType"] = 7;
       this.search["hold"] = "1";
     }
@@ -2297,7 +2305,7 @@
 // 抬头名字
 .security_m_l_titleName {
   position: absolute;
-  top: 35px;
+  top: 38px;
   left: 121px;
   right: 0;
   line-height: 45px;
@@ -2305,7 +2313,7 @@
 }
 
 //发证时间
-$timeTop: 310px; //整体高度
+$timeTop: 315px; //整体高度
 //年
 .security_m_l_titlepaperTimenian {
   position: absolute;
@@ -2342,7 +2350,7 @@
 $centerLeft: 458px;
 .security_m_r_o_right {
   position: absolute;
-  top: $downTop + $lineHigeht * 0-12px;
+  top: $downTop + $lineHigeht * 0+18px;
   left: $centerLeft;
   // width: $rightWidth;
 }
@@ -2350,7 +2358,7 @@
 // 生日
 .security_m_r_o_rightbirthday {
   position: absolute;
-  top: $downTop + $lineHigeht * 1-14px;
+  top: $downTop + $lineHigeht * 1+0px;
   left: $centerLeft;
   // width: $rightWidth;
 }
@@ -2358,7 +2366,7 @@
 // 地址
 .security_m_r_o_rightaddress {
   position: absolute;
-  top: $downTop + $lineHigeht * 2 -16px;
+  top: $downTop + $lineHigeht * 2+0px;
   left: $centerLeft;
   width: 185px;
 }
@@ -2366,7 +2374,7 @@
 // 身份证
 .security_m_r_o_rightcardid {
   position: absolute;
-  top: $downTop + $lineHigeht * 4 +0px;
+  top: $downTop + $lineHigeht * 4 +10px;
   left: $centerLeft;
   // width: $rightWidth;
 }

--
Gitblit v1.9.3