From 54d5ec8ed84113f7d928c4b6e86bc9d640bffc71 Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期二, 31 十月 2023 18:06:20 +0800
Subject: [PATCH] 	modified:   src/api/basic/division.js 	modified:   src/views/basic/division/division-form.vue 	modified:   src/views/basic/division/index.vue 	modified:   src/views/basic/part/index.vue 	modified:   src/views/basic/post/post-form.vue 	modified:   src/views/technology/document/index.vue 	modified:   vue.config.js

---
 src/views/basic/division/index.vue         |   40 ++-----
 src/views/basic/part/index.vue             |   69 +++++++++----
 vue.config.js                              |    2 
 src/views/basic/post/post-form.vue         |   69 +++++++++----
 src/api/basic/division.js                  |    7 +
 src/views/technology/document/index.vue    |    4 
 src/views/basic/division/division-form.vue |   56 ++++++----
 7 files changed, 155 insertions(+), 92 deletions(-)

diff --git a/src/api/basic/division.js b/src/api/basic/division.js
index b624462..c4390a5 100644
--- a/src/api/basic/division.js
+++ b/src/api/basic/division.js
@@ -69,3 +69,10 @@
     data: obj
   })
 }
+
+export function loadFactoryListByCompany(id) {
+  return request({
+    url: '/mes/factory/byCompanyId?id='+id,
+    method: 'get',
+  })
+}
\ No newline at end of file
diff --git a/src/views/basic/division/division-form.vue b/src/views/basic/division/division-form.vue
index 43476c2..dd0fcaa 100644
--- a/src/views/basic/division/division-form.vue
+++ b/src/views/basic/division/division-form.vue
@@ -31,26 +31,9 @@
       </el-row>
       <el-row>
         <el-col :span="12">
-          <el-form-item label="绠$悊浜哄憳" prop="staffId">
-            <el-select
-              v-model="dataForm.staffId"
-              filterable
-              placeholder="璇烽�夋嫨"
-              style="width: 100%;"
-            >
-              <el-option
-                v-for="(item, index) in this.staffOptions"
-                :key="index"
-                :label="item.staffName"
-                :value="item.id"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
           <el-form-item label="鍏徃" prop="companyId">
             <el-select
+            @change="changeCompany"
               v-model="dataForm.companyId"
               filterable
               placeholder="璇烽�夋嫨"
@@ -62,6 +45,14 @@
                 :label="item.companyName"
                 :value="item.id"
               >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="宸ュ巶" prop="factotyId">
+            <el-select style="width: 100%;" v-model="dataForm.factotyId" @change="changeFactory" placeholder="璇烽�夋嫨">
+              <el-option v-for="item in factotyOption" :key="item.id" :label="item.factoryName" :value="item.id">
               </el-option>
             </el-select>
           </el-form-item>
@@ -93,7 +84,8 @@
   addObj,
   putObj,
   loadStaff,
-  dataFormTransfer
+  dataFormTransfer,
+  loadFactoryListByCompany
 } from '@/api/basic/division'
 import { loadCompany } from '@/api/basic/factory'
 
@@ -101,18 +93,20 @@
   data() {
     return {
       visible: false,
+      factotyOption:[],
       dataForm: {
         id: 0,
         divisionNo: '',
         divisionName: '',
         supervisorId: '',
         remark: '',
+        factotyId: null,
+        factotyName: null,
         companyId: '',
         createTime: '',
         updateTime: '',
         createUser: '',
         updateUser: '',
-        companyId: '',
         staffId: ''
       },
       companyOptions: [],
@@ -126,7 +120,10 @@
         ],
         companyId: [
           { required: true, message: '鍏徃涓嶈兘涓虹┖', trigger: 'blur' }
-        ]
+        ],
+        factotyId: [
+          { required: true, message: '宸ュ巶涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
       },
       isSubmit: false
     }
@@ -146,6 +143,19 @@
         }
       })
     },
