Pārlūkot izejas kodu

修改设备、部件、资产台账的生产厂家/品牌/型号维护

zhangyu 5 gadi atpakaļ
vecāks
revīzija
3f55503ce0

+ 15 - 1
src/api/scan/request.js

@@ -690,13 +690,27 @@ export function getSysToEq(param, success) {
     http.postJson(url, data, success)
 }
 
-//台账查询型号
+//按生产商名, 品牌名, 型号名模糊查询型号
 export function getSpecList(param, success) {
     let url = `${venders}/manufacturer/specification/query_spec`
     let data = param
     http.postJson(url, data, success)
 }
 
+//按品牌名称和生厂商名称模糊查询品牌
+export function getBrandList(param, success) {
+    let url = `${venders}/manufacturer/brand/queryByName`
+    let data = param
+    http.postJson(url, data, success)
+}
+
+//按名称模糊查询生产商
+export function getManufacturerList(param, success) {
+    let url = `${venders}/manufacturer/queryByName`
+    let data = param
+    http.postJson(url, data, success)
+}
+
 //台账根据设备id创建岗位
 export function EqToAssets(param, success) {
     let url = `${physics}/property/create_by_equip?projectId=${param.ProjId}&secret=${param.secret}`

+ 58 - 16
src/components/business_space/dialogs/list/firm.vue

@@ -14,6 +14,9 @@
             clearable
           ></el-input>
           <el-button @click="searchKey" size="small">查找</el-button>
+          <el-select v-model="value" style="margin-left:10px;" @change="handleChangeType" placeholder="请选择">
+            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
+          </el-select>
         </div>
         <el-radio-group v-model="radio" style="width:100%;">
           <el-table class="data-table" border :data="tableData" style="width: 100%" height="300px">
@@ -53,7 +56,7 @@
 <script>
 import myPagination from "@/components/common/myPagination";
 import paramDetails from "@/components/business_space/dialogs/list/paramDetails"
-import { getSpecList } from "@/api/scan/request"
+import { getSpecList, getBrandList, getManufacturerList } from "@/api/scan/request"
 
 export default {
   components: {
@@ -77,8 +80,18 @@ export default {
     return {
       search: "", //搜索文案
       radio: "",
-      tableData: [
-      ],
+      value: "specification",//当前选择的查看类型
+      options: [{
+          value: 'specification',
+          label: '选型号'
+        }, {
+          value: 'brand',
+          label: '选生产厂家-品牌'
+        }, {
+          value: 'manufacturer',
+          label: '选生产厂家'
+      }],
+      tableData: [],
       data: {},
       isLoad: {
         paramShow: false
@@ -122,19 +135,48 @@ export default {
       }
       this.getData()
     },
+    handleChangeType(item) {
+      this.page.total = 0
+      this.tableData = []
+      this.getData()
+    },
     getData() {
-      getSpecList({
-        limit: {
-          skip: this.page.size * (this.page.currentPage - 1),
-          count: this.page.size
-        },
-        eqFamily: this.mess.deviceId,
-        name: this.search
-      }, res => {
-        this.page.total = res.totalCount
-        this.tableData = res.content
-        console.log(this.tableData)
-      })
+      if(this.value == 'specification') {//型号
+        getSpecList({
+          limit: {
+            skip: this.page.size * (this.page.currentPage - 1),
+            count: this.page.size
+          },
+          eqFamily: this.mess.deviceId,
+          name: this.search
+        }, res => {
+          this.page.total = res.totalCount
+          this.tableData = res.content
+        })
+      } else if(this.value == 'brand') {//生产厂家-品牌
+        getBrandList({
+          limit: {
+            skip: this.page.size * (this.page.currentPage - 1),
+            count: this.page.size
+          },
+          name: this.search
+        }, res => {
+          this.page.total = res.totalCount
+          this.tableData = res.content
+        })
+      } else if(this.value == 'manufacturer') {//生产厂家
+        getManufacturerList({
+          limit: {
+            skip: this.page.size * (this.page.currentPage - 1),
+            count: this.page.size
+          },
+          name: this.search
+        }, res => {
+          this.page.total = res.totalCount
+          this.tableData = res.content
+        })
+      }
+      console.log(this.tableData)
     }
   },
   watch: {
@@ -142,7 +184,7 @@ export default {
       deep: true,
       handler: function () {
         if (this.dialog.firm) {
-          console.log(this.mess)
+          this.value = 'specification'
           this.changePage()
         }
       }

+ 1 - 1
src/components/common/handsontable.vue

@@ -166,7 +166,7 @@
                     sortIndicator: true, //添加排序
                     renderAllRows: true,
                     autoColumnSize: true,
-                    observeChanges: false, //启用observeChanges插件
+                    // observeChanges: false, //启用observeChanges插件
                     language: "zh-CN",
                     manualColumnResize: true,
                     manualColumnMove: true,

+ 58 - 16
src/components/dialogs/list/firm.vue

@@ -14,6 +14,9 @@
             clearable
           ></el-input>
           <el-button @click="searchKey" size="small">查找</el-button>
+          <el-select v-model="value" style="margin-left:10px;" @change="handleChangeType" placeholder="请选择">
+            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
+          </el-select>
         </div>
         <el-radio-group v-model="radio" style="width:100%;">
           <el-table class='data-table' :data="tableData" style="width: 100%" height="300px" border>
@@ -53,7 +56,7 @@
 <script>
 import myPagination from "@/components/ledger/lib/myPagination";
 import paramDetails from "@/components/dialogs/list/paramDetails"
-import { getSpecList } from "@/api/scan/request"
+import { getSpecList, getBrandList, getManufacturerList } from "@/api/scan/request"
 
 export default {
   components: {
@@ -77,8 +80,18 @@ export default {
     return {
       search: "", //搜索文案
       radio: "",
-      tableData: [
-      ],
+      value: "specification",//当前选择的查看类型
+      options: [{
+          value: 'specification',
+          label: '选型号'
+        }, {
+          value: 'brand',
+          label: '选生产厂家-品牌'
+        }, {
+          value: 'manufacturer',
+          label: '选生产厂家'
+      }],
+      tableData: [],
       data: {},
       isLoad: {
         paramShow: false
@@ -123,19 +136,48 @@ export default {
       }
       this.getData()
     },
+    handleChangeType(item) {
+      this.page.total = 0
+      this.tableData = []
+      this.getData()
+    },
     getData() {
-      getSpecList({
-        limit: {
-          skip: this.page.size * (this.page.currentPage - 1),
-          count: this.page.size
-        },
-        eqFamily: this.mess.deviceId,
-        name: this.search
-      }, res => {
-        this.page.total = res.totalCount
-        this.tableData = res.content
-        console.log(this.tableData)
-      })
+      if(this.value == 'specification') {//型号
+        getSpecList({
+          limit: {
+            skip: this.page.size * (this.page.currentPage - 1),
+            count: this.page.size
+          },
+          eqFamily: this.mess.deviceId,
+          name: this.search
+        }, res => {
+          this.page.total = res.totalCount
+          this.tableData = res.content
+        })
+      } else if(this.value == 'brand') {//生产厂家-品牌
+        getBrandList({
+          limit: {
+            skip: this.page.size * (this.page.currentPage - 1),
+            count: this.page.size
+          },
+          name: this.search
+        }, res => {
+          this.page.total = res.totalCount
+          this.tableData = res.content
+        })
+      } else if(this.value == 'manufacturer') {//生产厂家
+        getManufacturerList({
+          limit: {
+            skip: this.page.size * (this.page.currentPage - 1),
+            count: this.page.size
+          },
+          name: this.search
+        }, res => {
+          this.page.total = res.totalCount
+          this.tableData = res.content
+        })
+      }
+      console.log(this.tableData)
     }
   },
   watch: {
@@ -143,7 +185,7 @@ export default {
       deep: true,
       handler: function () {
         if (this.dialog.firm) {
-          console.log(this.mess)
+          this.value = 'specification'
           this.changePage()
         }
       }

+ 1 - 0
src/components/ledger/handsontables/assets.vue

@@ -915,6 +915,7 @@ export default {
           [this.row, "DPManufacturerID", null, data.venderId],
           [this.row, "DPBrandID", null, data.brandId],
           [this.row, "DPSpecificationID", null, data.specificationId],
+          [this.row, "LedgerParam.EquipManufactor.Manufacturer", null, data.venderName],
           [this.row, "LedgerParam.EquipManufactor.Brand", null, data.brandName],
           [this.row, "LedgerParam.EquipManufactor.Specification", null, data.name]
         ],

+ 1 - 0
src/components/ledger/handsontables/device.vue

@@ -872,6 +872,7 @@ export default {
           [this.row, "DPManufacturerID", null, data.venderId],
           [this.row, "DPBrandID", null, data.brandId],
           [this.row, "DPSpecificationID", null, data.specificationId],
+          [this.row, "LedgerParam.EquipManufactor.Manufacturer", null, data.venderName],
           [this.row, "LedgerParam.EquipManufactor.Brand", null, data.brandName],
           [this.row, "LedgerParam.EquipManufactor.Specification", null, data.name]
         ],

+ 3 - 3
src/utils/handsontable/mainText.js

@@ -63,11 +63,11 @@ const text = {
     idType: (instance, td, row, col, prop, value, cellProperties) => {
         let html = ''
         let Manufacturer = instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Manufacturer')?instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Manufacturer'):'空',
-            Specification = instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Specification')?instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Specification'):'空',
-            Brand = instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Brand')?instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Brand'):'空'
+            Brand = instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Brand')?instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Brand'):'空',
+            Specification = instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Specification')?instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Specification'):'空';
         switch (prop){
             case 'DPManufacturerID':
-                html = Manufacturer + '/' + Specification + '/' + Brand
+                html = Manufacturer + '/' + Brand + '/' + Specification
                 break;
             case 'DPSupplierID':
                 html = instance.getDataAtRowProp(row,'LedgerParam.SupplyPurchase.Supplier')

+ 3 - 1
src/views/ledger/facility/addfacility.vue

@@ -321,7 +321,9 @@ export default {
     },
     //修改
     handleUpdataTable(changeData, source) {
-      this.formaTableData();
+      if (!this.onlyRead && source != 'ObserveChanges.change') {
+        this.formaTableData();
+      }
     },
     //保存去掉空字段的新增数据
     formaTableData() {

+ 3 - 1
src/views/ledger/facility/partsmanage/addparts/index.vue

@@ -268,7 +268,9 @@ export default {
     },
     //修改
     handleUpdataTable(changeData, source) {
-      this.formaTableData();
+      if (!this.onlyRead && source != 'ObserveChanges.change') {
+        this.formaTableData();
+      }
     },
     //保存去掉空字段的新增数据
     formaTableData() {

+ 1 - 0
src/views/ledger/facility/partsmanage/index.vue

@@ -447,6 +447,7 @@ export default {
           [this.row, "DPManufacturerID", null, data.venderId],
           [this.row, "DPBrandID", null, data.brandId],
           [this.row, "DPSpecificationID", null, data.specificationId],
+          [this.row, "LedgerParam.EquipManufactor.Manufacturer", null, data.venderName],
           [this.row, "LedgerParam.EquipManufactor.Brand", null, data.brandName],
           [this.row, "LedgerParam.EquipManufactor.Specification", null, data.name]
         ],

+ 3 - 1
src/views/ledger/property/addproperty.vue

@@ -205,7 +205,9 @@ export default {
     },
     //修改
     handleUpdataTable(changeData, source) {
-      this.formaTableData()
+      if (!this.onlyRead && source != 'ObserveChanges.change') {
+        this.formaTableData()
+      }
     },
     //保存去掉空字段的新增数据
     formaTableData() {