quwangxin vor 2 Jahren
Ursprung
Commit
6794843965

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

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

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

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

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

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

+ 21 - 19
src/views/saleOrder/salesToProduction.vue

@@ -332,7 +332,7 @@
       ProductionVersion,
       ProductionVersion,
       PlanSubmit
       PlanSubmit
     },
     },
-    data () {
+    data() {
       return {
       return {
         form: {
         form: {
           planType: 1,
           planType: 1,
@@ -354,11 +354,11 @@
     },
     },
     computed: {
     computed: {
       // 是否开启响应式布局
       // 是否开启响应式布局
-      styleResponsive () {
+      styleResponsive() {
         return this.$store.state.theme.styleResponsive;
         return this.$store.state.theme.styleResponsive;
       }
       }
     },
     },
-    created () {
+    created() {
       this.requestDict('按单按库');
       this.requestDict('按单按库');
       this.requestDict('订单类型');
       this.requestDict('订单类型');
       this.requestDict('交付要求');
       this.requestDict('交付要求');
@@ -370,14 +370,14 @@
       }
       }
     },
     },
     methods: {
     methods: {
-      async getPlanInfo (id) {
+      async getPlanInfo(id) {
         const data = await getUpdateInfoById(id);
         const data = await getUpdateInfoById(id);
         this.form = data;
         this.form = data;
         if (data.productCode) {
         if (data.productCode) {
           this.getVersionData();
           this.getVersionData();
         }
         }
       },
       },
-      getSaleInfo (params) {
+      getSaleInfo(params) {
         productionToPlan(params).then((res) => {
         productionToPlan(params).then((res) => {
           this.form = deepClone(res);
           this.form = deepClone(res);
           this.form.salesOrders.map((item, index) => {
           this.form.salesOrders.map((item, index) => {
@@ -396,7 +396,7 @@
         });
         });
       },
       },
 
 
-      getVersionData () {
+      getVersionData() {
         getProductVersion(this.form.productCode).then((res) => {
         getProductVersion(this.form.productCode).then((res) => {
           res.map((item) => {
           res.map((item) => {
             if (item.produceVersionId == this.form.produceVersionId) {
             if (item.produceVersionId == this.form.produceVersionId) {
@@ -405,10 +405,12 @@
           });
           });
         });
         });
       },
       },
-      cancel () {
+      cancel() {
+        const key = getRouteTabKey();
         this.$router.go(-1);
         this.$router.go(-1);
+        removePageTab({ key });
       },
       },
-      toSubmit () {
+      toSubmit() {
         this.$refs.form.validate((valid) => {
         this.$refs.form.validate((valid) => {
           if (valid) {
           if (valid) {
             this.mapList();
             this.mapList();
@@ -417,7 +419,7 @@
         });
         });
       },
       },
       // 对比日期,计算要求成型重量
       // 对比日期,计算要求成型重量
-      mapList () {
+      mapList() {
         var requiredFormingWeight = 0;
         var requiredFormingWeight = 0;
         var requiredFormingNum = 0;
         var requiredFormingNum = 0;
         var productNum = 0;
         var productNum = 0;
@@ -451,7 +453,7 @@
         this.form.reqMoldTime = latestData.reqMoldTime;
         this.form.reqMoldTime = latestData.reqMoldTime;
       },
       },
 
 
-      sortTop (row) {
+      sortTop(row) {
         if (row.priority <= 1) {
         if (row.priority <= 1) {
           return;
           return;
         }
         }
@@ -464,7 +466,7 @@
           return a.priority - b.priority;
           return a.priority - b.priority;
         });
         });
       },
       },
-      sortBottom (row) {
+      sortBottom(row) {
         if (row.priority >= this.form.salesOrders.length) {
         if (row.priority >= this.form.salesOrders.length) {
           return;
           return;
         }
         }
@@ -477,22 +479,22 @@
           return a.priority - b.priority;
           return a.priority - b.priority;
         });
         });
       },
       },
-      againSort () {
+      againSort() {
         this.form.salesOrders.forEach((n, index) => {
         this.form.salesOrders.forEach((n, index) => {
           n.priority = index + 1;
           n.priority = index + 1;
         });
         });
       },
       },
       // 删除产品
       // 删除产品
-      handleDeleteItem (index) {
+      handleDeleteItem(index) {
         this.form.salesOrders.splice(index, 1);
         this.form.salesOrders.splice(index, 1);
       },
       },
-      addEquipment () {
+      addEquipment() {
         this.$refs.additionalRefs.open();
         this.$refs.additionalRefs.open();
       },
       },
-      openVersion () {
+      openVersion() {
         this.$refs.versionRefs.open();
         this.$refs.versionRefs.open();
       },
       },
-      confirmVersion (data) {
+      confirmVersion(data) {
         this.$set(this.form, 'produceVersionName', data.produceVersionName);
         this.$set(this.form, 'produceVersionName', data.produceVersionName);
         this.$set(this.form, 'produceVersionId', data.produceVersionId);
         this.$set(this.form, 'produceVersionId', data.produceVersionId);
         this.$set(
         this.$set(
@@ -503,7 +505,7 @@
         this.lineNamesList = Array.from(new Set(data.lineNames || []));
         this.lineNamesList = Array.from(new Set(data.lineNames || []));
       },
       },
 
 
-      confirmChoose (list) {
+      confirmChoose(list) {
         // 取出在弹窗中选中并且不在表格中的数据
         // 取出在弹窗中选中并且不在表格中的数据
         const result = list.filter(
         const result = list.filter(
           (i) => this.form.salesOrders.findIndex((p) => p.id === i.id) === -1
           (i) => this.form.salesOrders.findIndex((p) => p.id === i.id) === -1
@@ -536,7 +538,7 @@
         );
         );
         this.changeData();
         this.changeData();
       },
       },
-      changeData () {
+      changeData() {
         var planProductNum = 0;
         var planProductNum = 0;
         var productWeight = 0;
         var productWeight = 0;
         this.form.salesOrders.map((item, index) => {
         this.form.salesOrders.map((item, index) => {
@@ -549,7 +551,7 @@
         this.$set(this.form, 'sumOrderWeight', productWeight.toFixed(2));
         this.$set(this.form, 'sumOrderWeight', productWeight.toFixed(2));
       },
       },
 
 
-      publishData (type) {
+      publishData(type) {
         let params = deepClone(this.form);
         let params = deepClone(this.form);
         params.categoryId = params.salesOrders[0]?.categoryId;
         params.categoryId = params.salesOrders[0]?.categoryId;
 
 

+ 4 - 4
vue.config.js

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