+    changeCompany() {
+      console.log(this.dataForm.companyId);
+      loadFactoryListByCompany(this.dataForm.companyId).then((res) => {
+        console.log(res.data);
+        this.factotyOption = res.data.data
+      })
+    },
+    changeFactory(){
+      this.dataForm.factotyName=this.factotyOption.filter(item=>{
+        return item.id==this.dataForm.factotyId
+      })[0].factoryName;
+      console.log(this.dataForm);
+    },
     // 琛ㄥ崟鎻愪氦
     dataFormSubmit() {
       this.isSubmit = true
@@ -155,7 +165,9 @@
         remark: this.dataForm.remark,
         staffId: this.dataForm.staffId,
         companyId: this.dataForm.companyId,
-        id: this.dataForm.id
+        id: this.dataForm.id,
+        factoryName: this.dataForm.factotyName,
+        factotyId: this.dataForm.factotyId
       }
       this.$refs.dataForm.validate((valid) => {
         if (valid) {
diff --git a/src/views/basic/division/index.vue b/src/views/basic/division/index.vue
index 5fe0c36..b390fe0 100644
--- a/src/views/basic/division/index.vue
+++ b/src/views/basic/division/index.vue
@@ -1,24 +1,12 @@
 <template>
   <div class="mod-config">
     <basic-container>
-      <ttable
-        :table="table"
-        @handleSelectionChange="handleSelectionChange"
-        :uploadInfo="uploadInfo"
-        :isShowHide="true"
-        :prelang="prelang"
-        :options="options"
-        :ajaxFun="ajaxFun"
-        ref="divisionTable"
-      >
+      <ttable :table="table" @handleSelectionChange="handleSelectionChange" :uploadInfo="uploadInfo" :isShowHide="true"
+        :prelang="prelang" :options="options" :ajaxFun="ajaxFun" ref="divisionTable">
         <template #toolbar></template>
       </ttable>
       <!-- 寮圭獥, 鏂板 / 淇敼 -->
-      <table-form
-        v-if="addOrUpdateVisible"
-        ref="addOrUpdate"
-        @refreshDataList="getData"
-      ></table-form>
+      <table-form v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getData"></table-form>
     </basic-container>
   </div>
 </template>
@@ -82,21 +70,21 @@
             isSearch: true,
             searchInfoType: 'text'
           },
-          // 绠$悊浜哄憳
-          {
-            minWidth: '140',
-            prop: 'staffName',
-            label: '绠$悊浜哄憳',
-            sort: true,
-            isTrue: true,
-            isSearch: true,
-            searchInfoType: 'text'
-          },
           // 鍏徃
           {
             minWidth: '120',
             prop: 'companyName',
             label: '鍏徃',
+            sort: true,
+            isTrue: true,
+            isSearch: true,
+            searchInfoType: 'text'
+          },
+          // 绠$悊浜哄憳
+          {
+            minWidth: '140',
+            prop: 'factoryName',
+            label: '宸ュ巶',
             sort: true,
             isTrue: true,
             isSearch: true,
@@ -204,7 +192,7 @@
         closeOnClickModal: false,
         type: 'warning'
       })
-        .then(function() {
+        .then(function () {
           return delObj(row.id)
         })
         .then((data) => {
diff --git a/src/views/basic/part/index.vue b/src/views/basic/part/index.vue
index 1e00afc..b545774 100644
--- a/src/views/basic/part/index.vue
+++ b/src/views/basic/part/index.vue
@@ -5,6 +5,10 @@
         :prelang="prelang" :options="options" :bottomOffset="125" :ajaxFun="ajaxFun" ref="partTable">
         <template #toolbar></template>
       </ttable>
+      <el-upload :headers="{'Authorization': 'Bearer ' + yourToken}" class="upload-demo" action="/mes/part/uploadExcel" :on-preview="handlePreview"
+        :on-remove="handleRemove" :file-list="fileList" :on-success="fileUpload"  :limit="1">
+        <el-button size="small" type="primary">鐐瑰嚮Excel瀵煎叆</el-button>
+      </el-upload>
       <!-- 寮圭獥, 鏂板 / 淇敼 -->
       <table-form v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getData"></table-form>
       <PrintLabelForm :currshowlist.sync="showPrintLabelForm" :printLabelInfo="printLabelInfo" />
@@ -33,16 +37,18 @@
 import { mapGetters } from 'vuex'
 import ttable from '@/views/common/ztt-table.vue'
 import { remote } from '../../../api/admin/dict'
-import { dateFormat,dateFormatYearMonthDate,dateFormatPlus } from '@/util/date'
+import { dateFormat, dateFormatYearMonthDate, dateFormatPlus } from '@/util/date'
 import PrintLabelForm from './print-label-form.vue'
 export default {
   data() {
     return {
+      fileList: [],
       selectDate: "",
       dialogVisible: false,
       ajaxFun: fetchList,
       addOrUpdateVisible: false,
       multipleSelection: [],
+      yourToken: "",
       uploadInfo: {
         // 鏄惁灞曠ず涓婁紶EXCEL浠ュ強瀵瑰簲鐨剈rl
         isShow: true,
@@ -357,23 +363,29 @@
           }
         ],
         toolbar: [
-          {
-            text: '鏂板',
-            type: 'primary',
-            fun: this.addOrUpdateHandle
-          },
-          {
-            text: '鑾峰彇IFS闆朵欢',
-            type: 'primary',
-            fun: this.syncISDate,
-            loading: false
-          },
-          {
-            text: '澶ф爣绛�',
-            type: 'primary',
-            fun: this.printLabel,
-            loading: false
-          }
+          // {
+          //   text: '鏂板',
+          //   type: 'primary',
+          //   fun: this.addOrUpdateHandle
+          // },
+          // {
+          //   text: '鑾峰彇IFS闆朵欢',
+          //   type: 'primary',
+          //   fun: this.syncISDate,
+          //   loading: false
+          // },
+          // {
+          //   text: '澶ф爣绛�',
+          //   type: 'primary',
+          //   fun: this.printLabel,
+          //   loading: false
+          // },
+          // {
+          //   text: 'Excel瀵煎叆',
+          //   type: 'primary',
+          //   fun: this.uploadPartExcel,
+          //   loading: false
+          // },
         ],
         operator: [
           {
@@ -412,6 +424,8 @@
     PrintLabelForm
   },
   created() {
+    let token=JSON.parse(sessionStorage.getItem("ztt-access_token")).content
+    this.yourToken=token
     this.table.column.find((e) => e.label === 'IFS鍚敤鎵规绠$悊').isTrue = false
     this.table.column.find((e) => e.label === '璁″垝鏂规硶').isTrue = false
     this.getUnitType('unit')
@@ -427,6 +441,16 @@
     ...mapGetters(['permissions'])
   },
   methods: {
+    handleRemove(file, fileList) {
+      console.log(file, fileList);
+    },
+    handlePreview(file) {
+
+    },
+    fileUpload(){
+      this.$message.success('鍚庡彴姝e湪瀵煎叆涓紝璇风◢鍚庡埛鏂帮紒')
+      this.fileList=[]
+    },
     handleClose() {
       this.selectDate = "";
       this.dialogVisible = false
@@ -650,9 +674,9 @@
       let datas = new FormData()
       let times = null;
       if (this.selectDate != '' && this.selectDate != null) {
-        times=dateFormatPlus(this.selectDate)
-      }else{
-        times=null
+        times = dateFormatPlus(this.selectDate)
+      } else {
+        times = null
       }
       datas.set("date", times)
       // console.log(datas.get("date"));
@@ -683,6 +707,9 @@
           // this.$message.error('鍚屾ERP澶辫触:' + e)
         })
     },
+    uploadPartExcel() {
+
+    },
     printLabel() {
       if (this.multipleSelection && this.multipleSelection.length > 0) {
         if (this.multipleSelection && this.multipleSelection.length === 1) {
diff --git a/src/views/basic/post/post-form.vue b/src/views/basic/post/post-form.vue
index 846d0be..4ce7d29 100644
--- a/src/views/basic/post/post-form.vue
+++ b/src/views/basic/post/post-form.vue
@@ -1,29 +1,45 @@
 <template>
-  <el-dialog
-    :title="!dataForm.id ? '鏂板' : '淇敼'"
-    :close-on-click-modal="false"
-    :visible.sync="visible"
-  >
-    <el-form
-      :model="dataForm"
-      :rules="dataRule"
-      ref="dataForm"
-      label-width="120px"
-      class="l-mes"
-    >
+  <el-dialog :title="!dataForm.id ? '鏂板' : '淇敼'" :close-on-click-modal="false" :visible.sync="visible">
+    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="120px" class="l-mes">
       <el-row>
+        <el-col :span="12">
+          <el-form-item label="鍏徃" prop="company">
+            <el-select style="width: 100%;" v-model="dataForm.company" placeholder="璇烽�夋嫨">
+              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="宸ュ巶" prop="factory">
+            <el-select style="width: 100%;" v-model="dataForm.factory" placeholder="璇烽�夋嫨">
+              <el-option v-for="item in optionsfactory" :key="item.value" :label="item.label" :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="閮ㄩ棬" prop="division">
+            <el-select style="width: 100%;" v-model="dataForm.division" placeholder="璇烽�夋嫨">
+              <el-option v-for="item in optionsdepartment" :key="item.value" :label="item.label" :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
         <el-col :span="12">
           <el-form-item label="宀椾綅缂栧彿" prop="postNo">
             <el-input v-model="dataForm.postNo" placeholder=""></el-input>
           </el-form-item>
         </el-col>
+      </el-row>
+      <el-row>
         <el-col :span="12">
           <el-form-item label="宀椾綅鍚嶇О" prop="postName">
             <el-input v-model="dataForm.postName" placeholder=""></el-input>
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row>
         <el-col :span="12">
           <el-form-item label="澶囨敞" prop="remark">
             <el-input v-model="dataForm.remark" placeholder=""></el-input>
@@ -33,12 +49,7 @@
     </el-form>
     <span slot="footer" class="dialog-footer">
       <el-button @click="visible = false">鍙栨秷</el-button>
-      <el-button
-        type="primary"
-        :disabled="isSubmit"
-        v-thinclick="`dataFormSubmit`"
-        >纭畾</el-button
-      >
+      <el-button type="primary" :disabled="isSubmit" v-thinclick="`dataFormSubmit`">纭畾</el-button>
     </span>
   </el-dialog>
 </template>
@@ -51,8 +62,14 @@
     return {
       ruleOptions: [],
       visible: false,
+      options: [],
+      optionsfactory:[],
+      optionsdepartment: [],
       dataForm: {
         id: 0,
+        company: null,
+        factory: null,
+        division: null,
         postNo: '',
         postName: '',
         remark: ''
@@ -60,6 +77,18 @@
       dataRule: {
         postName: [
           { required: true, message: '宀椾綅鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        postNo: [
+          { required: true, message: '宀椾綅缂栧彿涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        company: [
+          { required: true, message: '鍏徃鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        factory: [
+          { required: true, message: '宸ュ巶鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' }
+        ], 
+        division: [
+          { required: true, message: '閮ㄩ棬鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' }
         ]
       },
       isSubmit: false
diff --git a/src/views/technology/document/index.vue b/src/views/technology/document/index.vue
index c746080..7db3d0f 100644
--- a/src/views/technology/document/index.vue
+++ b/src/views/technology/document/index.vue
@@ -20,12 +20,12 @@
             v-if="permissions.technology_document_del"
             >鎵归噺鍒犻櫎</el-button
           >
-          <el-button
+          <!-- <el-button
             type="primary"
             @click="bindTestStandard"
             v-if="permissions.technology_document_standard_upload"
             >鎵归噺缁戝畾妫�娴嬫爣鍑�</el-button
-          >
+          > -->
         </template>
       </ttable>
       <el-dialog
diff --git a/vue.config.js b/vue.config.js
index 2921129..e436b9e 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -3,7 +3,7 @@
  * https://cli.vuejs.org/zh/config/
  */
 //const url = 'http://ztt-gateway:9999'
-const url = 'http://192.168.0.15:9999'
+const url = 'http://ztt-gateway:9999'
 const localUrl = 'http://localhost:8089'
 //const localUrl = 'http://10.88.15.95:8089'
 const CompressionWebpackPlugin = require('compression-webpack-plugin')

--
Gitblit v1.9.3