Forráskód Böngészése

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

quwangxin 2 éve
szülő
commit
aa83dddf4b

+ 9 - 0
src/api/material/BOM.js

@@ -41,3 +41,12 @@ export async function detailPage (params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+//SAP-bom同步 
+export async function syncBom () {
+  const res = await request.get(`/sap/sync/syncBom`);
+  if (res.data.code == 0) {
+    return res.data.code;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 8 - 1
src/api/material/list.js

@@ -39,4 +39,11 @@ export async function removeItem (data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
+// SAP-物料同步
+export async function syncMateriel () {
+  const res = await request.get('/sap/sync/syncMateriel');
+  if (res.data.code == 0) {
+    return res.data.code;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 9 - 1
src/api/technology/route/index.js

@@ -105,5 +105,13 @@ export default {
     if (res.data.code == 0) {
       return res.data.message;
     }
-  }
+  },
+  
+  syncRouting: async () => {
+    const res = await request.get(`/sap/sync/syncRouting`);
+    if (res.data.code == 0) {
+      return res.data.code;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
 };

+ 9 - 0
src/api/technology/version/version.js

@@ -52,3 +52,12 @@ export async function saveBomList(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 生产版本同步
+export async function syncVersion(data) {
+  const res = await request.get('/sap/sync/syncVersion');
+  if (res.data.code == 0) {
+    return res.data.code;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 24 - 0
src/utils/index.js

@@ -142,3 +142,27 @@ export function pushZero (num) {
 export function tableIndex (index, page, size) {
   return index + 1 + size * (page - 1)
 }
+
+// 图片预览
+export const imageView = item => {
+  let date = new Date()
+  let nowTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
+  let docName = item
+  let suffix = ''
+  let accessUrl = ''
+
+  if (typeof item === 'string') {
+    suffix = item.substr(item.lastIndexOf('.'))
+    accessUrl = item.substr(item.lastIndexOf('/') + 1)
+  } else {
+    docName = item.name.substr(0, item.name.lastIndexOf('.'))
+    suffix = item.accessUrl.substr(item.accessUrl.lastIndexOf('.'))
+    accessUrl = item.accessUrl.substr(item.accessUrl.lastIndexOf('/') + 1)
+  }
+  return getImageBlob(
+    '/common/file/downloadFile/' + accessUrl,
+    {},
+    `${docName}_${nowTime}${suffix}`
+  ).then(data => window.URL.createObjectURL(new Blob([data])))
+}
+

+ 11 - 11
src/views/ledgerAssets/boat/components/baseInfo.vue

@@ -26,9 +26,9 @@
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 长/宽/高(mm) </template>
-        {{ information.extendField.length }}/{{
-          information.extendField.width
-        }}/{{ information.extendField.high }}
+       {{ information.extendField.palletLen }}/{{
+          information.extendField.wilde
+        }}/{{ information.extendField.hight }}
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 计量单位</template>
@@ -151,13 +151,13 @@
     methods: {
       getDetilInfo () {
         getDetails(this.rowId).then((res) => {
-          this.information = res;
-          if (res.extendField) {
-            this.$set(
-              this.information,
-              'extendField',
-              JSON.parse(res.extendField)
-            );
+          this.information = res.category;
+          if ( typeof res.categoryPallet != 'string') {
+             this.$set(
+               this.information,
+               'extendField',
+                res.categoryPallet
+             );
           }
         });
       },
@@ -226,7 +226,7 @@
 <style lang="scss" scoped>
   .baseinfo-container {
     background-color: #fff;
-    padding: 20px;
+    padding: 0px 20px 20px;
     .content {
       padding: 0 20px;
     }

+ 13 - 3
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -38,8 +38,9 @@
   import BoatSearch from './boat-search.vue';
   import { getBoatList } from '@/api/ledgerAssets';
   // import { downloadAction } from '@/api/flowable/manage';
-
+  import dictMixins from '@/mixins/dictMixins';
   export default {
+    mixins: [dictMixins],
     components: { BoatSearch },
     props: {
       // 类别id
@@ -88,13 +89,19 @@
             prop: 'angle',
             label: '角度',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            formatter: (row) => {
+              return this.getDictValue('角度', row.detail.angle);
+            }
           },
           {
             prop: 'width',
             label: '长*宽*高',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 200,
+            formatter: (row) => {
+              return row.detail.palletLen + ' * ' + row.detail.wilde + ' * ' + row.detail.hight
+            }
           },
           {
             prop: 'categoryLevelPath',
@@ -129,6 +136,9 @@
         ]
       };
     },
+    created () {
+       this.requestDict('角度');
+    },
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {

+ 6 - 10
src/views/ledgerAssets/boat/components/boat-search.vue

@@ -11,19 +11,15 @@
         <el-form-item label="编码:">
           <el-input clearable v-model="where.code" placeholder="请输入" />
         </el-form-item>
-        <el-form-item label="型号:">
-          <el-input clearable v-model="where.module" placeholder="请输入" />
-        </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="名称:">
           <el-input clearable v-model="where.name" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="角度:">
-          <DictSelection dictName="角度" clearable v-model="where.angle">
-          </DictSelection>
+     <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="型号:">
+          <el-input clearable v-model="where.module" placeholder="请输入" />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
@@ -31,8 +27,8 @@
           <el-input clearable v-model="where.space" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
-        <div class="ele-form-actions">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label-width="50px">
           <el-button
             type="primary"
             icon="el-icon-search"
@@ -47,7 +43,7 @@
             size="small"
             type="primary"
           >重置</el-button>
-        </div>
+        </el-form-item>
       </el-col>
     </el-row>
   </el-form>

+ 18 - 27
src/views/ledgerAssets/boat/detail.vue

@@ -1,24 +1,17 @@
 <template>
-  <div>
-    <!-- tab切换 -->
-<!--   <div class="switch">
-      <div class="switch_left">
-        <ul>
-          <li
-            v-for="item in tabOptions"
-            :key="item.key"
-            :class="{ active: activeComp == item.key }"
-            @click="activeComp = item.key"
-          >
-            {{ item.name }}
-          </li>
-        </ul>
-        <el-button size="small" @click="$router.go(-1)">返回</el-button>
-      </div>
-    </div> -->
-    <div class="content-wrapper">
-      <component :is="activeComp" :rowId="rowId"></component>
-    </div>
+  <div class="ele-body">
+    <el-card :body-style="{ padding: 0 }">
+       <div class="page-title">
+         <el-page-header @back="$router.go(-1)">
+           <div slot="content" class="pageContent">
+             <div>舟皿信息详情</div>
+           </div>
+         </el-page-header>
+       </div>
+       <div class="content-wrapper">
+         <component :is="activeComp" :rowId="rowId"></component>
+       </div>
+    </el-card>
   </div>
 </template>
 
@@ -64,11 +57,9 @@ export default {
 .content-wrapper {
   background-color: #fff;
 }
-.switch_left{
-  width:100%;
-  display:flex;
-  align-items:center;
-  justify-content: space-between;
-  padding-right:20px;
-}
+   .page-title{
+     background: #fff;
+     padding:26px 10px 15px;
+     border-bottom:1px solid #eaeefb;
+   }
 </style>

+ 1 - 1
src/views/ledgerAssets/equipment/components/baseInfo.vue

@@ -307,7 +307,7 @@
   }
   .baseinfo-container {
     background-color: #fff;
-    padding: 20px;
+    padding: 0px 20px 20px;
     .content {
       padding: 0 20px;
     }

+ 13 - 1
src/views/ledgerAssets/equipment/detail.vue

@@ -2,7 +2,7 @@
   <div class="ele-body">
     <el-card :body-style="{ padding: 0 }">
       <!-- tab切换 -->
-      <div class="switch">
+<!--      <div class="switch">
         <div class="switch_left">
           <ul>
             <li
@@ -18,6 +18,13 @@
         <div class="right" style="padding: 10px">
           <el-button @click="$router.go(-1)">返回</el-button>
         </div>
+      </div> -->
+      <div class="page-title">
+        <el-page-header @back="$router.go(-1)">
+          <div slot="content" class="pageContent">
+            <div>设备信息详情</div>
+          </div>
+        </el-page-header>
       </div>
       <div class="content-wrapper">
         <component :is="activeComp" :id="id" :code="code"></component>
@@ -78,4 +85,9 @@
   .content-wrapper {
     background-color: #fff;
   }
+  .page-title{
+    background: #fff;
+    padding:26px 10px 15px;
+    border-bottom:1px solid #eaeefb;
+  }
 </style>

+ 9 - 9
src/views/ledgerAssets/turnoverCar/components/baseInfo.vue

@@ -90,7 +90,7 @@
     <div class="basic-details-title border-none">
       <span class="border-span">图文信息</span>
     </div>
-<!--   <div class="upload-container">
+  <div class="upload-container">
        <div class="img-box">
          <img
            src="~@/assets/upload-placeholder.svg"
@@ -99,7 +99,7 @@
          />
          <img v-else :src="imageUrl" alt="周转车图片" />
        </div>
-    </div> -->
+    </div>
     <div class="basic-details-title border-none">
       <span class="border-span">扩展信息</span>
     </div>
@@ -123,7 +123,7 @@
 <script>
 // import {getAssetInfo} from "@/api/ledgerAssets/asset"
 // import DetailsDialog from '@/views/ledgerAssets/components/outstoreDetailsDialog.vue'
-// import { imageView } from "@/utils"
+import { imageView } from "@/utils"
   import {
     getAssetInfo
   } from '@/api/ledgerAssets';
@@ -164,11 +164,11 @@ export default {
           this.$set(this.info, 'category', res.category)
           this.$set(this.info, 'extInfoSelf', res.extInfoSelf?res.extInfoSelf:[])
           // this.$set(this.info, 'warehouseDetail', res.data.warehouseDetail)
-          // if (res.data.imageUrl) {
-          //   imageView(res.data.imageUrl).then((res) => {
-          //     this.imageUrl = res;
-          //   });
-          // }
+          if (res.imageUrl) {
+            imageView(res.imageUrl).then((res) => {
+              this.imageUrl = res;
+            });
+          }
        }
      },
      // 打开详情弹窗
@@ -189,7 +189,7 @@ export default {
 <style lang="scss" scoped>
 .baseinfo-container {
   background-color: #fff;
-  padding: 20px;
+  padding: 0px 20px 20px;
   .content {
     padding: 0 20px;
   }

+ 9 - 16
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -36,18 +36,6 @@
           {{ row.code }}
         </el-link>
       </template>
-      <!-- 材质列 -->
-      <template v-slot:texture="{ row }">
-        <div>
-          {{ row.category.extendField && JSON.parse(row.category.extendField).texture }}
-        </div>
-      </template>
-      <!-- 型号列 -->
-      <template v-slot:modelType="{ row }">
-        <div>
-          {{ row.category.modelType }}
-        </div>
-      </template>
       <!-- 分类列 -->
       <template v-slot:categoryLevelPath="{ row }">
         <div>
@@ -124,18 +112,22 @@
             minWidth: 110
           },
           {
-            prop: 'texture',
+            prop: 'materialQuality',
             label: '材质',
             showOverflowTooltip: true,
             minWidth: 110,
-            slot: 'texture'
+            formatter: (_row, _column, cellValue) => {
+              return this.getDictValue('周转车材质',  _row.categoryDetail.materialQuality)
+            }
           },
           {
             prop: 'modelType',
             label: '型号',
             showOverflowTooltip: true,
             minWidth: 110,
-            slot:'modelType'
+            formatter: (_row, _column, cellValue) => {
+              return  _row.category.modelType
+            }
           },
           {
             prop: 'categoryLevelPath',
@@ -175,6 +167,7 @@
     },
     created () {
       this.requestDict('生命周期');
+      this.requestDict('周转车材质');
     },
     methods: {
       /* 表格数据源 */
@@ -216,7 +209,7 @@
       // 导出
       btnExport() {
         const obj = this.$refs.searchRef.getForm()
-        
+
       },
 
     },

+ 18 - 29
src/views/ledgerAssets/turnoverCar/detail.vue

@@ -1,24 +1,18 @@
 <template>
-  <div>
+  <div class="ele-body">
     <!-- tab切换 -->
-<!--    <div class="switch">
-      <div class="switch_left">
-        <ul>
-          <li
-            v-for="item in tabOptions"
-            :key="item.key"
-            :class="{ active: activeComp == item.key }"
-            @click="activeComp = item.key"
-          >
-            {{ item.name }}
-          </li>
-        </ul>
-        <el-button size="small" @click="$router.go(-1)">返回</el-button>
-      </div>
-    </div> -->
-    <div class="content-wrapper">
-      <component :is="activeComp" :rowId="rowId"></component>
-    </div>
+    <el-card :body-style="{ padding: 0 }">
+       <div class="page-title">
+         <el-page-header @back="$router.go(-1)">
+           <div slot="content" class="pageContent">
+             <div>周转车信息详情</div>
+           </div>
+         </el-page-header>
+       </div>
+       <div class="content-wrapper">
+         <component :is="activeComp" :rowId="rowId"></component>
+       </div>
+    </el-card>
   </div>
 </template>
 
@@ -46,14 +40,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.content-wrapper {
-  background-color: #fff;
-}
-.switch_left{
-  width:100%;
-  display:flex;
-  align-items:center;
-  justify-content: space-between;
-  padding-right:20px;
-}
+   .page-title{
+     background: #fff;
+     padding:26px 10px 15px;
+     border-bottom:1px solid #eaeefb;
+   }
 </style>

+ 16 - 19
src/views/ledgerAssets/turnoverCar/edit.vue

@@ -33,7 +33,8 @@
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label"> 材质 </template>
-            {{ info.category.extendField && JSON.parse(info.category.extendField).texture }}
+            {{getDictValue('周转车材质',  info.category.materialQuality)}}
+            <!-- {{ info.category.extendField && JSON.parse(info.category.extendField).texture }} -->
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label"> 型号 </template>
@@ -88,11 +89,7 @@
           <span class="border-span">文档信息</span>
         </div>
         <div class="upload-container">
-          <!-- <UploadImg
-            @getImgs="cbUploadImg"
-            :assetName="`周转车`"
-            ref="UploadImg"
-          /> -->
+          <WithView v-model="imageUrl" :limit="1" :assetName="'周转车'"/>
         </div>
         <div class="basic-details-title border-none">
           <span class="border-span">扩展信息</span>
@@ -151,7 +148,13 @@
 <script>
   import { getAssetInfo , saveOrEdit } from '@/api/ledgerAssets';
   import { listOrganizations } from '@/api/system/organization';
+  import WithView from '@/components/upload/WithView';
+  import dictMixins from '@/mixins/dictMixins';
   export default {
+    mixins: [dictMixins],
+    components: {
+      WithView
+    },
     data () {
       return {
         formData: {},
@@ -163,7 +166,7 @@
         itemForm: {
           addList: []
         },
-        imageUrl: null,
+        imageUrl: {},
         treeData:[],
         btnLoading: false,
       };
@@ -172,6 +175,7 @@
       let id = this.$route.query.id;
       this.getDetilInfo(id);
       this.query();
+      this.requestDict('周转车材质');
     },
     methods: {
       // 树形结构数据
@@ -191,20 +195,13 @@
       async getDetilInfo (id) {
         const res = await getAssetInfo(id);
         if (res) {
-          this.info = res.data;
-          this.$set(this.info, 'category', res.data.category);
-          // this.$set(this.info, 'warehouseDetail', res.data.warehouseDetail);
-          // this.$set(this.info, 'imgUrl', res.data.imageUrl)
+          this.info = res;
+          this.$set(this.info, 'category', res.category);
           this.itemForm.addList = this.info.extInfoSelf
             ? this.info.extInfoSelf
             : [];
           // 设备图片
-          this.imageUrl = res.data.imageUrl;
-          if (this.imageUrl) {
-            imageView(this.imageUrl).then((res) => {
-              this.$refs.UploadImg.setImg(res);
-            });
-          }
+          this.imageUrl = res.imageUrl?res.imageUrl:{}
         }
       },
 
@@ -238,12 +235,12 @@
           id: this.info.id,
           code: this.info.code,
           fixCode: this.info.fixCode,
-          // imageUrl: this.imageUrl,
+          imageUrl: this.imageUrl || {},
           extInfoSelf: extendField,
           ownershipGroupId: this.info.ownershipGroupId,
           rootCategoryLevelId:this.info.rootCategoryLevelId,
           categoryId:this.info.categoryId,
-          positionIds: JSON.parse(this.info.category.categoryLevelPathId).join(',')
+          positionIds: typeof this.info.category.categoryLevelPathId == 'string'? this.info.category.categoryLevelPathId : JSON.parse(this.info.category.categoryLevelPathId).join(',')
         };
         this.btnLoading = true;
         this.$refs['formCustom'].validate((valid) => {

+ 25 - 1
src/views/material/manage/components/index-search.vue

@@ -48,6 +48,14 @@
             >重置</el-button
           >
 
+          <el-button
+            type="primary"
+            icon="el-icon-refresh-left"
+            class="ele-btn-icon"
+            @click='refreshData'
+            :loading="loading"
+          >刷新</el-button>
+
           <slot></slot>
         </el-form-item>
       </el-col>
@@ -56,6 +64,7 @@
 </template>
 
 <script>
+  import { syncMateriel } from '@/api/material/list';
   export default {
     data() {
       // 默认表单数据
@@ -66,7 +75,8 @@
       return {
         defaultWhere,
         // 表单数据
-        where: { ...defaultWhere }
+        where: { ...defaultWhere },
+        loading:false
       };
     },
     computed: {
@@ -84,6 +94,20 @@
       reset() {
         this.where = { ...this.defaultWhere };
         this.search();
+      },
+      // 刷新数据
+      refreshData(){
+          this.loading = true;
+          syncMateriel().then(res=>{
+             if(res=='0'){
+               this.loading = false;
+                this.$message.success('数据刷新成功!')
+                this.search()
+             }
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
       }
     }
   };

+ 5 - 2
src/views/material/manage/index.vue

@@ -33,7 +33,9 @@
           @done="done"
         >
           <!-- 表头工具栏 -->
-          <template v-slot:toolbar> </template>
+<!--          <template v-slot:toolbar>
+
+          </template> -->
         </ele-pro-table>
 
         <template v-slot:content>
@@ -75,7 +77,7 @@
         // 是否显示编辑弹窗
         showEdit: false,
         // 编辑回显数据
-        editData: null
+        editData: null,
       };
     },
 
@@ -99,6 +101,7 @@
         this.$refs.listData.reload(where);
       },
 
+
     }
   };
 </script>

+ 13 - 6
src/views/material/manage/manageMaterial.vue

@@ -84,13 +84,13 @@
                 </div>
              </el-form-item>
            </el-col>
-           <el-col :span="8">
-             <el-form-item label="净重">
-                <div class="form-line">
+           <el-col :span="8" class='net-box'>
+             <el-form-item label="净重" prop="netWeight">
                   <el-input  v-model="form.netWeight"/>
-                  <DictSelection class="line-select" dictName="重量单位" clearable v-model="form.netWeightUnit">
-                  </DictSelection>
-                </div>
+             </el-form-item>
+             <el-form-item label-width="15px" prop="netWeightUnit" style="width: 45%;">
+                <DictSelection class="line-select" dictName="重量单位" clearable v-model="form.netWeightUnit">
+                </DictSelection>
              </el-form-item>
            </el-col>
            <el-col :span="8">
@@ -213,6 +213,8 @@
            measuringUnit:[{ required: true, message: '请选择计量单位', trigger: 'change' }],
            packingUnit:[{ required: true, message: '请选择包装单位', trigger: 'change' }],
            isProduct:[{ required: true, message: '请选择是否产品', trigger: 'change' }],
+           netWeight:[{ required: true, message: '请输入净重', trigger: 'blur' }],
+           netWeightUnit:[{ required: true, message: '请选择净重单位', trigger: 'change' }]
          }
          return rules
       }
@@ -449,4 +451,9 @@
     justify-content: center;
     margin:20px auto;
   }
+  .net-box{
+    display: flex;
+    align-items: center;
+    justify-content: flex-start;
+  }
 </style>

+ 30 - 6
src/views/material/materialBOM/index.vue

@@ -10,10 +10,17 @@
         tool-class="ele-toolbar-actions"
       >
         <!-- 表头工具栏 -->
-        <!-- <template v-slot:toolbar>
-          <el-button type="primary" @click="handelEdit('新建')">新建</el-button>
-          <el-button type="primary">复制</el-button>
-        </template>-->
+        <template v-slot:toolbar>
+          <!-- <el-button type="primary" @click="handelEdit('新建')">新建</el-button> -->
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-refresh-left"
+            class="ele-btn-icon"
+            @click='refreshData'
+            :loading="loading"
+          >刷新</el-button>
+        </template>
         <template v-slot:action="{ row }">
           <el-link type="primary" @click="handelEdit(row)">详情</el-link>
         </template>
@@ -26,7 +33,7 @@
 <script>
   import BOMSearch from './components/BOM-search.vue';
   import ViewDialog from './components/view-dialog.vue';
-  import { getPage } from '@/api/material/BOM';
+  import { getPage , syncBom } from '@/api/material/BOM';
 
   export default {
     name: 'SystemDictionary',
@@ -94,7 +101,8 @@
           '-1': '草稿',
           0: '已停用',
           1: '已发布'
-        }
+        },
+        loading:false
       };
     },
 
@@ -144,7 +152,23 @@
               });
           })
           .catch(() => {});
+      },
+
+      // 刷新数据
+      refreshData(){
+          this.loading = true;
+          syncBom().then(res=>{
+             if(res=='0'){
+               this.loading = false;
+                this.$message.success('数据刷新成功!')
+                this.reload()
+             }
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
       }
+
     }
   };
 </script>

+ 24 - 8
src/views/technology/route/index.vue

@@ -12,17 +12,16 @@
         row-key="id"
       >
         <!-- 表头工具栏 -->
-<!--        <template v-slot:toolbar>
+       <template v-slot:toolbar>
           <el-button
             size="small"
             type="primary"
-            icon="el-icon-plus"
+            icon="el-icon-refresh-left"
             class="ele-btn-icon"
-            @click="openEdit()"
-          >
-            新建
-          </el-button>
-        </template> -->
+            @click='refreshData'
+            :loading="loading"
+          >刷新</el-button>
+        </template>
 
         <!-- 状态列 -->
         <template v-slot:status="{ row }">
@@ -174,7 +173,8 @@
           { label: '草稿', value: -1 },
           { label: '失效', value: 0 },
           { label: '生效', value: 1 }
-        ]
+        ],
+        loading:false
       };
     },
     methods: {
@@ -252,7 +252,23 @@
               });
           })
           .catch(() => {});
