Kaynağa Gözat

Merge branch 'dynamic' into dev

haojianlong 5 yıl önce
ebeveyn
işleme
f4d20d934f

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

@@ -715,13 +715,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}`

+ 59 - 17
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">
@@ -26,7 +29,7 @@
             <el-table-column header-align='center' prop="name" label="型号"></el-table-column>
             <el-table-column header-align='center' label="技术参数">
               <template slot-scope="scope">
-                <el-button type="text" @click="lookParam(scope.row)">技术参数</el-button>
+                <el-button :disabled="scope.row.specificationId?false:true" type="text" @click="lookParam(scope.row)">技术参数</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -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,

+ 60 - 18
src/components/dialogs/list/firm.vue

@@ -2,7 +2,7 @@
     firm 厂商
 -->
 <template>
-  <el-dialog title="选择型号" :visible.sync="dialog.firm" width="900px">
+  <el-dialog title="选择生产厂家/品牌/型号" :visible.sync="dialog.firm" width="900px">
     <div>
       <div id="firm">
         <div class="title-search query-form" style="padding: 10px;margin-bottom: 10px;">
@@ -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>
@@ -26,7 +29,7 @@
             <el-table-column prop="name" label="型号" header-align='center'></el-table-column>
             <el-table-column label="技术参数" header-align='center'>
               <template slot-scope="scope">
-                <el-button type="text" @click="lookParam(scope.row)">技术参数</el-button>
+                <el-button :disabled="scope.row.specificationId?false:true" type="text" @click="lookParam(scope.row)">技术参数</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -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()
         }
       }

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

@@ -907,6 +907,7 @@ export default {
       tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)//生产商ID
       tools.setDataForKey(this.tableData[this.row], "DPBrandID", data.brandId)//品牌ID
       tools.setDataForKey(this.tableData[this.row], "DPSpecificationID", data.specificationId)//型号ID
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Manufacturer", data.venderName)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brandName)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Specification", data.name)
       this.handleUpdataTable(
@@ -914,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]
         ],

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

@@ -864,6 +864,7 @@ export default {
       tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)//生产商ID
       tools.setDataForKey(this.tableData[this.row], "DPBrandID", data.brandId)//品牌ID
       tools.setDataForKey(this.tableData[this.row], "DPSpecificationID", data.specificationId)//型号ID
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Manufacturer", data.venderName)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brandName)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Specification", data.name)
       this.handleUpdataTable(
@@ -871,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]
         ],

+ 4 - 1
src/utils/handsontable/mainText.js

@@ -62,9 +62,12 @@ 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'):'空',
+            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 = instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Specification') + '/' + instance.getDataAtRowProp(row,'LedgerParam.EquipManufactor.Brand')
+                html = Manufacturer + '/' + Brand + '/' + Specification
                 break;
             case 'DPSupplierID':
                 html = instance.getDataAtRowProp(row,'LedgerParam.SupplyPurchase.Supplier')

+ 1 - 1
src/utils/handsontable/notShow.js

@@ -305,7 +305,7 @@ const showTools = {
                         DataType: "Str",
                         FirstName: "基本信息",
                         InfoPointCode: "DPManufacturerID",
-                        InfoPointName: "品牌型号",
+                        InfoPointName: "生产厂家/品牌/型号",
                         InputMode: "X",
                         Path: "DPManufacturerID",
                         Priority: "S",

+ 4 - 0
src/utils/scan/tools.js

@@ -533,6 +533,10 @@ tools.setDataForKey = function (data, key, value) {
             if (i == arr.length - 1) {
                 data[arr[i]] = value
             }
+        } else {
+            if (i == arr.length - 1) {
+                data[arr[i]] = ''
+            }
         }
         data = data[arr[i]]
       }

+ 9 - 5
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() {
@@ -418,13 +420,15 @@ export default {
     },
     //选择型号修改
     firmChange(data) {
-      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brand)
+      tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)//生产商ID
+      tools.setDataForKey(this.tableData[this.row], "DPBrandID", data.brandId)//品牌ID
+      tools.setDataForKey(this.tableData[this.row], "DPSpecificationID", data.specificationId)//型号ID
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Manufacturer", data.venderName)
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brandName)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Specification", data.name)
-      tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)
     },
     supplyChange(data) {
-      let changeData = { id: data };
-      this.utilToKey("id", "id", changeData, "SupplierContractID");
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.SupplierContractID", { id: data });
     },
     //如果选择供应商之后
     supplierChange(data) {

+ 9 - 5
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() {
@@ -347,9 +349,12 @@ export default {
     },
     //选择型号修改
     firmChange(data) {
-      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brand)
+      tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)//生产商ID
+      tools.setDataForKey(this.tableData[this.row], "DPBrandID", data.brandId)//品牌ID
+      tools.setDataForKey(this.tableData[this.row], "DPSpecificationID", data.specificationId)//型号ID
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Manufacturer", data.venderName)
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brandName)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Specification", data.name)
-      tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)
     },
     //供应商变更
     supplierChange(data) {
@@ -367,8 +372,7 @@ export default {
       tools.setDataForKey(this.tableData[this.row], "DPMaintainerID", data.venderId)
     },
     supplyChange(data) {
-      let changeData = { id: data };
-      this.utilToKey("id", "id", changeData, "SupplierContractID");
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.SupplierContractID", { id: data });
     },
     //保险合同
     guaranteeChange(data) {

+ 10 - 5
src/views/ledger/facility/partsmanage/index.vue

@@ -436,13 +436,19 @@ export default {
     },
     //选择型号修改
     firmChange(data) {
-      tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)
-      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brand)
+      tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)//生产商ID
+      tools.setDataForKey(this.tableData[this.row], "DPBrandID", data.brandId)//品牌ID
+      tools.setDataForKey(this.tableData[this.row], "DPSpecificationID", data.specificationId)//型号ID
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Manufacturer", data.venderName)
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brandName)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Specification", data.name)
       this.handleUpdataTable(
         [
           [this.row, "DPManufacturerID", null, data.venderId],
-          [this.row, "LedgerParam.EquipManufactor.Brand", null, data.brand],
+          [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]
         ],
         "edit"
@@ -490,8 +496,7 @@ export default {
       // this.handleUpdataTable([[this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]], "edit")
     },
     supplyChange(data) {
-      let changeData = { id: data };
-      this.utilToKey("id", "id", changeData, "SupplierContractID");
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.SupplierContractID", { id: data });
     },
     //保险合同
     guaranteeChange(data) {

+ 10 - 6
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() {
@@ -283,18 +285,20 @@ export default {
     },
     //选择型号修改
     firmChange(data) {
-      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brand)
+      tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)//生产商ID
+      tools.setDataForKey(this.tableData[this.row], "DPBrandID", data.brandId)//品牌ID
+      tools.setDataForKey(this.tableData[this.row], "DPSpecificationID", data.specificationId)//型号ID
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Manufacturer", data.venderName)
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brandName)
       tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Specification", data.name)
-      tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)
     },
     supplyChange(data) {
-      let changeData = { id: data };
-      this.utilToKey("id", "id", changeData, "SupplierContractID");
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.SupplierContractID", { id: data })
     },
     //如果选择供应商之后
     supplierChange(data) {
-      tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
       tools.setDataForKey(this.tableData[this.row], "DPSupplierID", data.venderId)
+      tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
     },
     //保险合同
     guaranteeChange(data) {

+ 2 - 2
src/views/point/dynamicdata/index.vue

@@ -170,7 +170,7 @@ export default {
       dynamicExecuteFeedback({ Id: null }, res => {
         let missionList = res.Content
         missionList.map(mission => {
-          if ('Success/Fail'.indexOf(mission.Completed) > -1) {
+          if ('Success/Fail/Completed'.indexOf(mission.Completed) > -1) {
 
           } else {
             this.missionID = mission.Id
@@ -272,7 +272,7 @@ export default {
         dynamicExecuteFeedback(param, res => {
           this.allApplyClose()
           let response = res.Content[0]
-          if ('Success/Fail'.indexOf(response.Completed) > -1) {
+          if ('Success/Fail/Completed'.indexOf(response.Completed) > -1) {
             setTimeout(() => {
               this.isPending = false;
               this.getPrompt()