浏览代码

汽保设备档案

caojunjie 1 年之前
父节点
当前提交
bfe5b26fa0

+ 38 - 18
src/views/EquipmentArchives/detailsPage.vue

@@ -26,7 +26,7 @@
           </template>
         </avue-form>
       </trade-card>
-      <trade-card title="商品信息" v-loading="loadingBtn">
+      <trade-card title="设备信息" v-loading="loadingBtn">
         <avue-crud ref="crud" :option="optionList" :data="data" :table-loading="loading" @saveColumn="saveColumn"
           @resetColumn="resetColumn" :cell-style="cellStyle">
           <template slot="headerSerial">
@@ -39,6 +39,13 @@
                                  placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input>
                 <span v-else>{{ row.code }}</span>
             </template>
+
+            <template slot="remarks" slot-scope="{ row, index }">
+                <el-input v-if="row.$cellEdit" v-model="row.remarks"
+                          placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input>
+                <span v-else>{{ row.remarks }}</span>
+            </template>
+
             <template slot="exitDate" slot-scope="{ row, index }">
                 <el-date-picker
                     v-if="row.$cellEdit"
@@ -185,7 +192,7 @@ export default {
         disabled: false,
         column: [
           {
-            label: "客户名称",
+            label: "客户",
             prop: "corpId",
 
             rules: [
@@ -198,16 +205,8 @@ export default {
             span: 16,
           },
             {
-                label: "编号",
-                prop: "sysNo",
-                search: true,
-                overHidden: true,
-                disabled:true,
-                span: 8,
-            },
-            {
-                label: "联系人",
-                prop: "contacts",
+                label: "电话",
+                prop: "contactsTel",
                 search: true,
                 overHidden: true,
                 span: 8,
@@ -220,9 +219,8 @@ export default {
                 ],
             },
             {
-                label: "联系电话",
-                prop: "contactsTel",
-                search: true,
+                label: "地址",
+                prop: "address",
                 overHidden: true,
                 span: 8,
                 rules: [
@@ -234,8 +232,9 @@ export default {
                 ],
             },
             {
-                label: "地址",
-                prop: "address",
+                label: "联系人",
+                prop: "contacts",
+                search: true,
                 overHidden: true,
                 span: 8,
                 rules: [
@@ -246,6 +245,19 @@ export default {
                     }
                 ],
             },
+
+
+            {
+                label: "编号",
+                prop: "sysNo",
+                search: true,
+                overHidden: true,
+                disabled:true,
+                span: 8,
+            },
+
+
+
             {
                 label: "设备数量",
                 prop: "equipmentNumber",
@@ -678,6 +690,7 @@ export default {
                     cname:item.cname,
                     code:item.code,
                     brand:item.brand,
+                    brandId:item.brandId,
                     specs:item.specs,
                     remarks:item.remarks,
                     goodsTypeId:item.goodsTypeId,
@@ -687,9 +700,11 @@ export default {
                     maintenanceDate:item.maintenanceDate?item.maintenanceDate + ' 00:00:00':item.maintenanceDate,
                     repairReportDate:item.repairReportDate,
                     url:item.url?item.url:null,
+                    factoryId:item.factoryId?item.factoryId:null,
+                    factoryName:item.factoryName?item.factoryName:null,
+                    categoryitem:item.categoryitem?item.categoryitem:null
                 }
             })
-            console.log(arr,633)
             const obj = {
                 id:this.form.id?this.form.id:null,
                 corpId:this.form.corpId,
@@ -781,6 +796,8 @@ export default {
                   this.data.push({
                       $cellEdit: true,
                       storageId: this.form.storageId,
+                      factoryId:item.corpId,
+                      factoryName:item.corpName,
                       ...item
                   })
               }
@@ -790,10 +807,13 @@ export default {
                   this.data.push({
                       $cellEdit: true,
                       storageId: this.form.storageId,
+                      factoryId:item.corpId,
+                      factoryName:item.corpName,
                       ...item
                   })
               }
           }
+          console.log(this.data,802)
           this.form.equipmentNumber = this.data.length
           this.productVisible = false
       },

+ 14 - 11
src/views/EquipmentArchives/index.vue

@@ -6,11 +6,13 @@
         @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
         @resetColumn="resetColumn" :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch">
         <template slot="menuLeft">
-          <el-button type="primary" size="mini" @click.stop="newAdd()">新建设备档案
+          <el-button type="primary" size="mini" @click.stop="newAdd()">新建档案
           </el-button>
+            <el-button type="primary" size="mini" @click.stop="openExport()">导出
+            </el-button>
         </template>
         <template slot="corpIdSearch">
-          <crop-select v-model="search.corpId" corpType="GYS"></crop-select>
+          <crop-select v-model="search.corpId" corpType="KH"></crop-select>
         </template>
         <template slot-scope="{ row, index }" slot="corpId">
           <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 1)">{{ row.corpsName }}
@@ -44,6 +46,7 @@ import {
     allCropList,
 } from "@/api/basicData/customerInformation";
 import {getCustomerCode} from "@/enums/management-type";
+import {getToken} from "@/util/auth";
 export default {
   name: "index",
   data() {
@@ -70,7 +73,6 @@ export default {
   async created() {
     this.option = option
     this.option.height = window.innerHeight - 210;
-      this.allCropListfun()
   },
   activated() {
     this.$refs.crud.refreshTable();
@@ -84,15 +86,16 @@ export default {
     }
   },
   methods: {
-      // 客户查询
-      allCropListfun(){
-          let userObj = JSON.parse(localStorage.getItem("saber-userInfo")).content;
-          allCropList({
-              corpType: "KH",
-              adminProfiles: userObj.role_name != "admin" ? userObj.user_id : null,
-          }).then(res=>{
-              this.findObject(this.option.column, "corpName").dicData = res.data.data
+      // 导出设备
+      openExport() {
+          let params = JSON.parse(JSON.stringify(this.search))
+          const routeData = this.$router.resolve({
+              path: '/api/blade-client/corpequipmentarchives/export-out-info',      //跳转目标窗口的地址
+              query: {
+                  ...params    //括号内是要传递给新窗口的参数
+              }
           })
+          window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
       },
     searchCriteriaSwitch(type) {
       if (type) {

+ 72 - 25
src/views/EquipmentArchives/js/optionList.js

@@ -39,21 +39,42 @@ export const option = {
   column: [
     {
       label: "客户名称",
-      prop: "corpName",
+      prop: "corpId",
       width:165,
       overHidden: true,
       search: true,
-      type: 'select',
-      dicData:[],
-      props: {
-        label: 'cname',
-        value: 'cname'
-      },
+      hide:true,
+      index: 1
+    },
+    {
+      label: "客户名称",
+      prop: "corpName",
+      width:165,
+      overHidden: true,
       index: 1
     },
     {
       label: "编号",
       prop: "sysNo",
+      overHidden: true,
+      index: 3
+    },
+    {
+      label: "联系人",
+      prop: "contacts",
+      overHidden: true,
+      index: 3
+    },
+    {
+      label: "电话",
+      prop: "contactsTel",
+      search: true,
+      overHidden: true,
+      index: 3
+    },
+    {
+      label: "设备名称",
+      prop: "deviceJson",
       search: true,
       overHidden: true,
       index: 3
@@ -70,21 +91,36 @@ export const option = {
       index: 12
     },
     {
+      label: "功能分类",
+      prop: "categoryitem",
+      type: "select",
+      props: {
+        label: "dictValue",
+        value: "dictValue"
+      },
+      dicUrl: "/api/blade-system/dict-biz/dictionary?code=functional_classification",
+      index:12
+    },
+    {
       label: "维修时间",
       prop: "updateTime",
-      width: 200,
+      width: 160,
       index: 12
     },
     {
-      label: "签约时间",
+      label: "合同起",
       prop: "signingDateStart",
-      width: 200,
+      width: 120,
       index: 12
     },
     {
-      label: "解约时间",
+      label: "合同止",
       prop: "signingDateEnd",
-      width: 200,
+      search: true,
+      type:'date',
+      format: "yyyy-MM-dd",
+      valueFormat: 'yyyy-MM-dd HH:mm:ss',
+      width: 120,
       index: 12
     },
     {
@@ -127,7 +163,7 @@ export const optionList = {
   ],
   column: [
     {
-      label: "商品名称",
+      label: "设备名称",
       prop: "cname",
       width:'250px',
       overHidden: true
@@ -138,6 +174,12 @@ export const optionList = {
       overHidden: true
     },
     {
+      label: "设备描述",
+      prop: "remarks",
+      cell: false,
+      overHidden: true
+    },
+    {
       label: "出厂日期",
       prop: "exitDate",
       overHidden: true
@@ -153,7 +195,23 @@ export const optionList = {
       overHidden: true
     },
     {
-      label: "商品分类",
+      label: "工厂",
+      prop: "factoryName",
+      overHidden: true
+    },
+    {
+      label: "功能分类",
+      prop: "categoryitem",
+      type: "select",
+      props: {
+        label: "dictValue",
+        value: "dictValue"
+      },
+      dicUrl: "/api/blade-system/dict-biz/dictionary?code=functional_classification",
+      overHidden: true
+    },
+    {
+      label: "设备分类",
       prop: "goodsTypeId",
       type: 'select',
       dicData: [],
@@ -176,17 +234,6 @@ export const optionList = {
       },
       dicData: [],
     },
-    {
-      label: "备注",
-      prop: "remarks",
-      cell: false,
-      overHidden: true
-    }
-    // ,{
-    //   label: "进价",
-    //   prop: "purchasePrice",
-    //   overHidden: true
-    // }
   ]
 }
 

+ 33 - 5
src/views/product/detailsPage.vue

@@ -351,7 +351,15 @@ export default {
                     value: "id"
                 },
                 dicData: [],
-                span: 8,
+                span: 6,
+                change:(val)=>{
+                    for(let item of val.column.dicData) {
+                        if (val.value == item.id) {
+                            this.form.corpName = item.cname
+                            break;
+                        }
+                    }
+                }
             },
             // {
             //     label: "采购日期",
@@ -364,18 +372,37 @@ export default {
             {
                 label: "规格",
                 prop: "specs",
-                span: 8,
+                span: 6,
             },
             {
                 label: "品牌",
-                prop: "brand",
+                prop: "brandId",
                 type: "select",
                 props: {
                     label: "cname",
                     value: "id"
                 },
                 dicData: [],
-                span: 8,
+                span: 6,
+                change:(val)=>{
+                    for(let item of val.column.dicData) {
+                        if (val.value == item.id) {
+                            this.form.brand = item.cname
+                            break;
+                        }
+                    }
+                }
+            },
+            {
+                label: "功能分类",
+                prop: "categoryitem",
+                type: "select",
+                props: {
+                    label: "dictValue",
+                    value: "dictValue"
+                },
+                dicUrl: "/api/blade-system/dict-biz/dictionary?code=functional_classification",
+                span: 6,
             },
           {
             label: "备注",
@@ -524,7 +551,7 @@ export default {
               current: 1,
               size: 20,
           }).then(res=>{
-              this.findObject(this.option.column, "brand").dicData = res.data.data.records
+              this.findObject(this.option.column, "brandId").dicData = res.data.data.records
           })
       },
 
@@ -686,6 +713,7 @@ export default {
         done();
         if (valid) {
           this.loadingBtn = true;
+            console.log(this.form)
           submit({
             ...this.form,
             code: this.form.cname,