+      },
+      
+      // 刷新数据
+      refreshData(){
+          this.loading = true;
+          route.syncRouting().then(res=>{
+             if(res=='0'){
+               this.loading = false;
+                this.$message.success('数据刷新成功!')
+                this.reload()
+             }
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
       }
+      
     }
   };
 </script>

+ 15 - 3
src/views/technology/version/index.vue

@@ -18,6 +18,7 @@
             type="primary"
             icon="el-icon-refresh-left"
             class="ele-btn-icon"
+            :loading="loading"
             @click="toRefresh()"
           >
             刷新
@@ -48,7 +49,7 @@
 
 <script>
   import UserSearch from './components/user-search.vue';
-  import { pageList } from '@/api/technology/version/version.js';
+  import { pageList , syncVersion } from '@/api/technology/version/version.js';
   export default {
     name: 'technologyVersion',
     components: {
@@ -123,7 +124,8 @@
           { label: '草稿', value: -1 },
           { label: '失效', value: 0 },
           { label: '生效', value: 1 }
-        ]
+        ],
+        loading:false
       };
     },
     methods: {
@@ -142,7 +144,17 @@
       // },
       /* 点击刷新 */
       toRefresh(){
-
+         this.loading = true;
+         syncVersion().then(res=>{
+            if(res=='0'){
+              this.loading = false;
+               this.$message.success('数据刷新成功!')
+               this.reload()
+            }
+         })
+         .catch((e) => {
+           this.loading = false;
+         });
       },
       /* 刷新表格 */
       reload(where) {

+ 128 - 123
src/views/workforceManagement/classes/components/edit.vue

@@ -23,6 +23,7 @@
                 :maxlength="20"
                 v-model="form.code"
                 placeholder="请输入"
+                :disabled="type == 'edit'"
               />
             </el-form-item>
           </el-col>
@@ -56,7 +57,11 @@
         header="工作时间段"
         body-style="padding: 22px 22px 0 22px;"
       >
-        <timeTable ref="timeTable" @timeAll="gettimeAll" :delDetailIds="delDetailIds"></timeTable>
+        <timeTable
+          ref="timeTable"
+          @timeAll="gettimeAll"
+          :delDetailIds="delDetailIds"
+        ></timeTable>
       </el-card>
     </el-form>
     <template v-slot:footer>
@@ -69,137 +74,137 @@
 </template>
 
 <script>
-import {
-  saveteamtime,
-  updateteamtime
-} from '@/api/workforceManagement/classes';
-import timeTable from './timeTable.vue';
-export default {
-  components: {
-    timeTable
-  },
-  data() {
-    const defaultForm = {
-      id: '',
-      code: '',
-      name: '',
-      totalWorkHour: '',
-      details: []
-    };
-    return {
-      defaultForm,
-      // 表单数据
-      form: { ...defaultForm },
-      // 表单验证规则
-      rules: {
-        code: [{ required: true, message: '请输入', trigger: 'blur' }],
-        name: [{ required: true, message: '请输入', trigger: 'blur' }]
-      },
-      visible: false,
-      type: '', // add/edit
-      loading: false,
-      options: {
-        workshopId: [],
-        productionLineId: [],
-        workStationId: []
-      },
-      delDetailIds:[]
-    };
-  },
-  computed: {
-    title() {
-      switch (this.type) {
-        case 'add':
-          return '新增班次';
-          break;
-        case 'edit':
-          return '修改班次';
-          break;
-        default:
-          break;
-      }
-    }
-  },
-  created() {},
-  methods: {
-    open(type, row) {
-      this.type = type;
-      this.visible = true;
-      if (type == 'edit') {
-        for (const key of Object.keys(this.form)) {
-          if (row[key]) {
-            this.form[key] = row[key];
-          }
+  import {
+    saveteamtime,
+    updateteamtime
+  } from '@/api/workforceManagement/classes';
+  import timeTable from './timeTable.vue';
+  export default {
+    components: {
+      timeTable
+    },
+    data () {
+      const defaultForm = {
+        id: '',
+        code: '',
+        name: '',
+        totalWorkHour: '',
+        details: []
+      };
+      return {
+        defaultForm,
+        // 表单数据
+        form: { ...defaultForm },
+        // 表单验证规则
+        rules: {
+          code: [{ required: true, message: '请输入', trigger: 'blur' }],
+          name: [{ required: true, message: '请输入', trigger: 'blur' }]
+        },
+        visible: false,
+        type: '', // add/edit
+        loading: false,
+        options: {
+          workshopId: [],
+          productionLineId: [],
+          workStationId: []
+        },
+        delDetailIds: []
+      };
+    },
+    computed: {
+      title () {
+        switch (this.type) {
+          case 'add':
+            return '新增班次';
+            break;
+          case 'edit':
+            return '修改班次';
+            break;
+          default:
+            break;
         }
-        this.$nextTick(() => {
-          // 反显时间段
-          if (row.details) {
-            this.$refs.timeTable.form.datasource = row.details;
-          }
-        });
       }
     },
-    /* 保存编辑 */
-    save() {
-      this.$refs.form.validate((valid) => {
-        if (!valid) {
-          return false;
+    created () {},
+    methods: {
+      open (type, row) {
+        this.type = type;
+        this.visible = true;
+        if (type == 'edit') {
+          for (const key of Object.keys(this.form)) {
+            if (row[key]) {
+              this.form[key] = row[key];
+            }
+          }
+          this.$nextTick(() => {
+            // 反显时间段
+            if (row.details) {
+              this.$refs.timeTable.form.datasource = row.details;
+            }
+          });
         }
+      },
+      /* 保存编辑 */
+      save () {
+        this.$refs.form.validate((valid) => {
+          if (!valid) {
+            return false;
+          }
 
-        if (this.type == 'add') {
-          delete this.form.id;
-        }
-        this.$refs.timeTable.verification().then((res) => {
-          this.loading = true;
-          this.form.details = this.$refs.timeTable.form.datasource;
-          let fn;
-          switch (this.type) {
-            case 'add':
-              fn = saveteamtime;
-              break;
-            case 'edit':
-              fn = updateteamtime;
-              this.form.delDetailIds = this.delDetailIds
-              break;
-            default:
-              break;
+          if (this.type == 'add') {
+            delete this.form.id;
           }
-          fn(this.form)
-            .then((msg) => {
-              this.loading = false;
-              this.$message.success(msg);
-              this.handleClose();
-              this.$emit('done');
-            })
-            .catch((e) => {
-              this.loading = false;
-              this.$message.error(e.message);
-            });
+          this.$refs.timeTable.verification().then((res) => {
+            this.loading = true;
+            this.form.details = this.$refs.timeTable.form.datasource;
+            let fn;
+            switch (this.type) {
+              case 'add':
+                fn = saveteamtime;
+                break;
+              case 'edit':
+                fn = updateteamtime;
+                this.form.delDetailIds = this.delDetailIds;
+                break;
+              default:
+                break;
+            }
+            fn(this.form)
+              .then((msg) => {
+                this.loading = false;
+                this.$message.success(msg);
+                this.handleClose();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                this.loading = false;
+                this.$message.error(e.message);
+              });
+          });
         });
-      });
-    },
-    // 重置表单
-    restForm() {
-      this.$refs.form.clearValidate();
-      this.form = { ...this.defaultForm };
-    },
-    handleClose() {
-      this.delDetailIds = []
-      this.restForm();
-      this.$refs.timeTable.restTable();
-      this.visible = false;
-    },
-    gettimeAll(val) {
-      this.form.totalWorkHour = val;
+      },
+      // 重置表单
+      restForm () {
+        this.$refs.form.clearValidate();
+        this.form = { ...this.defaultForm };
+      },
+      handleClose () {
+        this.delDetailIds = [];
+        this.restForm();
+        this.$refs.timeTable.restTable();
+        this.visible = false;
+      },
+      gettimeAll (val) {
+        this.form.totalWorkHour = val;
+      }
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.location-warp {
-  display: flex;
-  .detail {
-    margin-left: 10px;
+  .location-warp {
+    display: flex;
+    .detail {
+      margin-left: 10px;
+    }
   }
-}
 </style>

+ 2 - 2
vue.config.js

@@ -32,8 +32,8 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://192.168.3.51:18086', // 测试
-        target: 'http://192.168.3.35:8080', // kang杨威
-        // target: 'http://192.168.3.33:8080', // 谢一平
+        // target: 'http://192.168.3.35:8080', // kang杨威
+        target: 'http://192.168.3.33:8080', // 谢一平
         // target: 'http://192.168.3.38:8080', // 陈潇
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {