mushencc hace 2 años
padre
commit
c7a2eda875
Se han modificado 5 ficheros con 56 adiciones y 93 borrados
  1. 3 5
      src/axios/index.js
  2. 6 6
      src/router/index.js
  3. 17 60
      src/views/Login.vue
  4. 28 7
      src/views/page/Finish/detailed.vue
  5. 2 15
      vue.config.js

+ 3 - 5
src/axios/index.js

@@ -15,16 +15,14 @@ config = {
 // 请求拦截,后期可能会用到,先注册在此
 instance.interceptors.request.use(
   function (config) {
-    const token = localStorage.getItem('mobile_token')
+    const token = localStorage.getItem('token')
     // let proxy_url = 'http://121.37.173.82:82'; //打包上线时请改用此处
-    // let proxy_url = process.env.VUE_APP_BASE_URL; //打包上线时请改用此处
+    const proxyUrl = process.env.VUE_APP_BASE_URL //打包上线时请改用此处
     // let proxy_url = '/proxy'//打包上线时此处请注释掉
-    const proxyUrl = JSON.parse(localStorage.getItem('mobile_url'))
     config.url = proxyUrl + config.url
-
+    console.log(config)
     // 在发送请求之前做些什么,例如加入token
     config.headers.Authorization = token
-    config.headers['Content-Sign'] = 'b21779e9365ed84e4dd382ccdacc6d51'
     return config
   },
   function (error) {

+ 6 - 6
src/router/index.js

@@ -32,15 +32,15 @@ const router = new VueRouter({
 })
 router.beforeEach((to, from, next) => {
   if (to.path === '/') {
-    next();
+    next()
   } else {
-    let token = localStorage.getItem('mobile_token');
+    const token = localStorage.getItem('token')
     if (!token) {
-      next('/');
+      next('/')
     } else {
-      next();
+      next()
     }
   }
-  next();
-});
+  next()
+})
 export default router

+ 17 - 60
src/views/Login.vue

@@ -62,36 +62,6 @@
           placeholder="请输入密码"
         ></b-form-input>
       </b-form-group>
-      <b-form-group
-        label="域名:"
-        label-for="input-3"
-        style="
-          margin-bottom: 5rem;
-          height: 3rem;
-          font-size: 1.2rem;
-
-          border-radius: 3rem;
-        "
-        label-cols="2"
-      >
-        <b-form-input
-          id="input-3"
-          v-model="form.url"
-          required
-          class="inp"
-          style="
-            height: 3rem;
-            font-size: 1.1rem;
-            letter-spacing: 0.1rem;
-            font-weight: 500;
-            border-radius: 1.2rem;
-            background: #f2f2f2;
-            border: none;
-            box-shadow: 0.2rem 0.18rem 0.1rem 0.1rem rgba(0, 0, 0, 0.3);
-          "
-          placeholder="请输入域名"
-        ></b-form-input>
-      </b-form-group>
       <b-button
         type="submit"
         variant="primary"
@@ -100,6 +70,7 @@
           height: 3rem;
           font-size: 1.2rem;
           border-radius: 1.2rem;
+          margin-top: 2rem;
         "
         >登录</b-button
       >
@@ -108,47 +79,33 @@
 </template>
 
 <script>
-import $ from "jquery";
 export default {
   data () {
     return {
       form: {
         account: '',
-        password: '',
-        url: 'http://fyy_api.qingyaokeji.com'
-        // "https://fyy_api.qingyaokeji.com",
-        // url: "https://192.168.0.125:8081"
+        password: ''
       }
     }
   },
 
   methods: {
     onSubmit () {
-      // let that = this;
-      // let data = this.form;
-      // $.ajax({
-      //   type: "post",
-      //   url: `${that.form.url}/api/loginMobile`,
-      //   data: { ...data },
-      //   dataType: "json",
-      //   timeout: 5000,
-      //   success: function (res) {
-      //     if (res.code == 200) {
-      //       localStorage.setItem('mobile_url', JSON.stringify(that.form.url));
-      //       localStorage.setItem('mobile_token', JSON.stringify(res.data.token));
-      //       that.$Message.success(res.msg);
-      //       that.$router.push({ path: '/cms/home' })
-      //     }
-
-      //   },
-      //   error: function () {
-
-      //   }
-      // });
-      this.$Message.success('登录成功')
-      localStorage.setItem('mobile_url', JSON.stringify(this.form.url))
-      localStorage.setItem('mobile_token', 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ')
-      this.$router.push({ path: '/cms/home' })
+      const data = {
+        post: {
+          name: this.form.account, password: this.form.password, rememberMe: true
+        },
+        url: 'http://121.36.142.167:7774/jbl/api/mes/login',
+        header: ['Content-Type:application/json']
+      }
+      this.axios.post('/api/testdwy', data).then(res => {
+        if (res.code === 200) {
+          this.$Message.success(res.msg)
+          localStorage.setItem('token', res.data.token)
+          localStorage.setItem('userDto', JSON.stringify(res.data.userDto))
+          this.$router.push('/cms/home')
+        }
+      })
     }
   }
 }

+ 28 - 7
src/views/page/Finish/detailed.vue

@@ -4,7 +4,7 @@
       <div v-for="(item, index) in list" :key="index" class="item">
         <div class="unit" style="display: flex">
           <label style="width: 40%">派工单号:</label>
-          <div style="width: 60%;word-break: break-all">{{ item.dispatch_no}}</div>
+          <div style="width: 60%;word-break: break-all">{{ item.dispatch_order_no}}</div>
         </div>
         <div style="display: flex" class="unit">
           <label style="width: 40%">产品名称:</label>
@@ -18,6 +18,7 @@
             style="width: 70%; padding: 0 0 0 0.2rem"
             v-model="item.finished_num"
             type="number"
+            @on-change="handleChangeNumber($event,index)"
           />
         </div>
         <div class="unit">
@@ -32,6 +33,7 @@
               border-radius: 0.6rem;
               background: #fff;
             "
+            @change="(e)=>handleChangeTeam(e,index)"
           >
 <!--            @change="handleChooseTeam"-->
             <template v-slot:first>
@@ -49,10 +51,10 @@
               width: 70%;
               background: #fff;
             "
-              id="iSelect"
               size='small'
               transfer
               multiple
+              @on-change="handleChangeEmployee($event,index)"
           >
             <Option v-for="item in employeeList" :key="item.id" :label="item.text" :value="item.value"/>
           </Select>
@@ -70,6 +72,7 @@
               border-radius: 0.6rem;
               background: #fff;
             "
+            @change="(e) => handleChangeEquipment(e,index)"
           >
             <template v-slot:first>
               <b-form-select-option value="" disabled
@@ -255,13 +258,31 @@ export default {
     this.initData(id)
   },
   methods: {
+    handleChangeNumber (e, index) {
+      this.list[index].not_finished_num = this.list[index].dispatch_num - (e.target.value * 1)
+    },
+    handleChangeEmployee (e, index) {
+      this.list[index].employee_id_show = this.employeeList.filter(v => e.indexOf(v.no) !== -1).map(v => v.name).toString().replace(/,/g, '/$/$/$').replace(/\//g, '')
+      console.log(this.list[index])
+    },
+    handleChangeTeam (e, index) {
+      this.list[index].team_id_show = this.teamList.find(v => v.team_code === e).title
+    },
+    handleChangeEquipment (e, index) {
+      this.list[index].equipment_id_show = this.equipmentList.find(v => v.device_code === e).title
+    },
     initData (id) {
       this.list = JSON.parse(localStorage.getItem(id + ''))
       this.list.forEach(v => {
         v.team_finish_id = v.dispatch_orders.team_id
+        v.team_id_show = v.dispatch_orders.team_id_show
         v.equipment_id = v.dispatch_orders.equipment_id
+        v.equipment_id_show = v.dispatch_orders.equipment_id_show
         v.finished_num = v.not_finished_num
+        v.dispatch_order_no = v.dispatch_no
+        v.id = null
         v.employee_id = v.dispatch_orders.employee_id.split(',')
+        v.employee_id_show = v.dispatch_orders.employee_id_show
         v.break = [
           { break_id: '', break_num: 0 }
         ]
@@ -314,7 +335,7 @@ export default {
           url: 'http://121.36.142.167:7774/jbl/api/module-data/completion_orders/completion_orders',
           post: {
             bizId: -1,
-            bizTypeEK: 'LOWCODE',
+            bizTypeEk: 'LOWCODE',
             dynamicFormId: "474201923419320320",
             showModelId: "474382714828959744",
             data: {
@@ -324,9 +345,9 @@ export default {
                 created_by: null,
                 created_date: null,
                 employee_id: v.employee_id.toString(),
-                employee_id_show: "郭银",
+                employee_id_show: v.employee_id_show,
                 equipment_id: v.equipment_id,
-                equipment_id_show: "5号多层热压机",
+                equipment_id_show: v.equipment_id_show,
                 last_modified_by: null,
                 last_modified_date: null,
                 process_id: v.dispatch_orders.process_id,
@@ -334,9 +355,9 @@ export default {
                 remark: null,
                 site: null,
                 team_id: v.team_finish_id,
-                team_id_show: "包装一组",
+                team_id_show: v.team_id_show
               },
-              completion_orders_dtl: v
+              completion_orders_dtl: [v]
             }
           },
           header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOLFJPTEVfSU5URVJGQUNFIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0Njc0MTE0fQ.L3Di3K_cpF0rWSgvzbcLufLm8bkCxd3Y-xudfKzSm4F-qdpDr0hYWWQP5K5BYTNuZnu4tWpGmSW2KRHU0pjt-A', 'Content-Type:application/json']

+ 2 - 15
vue.config.js

@@ -1,18 +1,5 @@
-// const axios_default_ip =
-//   process.env.NODE_ENV == "dev"
-//     ? "http://192.168.0.115:8080"//jiufang2.1
-//     // http://192.168.0.115:8080
-//     : process.env.NODE_ENV == "test-prd"
-//       ? "http://zh_api.qingyaokeji.com" //
-//       : process.env.NODE_ENV == "prd_other"
-//         ? "http://121.37.173.82:82" //贝斯特
-//         : "http://124.71.176.88:882";
-// //http://hxy_api.qingyaokeji.com // 华信源
-// //  http://124.71.176.88:882  //江山
-// // 'http://121.41.102.225:82' :测试
-// // http://124.71.176.88:70  下沙新地址
-// //http://121.41.102.225:999 上线服务器
-// process.env.VUE_APP_BASE_URL = axios_default_ip;
+const axios_default_ip = "http://fyy_api.qingyaokeji.com";
+process.env.VUE_APP_BASE_URL = axios_default_ip;
 module.exports = {
   publicPath: './',
   outputDir: 'dist',