Răsfoiți Sursa

优化完成修改

LAPTOP-16IUEB3P\Lenovo 2 ani în urmă
părinte
comite
d04d5898b5

+ 4 - 4
src/views/materialPlan/detail.vue

@@ -25,18 +25,18 @@
   import { getPlanInfoById } from '@/api/materialPlan/index';
   export default {
     components: { plan, material },
-    data () {
+    data() {
       return {
         activeName: 'plan',
         infoData: {}
       };
     },
-    created () {
+    created() {
       this.getDetail();
     },
     methods: {
-      async getDetail () {
-        const data = await getPlanInfoById(this.$route.query.id);
+      async getDetail() {
+        const data = await getPlanInfoById(this.$route.params.id);
 
         this.infoData = data;
       }

+ 11 - 14
src/views/materialPlan/index.vue

@@ -90,7 +90,7 @@
       materialPlanSearch
     },
 
-    data () {
+    data() {
       return {
         activeName: 'first',
 
@@ -117,7 +117,7 @@
     },
     computed: {
       // 表格列配置
-      columns () {
+      columns() {
         return [
           {
             columnKey: 'index',
@@ -250,7 +250,7 @@
       }
     },
     methods: {
-      statusFormatter (status) {
+      statusFormatter(status) {
         const obj = this.statusOpt[this.activeName].find(
           (i) => i.value == status
         );
@@ -258,17 +258,17 @@
         return obj && obj.label;
       },
       /* 表格数据源 */
-      datasource ({ page, limit, where, order }) {
+      datasource({ page, limit, where, order }) {
         return getList({
           pageNum: page,
           size: limit,
           ...where
         });
       },
-      handleEdit (type, row) {
+      handleEdit(type, row) {
         this.$refs.planEditDialogRef.open(type, row);
       },
-      handleDel ({ id }) {
+      handleDel({ id }) {
         this.$confirm('确认删除当前数据!', '提示').then(async () => {
           await del([id]);
           this.$message.success('删除成功!');
@@ -276,7 +276,7 @@
         });
       },
       // 发布工单
-      handleOrderPublish (type, row) {
+      handleOrderPublish(type, row) {
         this.$router.push({
           path: '/materialPlan/workOrderPublish',
           query: {
@@ -285,24 +285,21 @@
           }
         });
       },
-      handleTabChange () {
+      handleTabChange() {
         this.$refs.searchRef.reset();
       },
 
       /* 刷新表格 */
-      reload (where = {}) {
+      reload(where = {}) {
         where.statusList = this.statusOpt[this.activeName][0].value.split(',');
         this.$nextTick(() => {
           this.$refs.table.reload({ page: 1, where });
         });
       },
 
-      goDetail ({ id }) {
+      goDetail({ id }) {
         this.$router.push({
-          path: '/materialPlan/detail',
-          query: {
-            id
-          }
+          path: '/materialPlan/detail/' + id
         });
       }
     }

+ 4 - 4
src/views/productionPlan/detail.vue

@@ -31,18 +31,18 @@
   import { getProductPlanDetail } from '@/api/productionPlan/index';
   export default {
     components: { plan, material },
-    data () {
+    data() {
       return {
         activeName: 'plan',
         infoData: {}
       };
     },
-    created () {
+    created() {
       this.getDetail();
     },
     methods: {
-      async getDetail () {
-        const data = await getProductPlanDetail(this.$route.query.id);
+      async getDetail() {
+        const data = await getProductPlanDetail(this.$route.params.id);
 
         this.infoData = data;
       }

+ 11 - 14
src/views/productionPlan/index.vue

@@ -82,7 +82,7 @@
     components: {
       productionPlanSearch
     },
-    data () {
+    data() {
       return {
         activeName: 'first',
 
@@ -115,7 +115,7 @@
     },
     computed: {
       // 表格列配置
-      columns () {
+      columns() {
         const opt = {
           first: [
             // {
@@ -296,7 +296,7 @@
       }
     },
     methods: {
-      statusFormatter (status) {
+      statusFormatter(status) {
         const obj = this.statusOpt[this.activeName].find(
           (i) => i.value == status
         );
@@ -304,7 +304,7 @@
         return obj && obj.label;
       },
       /* 表格数据源 */
-      datasource ({ page, limit, where }) {
+      datasource({ page, limit, where }) {
         return getList({
           pageNum: page,
           size: limit,
@@ -312,7 +312,7 @@
         });
       },
       // 发布工单
-      handleOrderPublish (type, row) {
+      handleOrderPublish(type, row) {
         this.$router.push({
           path: '/productionPlan/workOrderPublish',
           query: {
@@ -322,7 +322,7 @@
         });
       },
       // 修改计划
-      planEdit ({ id }) {
+      planEdit({ id }) {
         this.$router.push({
           path: '/saleOrder/salesToProduction',
           query: {
@@ -331,26 +331,23 @@
           }
         });
       },
-      handleTabChange () {
+      handleTabChange() {
         this.$refs.searchRef.reset();
       },
 
       /* 刷新表格 */
-      reload (where) {
+      reload(where) {
         this.$nextTick(() => {
           this.$refs.table.reload({ page: 1, where });
         });
       },
 
-      goDetail (row) {
+      goDetail({ id }) {
         this.$router.push({
-          path: '/productionPlan/detail',
-          query: {
-            id: row.id
-          }
+          path: '/productionPlan/detail/' + id
         });
       },
-      handleDelete ({ id }) {
+      handleDelete({ id }) {
         this.$confirm('确定删除当前数据?', '提示').then(async () => {
           await del(id);
           this.$message.success('删除成功!');

+ 6 - 4
src/views/saleOrder/salesToProduction.vue

@@ -24,7 +24,7 @@
                 dictName="订单计划类型"
                 clearable
                 v-model="form.planType"
-				disabled
+                disabled
               >
               </DictSelection>
             </el-form-item>
@@ -393,9 +393,9 @@
             this.form.planType = 2;
           } else if (this.form.salesOrders.every((itm) => itm.orderType == 1)) {
             this.form.planType = 1;
-          }else{
-			 this.form.planType = 3; 
-		  }
+          } else {
+            this.form.planType = 3;
+          }
         });
       },
 
@@ -409,7 +409,9 @@
         });
       },
       cancel () {
+        const key = getRouteTabKey();
         this.$router.go(-1);
+        removePageTab({ key });
       },
       toSubmit () {
         this.$refs.form.validate((valid) => {

+ 4 - 4
vue.config.js

@@ -3,7 +3,7 @@ const { transformElementScss } = require('ele-admin/lib/utils/dynamic-theme');
 const path = require('path');
 const { name } = require('./package.json');
 
-function resolve (dir) {
+function resolve(dir) {
   return path.join(__dirname, dir);
 }
 
@@ -31,12 +31,12 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        target: 'http://192.168.3.35:8080', // kang杨威
+        // target: 'http://192.168.3.35:8080', // kang杨威
         // target: 'http://192.168.3.38:8080', // 陈潇
         // target: 'http://192.168.3.25:8080', // 黄峥嵘
         // target: 'http://192.168.3.41:8080', // 何江鹏
         // target: 'http://192.168.3.33:8080', // 谢一平
-        // target: 'http://192.168.3.51:18086', // 测试环境
+        target: 'http://192.168.3.51:18086', // 测试环境
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
@@ -48,7 +48,7 @@ module.exports = {
       'Access-Control-Allow-Origin': '*'
     }
   },
-  chainWebpack (config) {
+  chainWebpack(config) {
     config.plugins.delete('prefetch');
     // set svg-sprite-loader
     // config.module.rule('svg').exclude.add(resolve('./src/icons')).end();