mushencc 1 rok temu
rodzic
commit
17729faf1f

+ 29 - 32
src/axios/index.js

@@ -1,8 +1,8 @@
-import axios from "axios";
+import axios from 'axios'
 
-import Vue from "vue";
-let config = {};
-const instance = axios.create(config);
+import Vue from 'vue'
+let config = {}
+const instance = axios.create(config)
 // 3. 配置信息
 config = {
   // 每次请求的协议、IP地址。  设置该配置后,每次请求路径都可以使用相对路径,例如"/admin/login"
@@ -10,56 +10,53 @@ config = {
   // 请求超时时间
   timeout: 0,
   // 每次请求携带cookie
-  withCredentials: true,
-};
-//请求拦截,后期可能会用到,先注册在此
+  withCredentials: true
+}
+// 请求拦截,后期可能会用到,先注册在此
 instance.interceptors.request.use(
   function (config) {
-    let token = localStorage.getItem("mobile_token");
+    const token = localStorage.getItem('mobile_token')
     // let proxy_url = 'http://121.37.173.82:82'; //打包上线时请改用此处
     // let proxy_url = process.env.VUE_APP_BASE_URL; //打包上线时请改用此处
     // let proxy_url = '/proxy'//打包上线时此处请注释掉
-    let proxy_url = JSON.parse(localStorage.getItem('mobile_url'));
-    config.url = proxy_url + config.url;
+    const proxyUrl = JSON.parse(localStorage.getItem('mobile_url'))
+    config.url = proxyUrl + config.url
 
     // 在发送请求之前做些什么,例如加入token
-    config.headers["Authorization"] = token;
-    config.headers['Content-Sign'] = 'b21779e9365ed84e4dd382ccdacc6d51';
-    config.headers['host'] = '121.36.142.167:7774';
-    return config;
+    config.headers.Authorization = token
+    config.headers['Content-Sign'] = 'b21779e9365ed84e4dd382ccdacc6d51'
+    return config
   },
   function (error) {
     // 对请求错误做些什么
-    return Promise.reject(error);
+    return Promise.reject(error)
   }
-);
-
+)
 // 2. 响应拦截
 instance.interceptors.response.use(
   (res) => {
-
-    if (res.status == 200) {
-      if (res.data.code == 200) {
-        return res.data;
+    if (res.status === 200) {
+      if (res.data.code === 200) {
+        return res.data
       } else {
-        //若code 非 200
-        if (res.data.code == 401) {
-          localStorage.removeItem("mobile_token");
-          return location.reload();
+        // 若code 非 200
+        if (res.data.code === 401) {
+          localStorage.removeItem('mobile_token')
+          return location.reload()
         }
-        Vue.prototype.$Message.error(res.data.msg || "未知错误");
-        return res.data || res;
+        Vue.prototype.$Message.error(res.data.msg || '未知错误')
+        return res.data || res
       }
     } else {
-      return Vue.prototype.$Message.error("请求超时");
+      return Vue.prototype.$Message.error('请求超时')
     }
   },
   // 对于错误响应的处理
   (err) => {
-    Vue.prototype.$Notice.error({ title: "请求失败", desc: err });
+    Vue.prototype.$Notice.error({ title: '请求失败', desc: err })
 
-    return err;
+    return err
   }
-);
+)
 
-export default instance;
+export default instance

+ 8 - 8
src/views/Login.vue

@@ -110,20 +110,20 @@
 <script>
 import $ from "jquery";
 export default {
-  data() {
+  data () {
     return {
       form: {
         account: '',
         password: '',
-        url: 'http://121.36.142.167:7774/jbl'
+        url: 'http://fyy_api.qingyaokeji.com'
         // "https://fyy_api.qingyaokeji.com",
-        // url: "http://192.168.0.125:8081"
-      },
+        // url: "https://192.168.0.125:8081"
+      }
     }
   },
 
   methods: {
-    onSubmit() {
+    onSubmit () {
       // let that = this;
       // let data = this.form;
       // $.ajax({
@@ -146,10 +146,10 @@ export default {
       //   }
       // });
       this.$Message.success('登录成功')
-      localStorage.setItem('mobile_url', JSON.stringify(this.form.url));
+      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' })
-    },
+    }
   }
 }
 </script>
@@ -202,4 +202,4 @@ export default {
 .inp:focus {
   background: #fff !important;
 }
-</style>
+</style>

+ 39 - 32
src/views/page/Finish/detail.vue

@@ -58,10 +58,10 @@
           :class="item.is_choose ? 'choose_item' : ''"
         >
           <td>
-            {{ item.dispatch_no.toString() }}
+            {{ item.dispatch_no }}
           </td>
           <td>{{ item.product_title }}</td>
-          <td>100*100*100</td>
+          <td>{{item.size}}</td>
           <td>{{ item.finished_num }}</td>
           <td>{{ item.un_finished_quantity }}</td>
         </tr>
@@ -89,58 +89,65 @@
 </template>
 <script>
 export default {
-  data() {
+  data () {
     return {
-
       tableData: [],
       is_show: true,
-      is_use: false,
-
+      is_use: false
     }
   },
-  mounted() {
-    let data = {};
-    if (localStorage.getItem('fyy_target')) {
-      data.target = JSON.parse(localStorage.getItem('fyy_target'));
-    }
-    this.initData(data);
+  mounted () {
+    // if (localStorage.getItem('fyy_target')) {
+    //   data.target = JSON.parse(localStorage.getItem('fyy_target'))
+    // }
+    this.tableData = []
+    const fyyTarget = ('PG20230815000028,PG2023081400027').split(',')
+    fyyTarget.forEach(v => {
+      const data = {
+        url: 'http://121.36.142.167:7774/jbl/api/module-data/dispatch_orders/page',
+        post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[{"field":"dispatch_orders.dispatch_no","option":"LIKE_ANYWHERE","values":[v]},{"field":"product_no","option":"LIKE_ANYWHERE","values":["BC030101000001"]}],"size":15,"specialConditions":[],"workflowSearchBean":{},"dynamicFormCode":"dispatch_orders","dynamicFormTable":null,"ignoreField":true,"developmentSystemId":null,"debugFlag":true},
+        header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOLFJPTEVfSU5URVJGQUNFIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0Njc0MTE0fQ.L3Di3K_cpF0rWSgvzbcLufLm8bkCxd3Y-xudfKzSm4F-qdpDr0hYWWQP5K5BYTNuZnu4tWpGmSW2KRHU0pjt-A', 'Content-Sign:a2898699a4433b413d8473e4b59d64b8', 'Content-Type:application/json']
+      }
+      this.initData(data)
+    })
   },
   methods: {
-    initData(row) {
-      this.axios.post('/api/finishedOrderList', { ...row, process_id: this.$route.query.id }).then(res => {
-        this.tableData = res.data.data ? res.data.data : [];
-        this.tableData.forEach(v => {
-          v.is_choose = false;
+    initData (row) {
+      this.axios.post('/api/testdwy', { ...row }).then(res => {
+        res.data.data.content.forEach(v => {
+          v.is_choose = false
+          v.dispatch_no = v.dispatch_orders.dispatch_no
         })
+        this.tableData.push(...res.data.data['dispatch_orders_dtl'])
       })
     },
-    handelGoSure() {
-      if (this.tableData.filter(v => v.is_choose).length == 0) {
+    handelGoSure () {
+      if (this.tableData.filter(v => v.is_choose).length === 0) {
         return this.$Message.warning('请先选择数据!')
       }
-      localStorage.removeItem('fyy_target');
-      let id = this.tableData.map(v => v.id).toString();
+      localStorage.removeItem('fyy_target')
+      const id = this.tableData.filter(v => v.is_choose).map(v => v['dynamic_form_value_id']).toString()
       this.$router.push({ path: '/cms/finish/detailed', query: { id } })
     },
-    handleReturn() {
-      localStorage.removeItem('fyy_target');
-      this.$router.push('/cms/home');
+    handleReturn () {
+      localStorage.removeItem('fyy_target')
+      this.$router.push('/cms/finish')
     },
-    handleChoose(item, index) {
-      item.is_choose = !item.is_choose;
-      this.tableData.splice(index, 1, item);
+    handleChoose (item, index) {
+      item.is_choose = !item.is_choose
+      this.tableData.splice(index, 1, item)
     },
-    handleShow() {
-      this.is_show = !this.is_show;
+    handleShow () {
+      this.is_show = !this.is_show
       console.log(document.getElementsByClassName('header'))
       if (this.is_show) {
         document.getElementsByClassName('header')[0].style = 'height:7rem;overflow:hidden;transition:all .4s;'
         setTimeout(() => {
           document.getElementsByClassName('header')[0].style = 'overflow:none;'
-          this.is_use = false;
+          this.is_use = false
         }, 400)
       } else {
-        this.is_use = true;
+        this.is_use = true
         document.getElementsByClassName('header')[0].style = 'height:2.7rem;overflow:hidden;transition:all .4s;'
       }
     }
@@ -260,4 +267,4 @@ th {
   position: absolute;
   bottom: 4.8rem;
 }
-</style>
+</style>

+ 125 - 114
src/views/page/Finish/detailed.vue

@@ -2,11 +2,9 @@
   <div>
     <div class="content">
       <div v-for="(item, index) in list" :key="index" class="item">
-        <div class="add" @click="handleAdd(item, index)">+</div>
-        <div class="delete" @click="handleDelete(index)">x</div>
         <div class="unit" style="display: flex">
           <label style="width: 40%">派工单号:</label>
-          <div style="width: 60%">{{ item.dispatch_no }}</div>
+          <div style="width: 60%;word-break: break-all">{{ formData.dispatch_no }}</div>
         </div>
         <div style="display: flex" class="unit">
           <label style="width: 40%">产品名称:</label>
@@ -18,14 +16,14 @@
             size="small"
             placeholder="请输入"
             style="width: 70%; padding: 0 0 0 0.2rem"
-            v-model="item.quantity"
+            v-model="item['dispatch_num']"
             type="number"
           />
         </div>
         <div class="unit">
           <label>班组:</label>
           <b-form-select
-            v-model="item.team_id"
+            v-model="formData.team_id"
             :options="teamList"
             style="
               height: 1.4rem;
@@ -34,6 +32,7 @@
               border-radius: 0.6rem;
               background: #fff;
             "
+            @change="handleChooseTeam"
           >
             <template v-slot:first>
               <b-form-select-option value="" disabled
@@ -44,23 +43,19 @@
         </div>
         <div class="unit">
           <label>人员:</label>
-          <b-form-select
-            v-model="item.employee_id"
-            :options="employeeList"
-            style="
-              height: 1.4rem;
+          <Select
+              v-model="formData.employee_id"
+              style="
               width: 70%;
-              border: 0.1rem solid;
-              border-radius: 0.6rem;
               background: #fff;
             "
+              size='small'
+              transfer
+              multiple
+              :disabled="!formData.team_id"
           >
-            <template v-slot:first>
-              <b-form-select-option value="" disabled
-                >请选择人员</b-form-select-option
-              >
-            </template></b-form-select
-          >
+            <Option v-for="item in employeeList" :key="item.id" :label="item.text" :value="item.value"/>
+          </Select>
         </div>
 
         <div class="unit">
@@ -123,8 +118,7 @@
               +
             </div>
             <div class="boo" @click="handleBreakCancel(_index, item, index)">
-              -
-            </div>
+              -</div>
           </div>
         </div>
       </div>
@@ -176,100 +170,140 @@
 </template>
 <script>
 export default {
-  data() {
+  data () {
     return {
       list: [],
-      email: "",
-      name: "",
-      food: null,
-      checked: [],
-      form: {},
+      name: '',
+      formData: {},
       teamList: [],
       employeeList: [],
       equipmentList: [],
       state: true,
-      breakList: [
-        { value: 1, text: '碳化' },
-        { value: 2, text: '起泡' },
-      ],
+      breakList: []
     }
   },
-  created() {
-    this.axios.post('/api/finishedOrderDetailsList', { id: this.$route.query.id.split(',') }).then(res => {
-      this.list = res.data.list;
-      this.list.forEach(v => {
-        v.break = [
-          { break_id: '', break_num: 0 }
-        ];
-      })
-    })
-    //获取班组
-    this.axios.post('/api/teamList').then(res => {
-      this.teamList = res.data.data;
-      this.teamList.forEach(v => {
-        v.value = v.id;
-        v.text = v.title;
-      })
-    })
-    //获取人员
-    this.axios.post('/api/employeeList').then(res => {
-      this.employeeList = res.data.data;
-      this.employeeList.forEach(v => {
-        v.value = v.id;
-        v.text = v.emp_name
+  created () {
+    // 获取不良品原因
+    const data2 = {
+      url: 'http://121.36.142.167:7774/jbl/api/module-data/defective_list/page',
+      post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"defective","developmentSystemId":null,"debugFlag":true},
+      header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Sign: 5fb0ea21d28dc57425577987fbeaf1dc', 'Content-Type:application/json']
+    }
+    this.axios.post('/api/testdwy', { ...data2 }).then(res => {
+      this.breakList = res.data.content.filter(v => v.status)
+      this.breakList.forEach(v => {
+        v.value = v.defective_code
+        v.text = v.title
       })
     })
-    //获取设备
-    this.axios.post('/api/equipmentList').then(res => {
-      this.equipmentList = res.data.data;
+    // 获取设备
+    const data1 = {
+      url: 'http://121.36.142.167:7774/jbl/api/module-data/device_list/page',
+      post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"device","developmentSystemId":null,"debugFlag":true},
+      header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Sign: 27a0ae807d9437f5fdad7449cdf52e08', 'Content-Type:application/json']
+    }
+    this.axios.post('/api/testdwy', { ...data1 }).then(res => {
+      this.equipmentList = res.data.content.filter(v => v.status)
       this.equipmentList.forEach(v => {
-        v.value = v.id;
-        v.text = v.title;
+        v.value = v.device_code
+        v.text = v.title
       })
     })
   },
+  mounted () {
+    this.list = []
+    const id = this.$route.query.id.split(',')
+    this.initData(id)
+  },
   methods: {
-    handleBreakAdd(_index, item, index) {
+    async initData (id) {
+      // 获取班组
+      const data1 = {
+        url: 'http://121.36.142.167:7774/jbl/api/module-data/team_list/page',
+        post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"team","developmentSystemId":null,"debugFlag":true},
+        header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Sign: 88cb27fd67215452422c18f3ed71028e', 'Content-Type:application/json']
+      }
+      await this.axios.post('/api/testdwy', { ...data1 }).then(res => {
+        this.teamList = res.data.content.filter(v => v.status)
+        this.teamList.forEach(v => {
+          v.value = v.team_code
+          v.text = v.title
+        })
+      })
+      for(const v in id){
+        const data = {
+          url: `http://121.36.142.167:7774/jbl/api/module-data/dispatch_orders/dispatch_orders/474048895554891776/${id[v]}`,
+          header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Type:application/json']
+        }
+       await this.axios.post('/api/testdwyget', { ...data }).then(res => {
+          this.list.push(...res.data.data['dispatch_orders_dtl'])
+          this.formData = res.data.data['dispatch_orders']
+          this.formData.employee_id = []
+          if (this.formData.team_id) {
+            // 获取班组下的人员
+            console.log((this.teamList))
+            const id = this.teamList.find(v => v.team_code === this.formData.team_id).dynamic_form_value_id
+            const data = {
+              url: `http://121.36.142.167:7774/jbl/api/module-data/team/team/472629516238663680/${id}`,
+              header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Type:application/json']
+            }
+            this.axios.post('/api/testdwyget', { ...data }).then(res => {
+              this.employeeList = res.data.data.employee
+              this.employeeList.forEach(v => {
+                v.value = v.team_code
+                v.text = v.team_code_show
+              })
+            })
+          }
+          this.list.forEach(v => {
+            v.team_id = this.formData.team_id
+            v.break = [
+              { break_id: '', break_num: 0 }
+            ]
+          })
+        })
+      }
+    },
+    handleBreakAdd (_index, item, index) {
       item.break.splice(_index + 1, 0, {
         break_id: '',
         break_num: 0
       })
-      this.list.splice(index, 1, item);
+      this.list.splice(index, 1, item)
     },
-    handleBreakCancel(_index, item, index) {
-      if (_index == 0) {
+    handleBreakCancel (_index, item, index) {
+      if (_index === 0) {
         item.break = [{ break_id: '', break_num: 0 }]
       } else {
-        item.break.splice(_index, 1);
+        item.break.splice(_index, 1)
       }
-      this.list.splice(index, 1, item);
-    },
-    handleReturn() {
-      this.$router.go(-1);
+      this.list.splice(index, 1, item)
     },
-    handleDelete(index) {
-      if (this.list.length == 1) {
-        return
-      } else {
-        this.list.splice(index, 1);
-      }
+    handleReturn () {
+      this.$router.go(-1)
     },
-    handleAdd(item, index) {
-      if (!item.quantity) {
-        return
+    handleChooseTeam (e) {
+      if (e) {
+        this.formData.team_id = e
+        // 获取班组下的人员
+        const id = this.teamList.find(v => v.team_code === this.formData.team_id).dynamic_form_value_id
+        const data = {
+          url: `http://121.36.142.167:7774/jbl/api/module-data/team/team/472629516238663680/${id}`,
+          header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Type:application/json']
+        }
+        this.axios.post('/api/testdwyget', { ...data }).then(res => {
+          this.employeeList = res.data.data.employee
+          this.employeeList.forEach(v => {
+            v.value = v.team_code
+            v.text = v.team_code_show
+          })
+          this.formData.employee_id = []
+        })
       } else {
-        let copy = JSON.parse(JSON.stringify(item));
-        copy.quantity = Math.floor(item.quantity / 2) + item.quantity % 2;
-        copy.break = [{
-          break_id: '', break_num: 0
-        }]
-        item.quantity = Math.floor(item.quantity / 2);
-        this.list.splice(index, 1, item);
-        this.list.splice(index + 1, 0, copy);
+        this.formData.employee_id = []
       }
-
     },
-    handleSure() {
+    handleSure () {
       let data = [];
       this.list.forEach(v => {
         let obj = {};
@@ -285,14 +319,13 @@ export default {
       } else {
         this.state = false;
         this.axios.post('/api/mobileFinishedOrderAdd', { ...data }).then(res => {
-          if (res.code == 200) {
+          if (res.code === 200) {
             this.state = true
             this.$Message.success(res.msg);
             this.handleReturn()
           }
         })
       }
-
     }
   }
 }
@@ -352,31 +385,6 @@ export default {
     }
   }
 }
-// .footer {
-//   position: absolute;
-//   bottom: 7rem;
-//   height: 3rem;
-
-//   width: 100%;
-//   border-top: 0.2rem solid #8a8888;
-// }
-// .footer_content {
-//   display: flex;
-//   flex-wrap: wrap;
-//   font-size: 0.8rem;
-//   > div {
-//     width: 50%;
-//     display: flex;
-//     label {
-//       width: 45%;
-//       text-align: center;
-//     }
-//     div {
-//       width: 60%;
-//       text-align: center;
-//     }
-//   }
-// }
 .footer_btn {
   display: flex;
   justify-content: space-between;
@@ -393,4 +401,7 @@ export default {
   margin: 0.5rem;
   border: 0.1rem solid;
 }
-</style>
+::v-deep ul.ivu-select-dropdown-list{
+  padding: 0 !important;
+}
+</style>

+ 19 - 57
src/views/page/Finish/index.vue

@@ -87,88 +87,50 @@
   </div>
 </template>
 <script>
-import $ from "jquery";
 export default {
-  data() {
+  data () {
     return {
       is_show: true,
       is_use: false,
       selected: '',
-      options: [
-
-
-      ],
-
+      options: []
     }
   },
-  created() {
-    let data = {
-      debugFlag: true,
-      developmentSystemId: null,
-      direction: "DESC",
-      dynamicFormCode: "process_dossier",
-      fromClientType: "pc",
-      number: 0,
-      property: "id",
-      rules: [],
-      size: 15,
-      sorts: [],
-      specialConditions: []
+  created () {
+    const data = {
+      url: 'http://121.36.142.167:7774/jbl/api/module-data/process_dossier/page',
+      post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"process_dossier","developmentSystemId":null,"debugFlag":true},
+      header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Sign: b21779e9365ed84e4dd382ccdacc6d51', 'Content-Type:application/json']
     }
-    this.axios.post('/api/module-data/process_dossier/page', { ...data }).then(res => {
-      this.options = res.data.data;
-
+    this.axios.post('/api/testdwy', { ...data }).then(res => {
+      this.options = res.data.content
       this.options.forEach(v => {
-        v.value = v.id;
-        v.text = v.title;
+        v.value = v.process_code
+        v.text = v.title
       })
-
     })
-    // let that = this;
-    // let url = JSON.parse(localStorage.getItem('mobile_url'));
-
-    // $.ajax({
-    //   type: "post",
-    //   url: `${url}/api/module-data/process_dossier/page`,
-    //   data: { ...data },
-    //   dataType: "json",
-    //   beforeSend: function (xhr) {
-    //     xhr.setRequestHeader('Authorization', 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ');
-    //     xhr.setRequestHeader('Content-Sign', 'b21779e9365ed84e4dd382ccdacc6d51');
-    //   },
-    //   timeout: 5000,
-    //   success: function (res) {
-    //     if (res.code == 200) {
-    //       that.$Message.success(res.msg);
-    //     }
-
-    //   },
-    //   error: function () {
-
-    //   }
-    // });
   },
   methods: {
-    handelGoSure() {
+    handelGoSure () {
       if (!this.selected) {
         return this.$Message.warning('请先选择工序!')
       }
       this.$router.push({ path: '/cms/finish/detail', query: { id: this.selected } })
     },
-    handleReturn() {
-      this.$router.go(-1);
+    handleReturn () {
+      this.$router.push('/cms/home')
     },
-    handleShow() {
-      this.is_show = !this.is_show;
+    handleShow () {
+      this.is_show = !this.is_show
       console.log(document.getElementsByClassName('header'))
       if (this.is_show) {
         document.getElementsByClassName('header')[0].style = 'height:7rem;overflow:hidden;transition:all .4s;'
         setTimeout(() => {
           document.getElementsByClassName('header')[0].style = 'overflow:none;'
-          this.is_use = false;
+          this.is_use = false
         }, 400)
       } else {
-        this.is_use = true;
+        this.is_use = true
         document.getElementsByClassName('header')[0].style = 'height:2.7rem;overflow:hidden;transition:all .4s;'
       }
     }
@@ -262,4 +224,4 @@ export default {
   justify-content: center;
   align-items: center;
 }
-</style>
+</style>

+ 7 - 7
src/views/page/Home.vue

@@ -134,24 +134,24 @@ export default {
   data () {
     return {
       is_show: true,
-      is_use: false,
+      is_use: false
     }
   },
   mounted () {
     console.log(123)
   },
   methods: {
-    handleFinish() {
-      this.$router.push('/cms/finish')
+    handleFinish () {
+      this.$router.push('/cms/finish/detail')
     },
-    handlePackage() {
+    handlePackage () {
       this.$router.push('/cms/Package/detail')
     },
-    handleDispatch() {
+    handleDispatch () {
       this.$router.push('/cms/dispatch/detail')
     },
-    handleShow() {
-      this.is_show = !this.is_show;
+    handleShow () {
+      this.is_show = !this.is_show
       console.log(document.getElementsByClassName('header'))
       if (this.is_show) {
         document.getElementsByClassName('header')[0].style = 'height:7rem;overflow:hidden;transition:all .4s;'

+ 26 - 21
src/views/page/Package/detail.vue

@@ -45,7 +45,7 @@
     <div class="bdy">
       <table>
         <tr style="height: 2rem">
-          <th style="width: 3rem">销售订单号</th>
+          <th style="width: 3rem">生产订单号</th>
           <th style="width: 4rem">产品名称</th>
           <th style="width: 3rem">规格型号</th>
           <th style="width: 3rem">已完工数量</th>
@@ -58,10 +58,10 @@
           :class="item.is_choose ? 'choose_item' : ''"
         >
           <td>
-            {{ item.dispatch_no.toString() }}
+            {{ item.production_no }}
           </td>
           <td>{{ item.product_title }}</td>
-          <td>100*100*100</td>
+          <td>{{ item.size }}</td>
           <td>{{ item.finished_num }}</td>
           <td>{{ item.un_finished_quantity }}</td>
         </tr>
@@ -89,40 +89,45 @@
 </template>
 <script>
 export default {
-  data() {
+  data () {
     return {
 
       tableData: [],
       is_show: true,
-      is_use: false,
+      is_use: false
 
     }
   },
-  mounted() {
-    let data = {};
+  mounted () {
+    let data = {}
     if (localStorage.getItem('fyy_target')) {
-      data.target = JSON.parse(localStorage.getItem('fyy_target'));
+      data.target = JSON.parse(localStorage.getItem('fyy_target'))
     }
-    this.initData(data);
+    data = {
+      url: 'http://121.36.142.167:7774/jbl/api/module-data/production_orders_list/page',
+      post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"production_orders","developmentSystemId":null,"debugFlag":true},
+      header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Sign: e2938faaabcd8654dfb07a98bd84d3f1', 'Content-Type:application/json']
+    }
+    this.initData(data)
   },
   methods: {
-    initData(row) {
-      this.axios.post('/api/finishedOrderList', { ...row, process_id: [9] }).then(res => {
-        this.tableData = res.data.data ? res.data.data : [];
+    initData (row) {
+      this.axios.post('/api/testdwy', { ...row }).then(res => {
+        this.tableData = res.data.content ? res.data.content : []
         this.tableData.forEach(v => {
-          v.is_choose = false;
+          v.is_choose = false
         })
       })
     },
-    handelGoSure() {
-      if (this.tableData.filter(v => v.is_choose).length == 0) {
+    handelGoSure () {
+      if (this.tableData.filter(v => v.is_choose).length === 0) {
         return this.$Message.warning('请先选择数据!')
       }
-      localStorage.removeItem('fyy_target');
-      let id = this.tableData.map(v => v.id).toString();
+      localStorage.removeItem('fyy_target')
+      const id = this.tableData.filter(v => v.is_choose).map(v => v['dynamic_form_value_id']).toString()
       this.$router.push({ path: '/cms/Package/detailed', query: { id } })
     },
-    handleReturn() {
+    handleReturn () {
       localStorage.removeItem('fyy_target');
       this.$router.push('/cms/home');
     },
@@ -130,14 +135,14 @@ export default {
       item.is_choose = !item.is_choose;
       this.tableData.splice(index, 1, item);
     },
-    handleShow() {
+    handleShow () {
       this.is_show = !this.is_show;
       console.log(document.getElementsByClassName('header'))
       if (this.is_show) {
         document.getElementsByClassName('header')[0].style = 'height:7rem;overflow:hidden;transition:all .4s;'
         setTimeout(() => {
           document.getElementsByClassName('header')[0].style = 'overflow:none;'
-          this.is_use = false;
+          this.is_use = false
         }, 400)
       } else {
         this.is_use = true;
@@ -260,4 +265,4 @@ th {
   position: absolute;
   bottom: 4.8rem;
 }
-</style>
+</style>

+ 101 - 70
src/views/page/Package/detailed.vue

@@ -5,8 +5,8 @@
         <div class="add" @click="handleAdd(item, index)">+</div>
         <div class="delete" @click="handleDelete(index)">x</div>
         <div class="unit" style="display: flex">
-          <label style="width: 50%">销售订单号:</label>
-          <div style="width: 50%">{{ item.dispatch_no }}</div>
+          <label style="width: 50%">生产订单号:</label>
+          <div style="width: 50%;word-break: break-all">{{ item.product_no}}</div>
         </div>
         <div style="display: flex" class="unit">
           <label>产品名称:</label>
@@ -39,6 +39,7 @@
                 border-radius: 0.6rem;
                 background: #fff;
               "
+              @change="handleChooseTeam"
             >
               <template v-slot:first>
                 <b-form-select-option value="" disabled
@@ -50,23 +51,20 @@
         </div>
         <div class="unit">
           <label>人员:</label>
-          <b-form-select
-            v-model="item.employee_id"
+          <Select
+            v-model="formData.employee_id"
             :options="employeeList"
             style="
-              height: 1.4rem;
               width: 60%;
-              border: 0.1rem solid;
-              border-radius: 0.6rem;
               background: #fff;
             "
+            multiple
+            transfer
+            size="small"
+            :disabled="!formData.team_id"
           >
-            <template v-slot:first>
-              <b-form-select-option value="" disabled
-                >请选择人员</b-form-select-option
-              >
-            </template></b-form-select
-          >
+            <Option v-for="item in employeeList" :key="item.id" :label="item.text" :value="item.value"/>
+          </Select>
         </div>
         <div class="unit">
           <label>商标损耗:</label>
@@ -108,96 +106,125 @@
 </template>
 <script>
 export default {
-  data() {
+  data () {
     return {
       list: [],
-      email: "",
-      name: "",
-      food: null,
-      checked: [],
-      form: {},
+      formData: {},
       teamList: [],
       employeeList: [],
       numList: [
         { value: 1, text: 1 },
         { value: 2, text: 2 },
-        { value: 3, text: 3 },
+        { value: 3, text: 3 }
       ],
-      state: true,
+      state: true
     }
   },
-  created() {
-    this.axios.post('/api/finishedOrderDetailsList', { id: this.$route.query.id.split(',') }).then(res => {
-      this.list = res.data.list;
-      this.list.forEach(v => {
-        v.num = v.num ? v.num : ''
-      })
-    })
-    //获取班组
-    this.axios.post('/api/teamList').then(res => {
-      this.teamList = res.data.data;
+  created () {
+    // 获取班组
+    const data = {
+      url: 'http://121.36.142.167:7774/jbl/api/module-data/team_list/page',
+      post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"team","developmentSystemId":null,"debugFlag":true},
+      header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Sign: 88cb27fd67215452422c18f3ed71028e', 'Content-Type:application/json']
+    }
+    this.axios.post('/api/testdwy', { ...data }).then(res => {
+      this.teamList = res.data.content.filter(v => v.status)
       this.teamList.forEach(v => {
-        v.value = v.id;
-        v.text = v.title;
+        v.value = v.team_code
+        v.text = v.title
       })
     })
-    //获取人员
-    this.axios.post('/api/employeeList').then(res => {
-      this.employeeList = res.data.data;
-      this.employeeList.forEach(v => {
-        v.value = v.id;
-        v.text = v.emp_name
-      })
+  },
+  mounted () {
+    this.list = []
+    const id = this.$route.query.id.split(',')
+    id.forEach(v => {
+      const data = {
+        url: `http://121.36.142.167:7774/jbl/api/module-data/production_orders/production_orders/473693703256879104/${v}`,
+        header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Type:application/json']
+      }
+      this.initData(data)
     })
   },
   methods: {
-    handleReturn() {
-      this.$router.go(-1);
+    initData (row) {
+      this.axios.post('/api/testdwyget', { ...row }).then(res => {
+        this.list.push(...res.data.data['production_orders_dtl'])
+        this.formData = res.data.data['production_orders']
+        this.formData.employee_id = []
+        this.list.forEach(v => {
+          v.team_id = this.formData.team_id
+          v.break = [
+            { break_id: '', break_num: 0 }
+          ]
+        })
+      })
+    },
+    handleChooseTeam (e) {
+      if (e) {
+        this.formData.team_id = e
+        // 获取班组下的人员
+        const id = this.teamList.find(v => v.team_code === this.formData.team_id).dynamic_form_value_id
+        const data = {
+          url: `http://121.36.142.167:7774/jbl/api/module-data/team/team/472629516238663680/${id}`,
+          header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Type:application/json']
+        }
+        this.axios.post('/api/testdwyget', { ...data }).then(res => {
+          this.employeeList = res.data.data.employee
+          this.employeeList.forEach(v => {
+            v.value = v.team_code
+            v.text = v.team_code_show
+          })
+          this.formData.employee_id = []
+        })
+      } else {
+        this.formData.employee_id = []
+      }
+    },
+    handleReturn () {
+      this.$router.go(-1)
     },
-    handleDelete(index) {
-      if (this.list.length == 1) {
-        return
+    handleDelete (index) {
+      if (this.list.length === 1) {
+        return false
       } else {
-        this.list.splice(index, 1);
+        this.list.splice(index, 1)
       }
     },
-    handleAdd(item, index) {
+    handleAdd (item, index) {
       if (!item.quantity) {
-        return
+        return false
       } else {
-
-        let copy = JSON.parse(JSON.stringify(item));
-        copy.quantity = Math.floor(item.quantity / 2) + item.quantity % 2;
-        item.quantity = Math.floor(item.quantity / 2);
-        this.list.splice(index, 1, item);
-        this.list.splice(index + 1, 0, copy);
+        const copy = JSON.parse(JSON.stringify(item))
+        copy.quantity = Math.floor(item.quantity / 2) + item.quantity % 2
+        item.quantity = Math.floor(item.quantity / 2)
+        this.list.splice(index, 1, item)
+        this.list.splice(index + 1, 0, copy)
       }
-
     },
-    handleSure() {
-      let data = [];
+    handleSure () {
+      const data = []
       this.list.forEach(v => {
-        let obj = {};
-        obj.id = v.id;
-        obj.team_id = v.team_id,
-          obj.finished_id = v.employee_id,
-          obj.num = v.num ? v.num : '',
-          obj.quantity = v.quantity;
+        const obj = {}
+        obj.id = v.id
+        obj.team_id = v.team_id
+        obj.finished_id = v.employee_id
+        obj.num = v.num ? v.num : ''
+        obj.quantity = v.quantity
         data.push(obj)
-      });
+      })
       if (!this.state) {
-        return
+        return false
       } else {
-        this.state = false;
+        this.state = false
         this.axios.post('/api/mobileFinishedOrderAdd', { ...data }).then(res => {
-          if (res.code == 200) {
+          if (res.code === 200) {
             this.state = true
-            this.$Message.success(res.msg);
+            this.$Message.success(res.msg)
             this.handleReturn()
           }
         })
       }
-
     }
   }
 }
@@ -208,6 +235,7 @@ export default {
   overflow: auto;
   .item {
     width: 94%;
+    height: auto;
     position: relative;
     left: 3%;
     margin: 1.5rem 0;
@@ -263,4 +291,7 @@ export default {
   justify-content: space-between;
   align-items: center;
 }
-</style>
+/deep/ .ivu-select-dropdown-list{
+  padding: 0 !important;
+}
+</style>

+ 7 - 19
vue.config.js

@@ -14,25 +14,13 @@
 // //http://121.41.102.225:999 上线服务器
 // process.env.VUE_APP_BASE_URL = axios_default_ip;
 module.exports = {
-  publicPath: "./",
-  outputDir: "dist",
-  assetsDir: "static",
-  indexPath: "index.html",
-  productionSourceMap: process.env.NODE_ENV === "development",
+  publicPath: './',
+  outputDir: 'dist',
+  assetsDir: 'static',
+  indexPath: 'index.html',
+  productionSourceMap: process.env.NODE_ENV === 'development',
   devServer: {
     // https: true,
-    proxy: {
-      "/api": {
-        target: "http://121.36.142.167:7774",//需要代理的地址
-        changeOrigin: true,
-        //重点在下面,下面这个把我的403问题解决掉了
-        onProxyReq: (proxyReq, req, res) => {
-          // proxyReq.removeHeader('referer')  //移除请求头
-          // proxyReq.removeHeader('origin') //移除请求头
-          proxyReq.setHeader('host', '121.36.142.167:7774') //添加请求头
-        }
-      }
-    }
   },
-  lintOnSave: false, //禁用eslint  便于开发
-};
+  lintOnSave: false // 禁用eslint  便于开发
+}