quwangxin před 2 roky
rodič
revize
62d3c7d30e
2 změnil soubory, kde provedl 39 přidání a 40 odebrání
  1. 19 19
      src/views/produceOrder/detail.vue
  2. 20 21
      src/views/produceOrder/index.vue

+ 19 - 19
src/views/produceOrder/detail.vue

@@ -249,14 +249,14 @@
     writeOffWork
   } from '@/api/produceOrder/index.js';
   export default {
-	mixins: [dictMixins],
+    mixins: [dictMixins],
     components: {
       OrderPrint,
       otherMission,
       progressBox,
       bomList
     },
-    data () {
+    data() {
       return {
         infoData: {},
         descriptionsShow: true,
@@ -1026,9 +1026,9 @@
               prop: 'storageCode',
               minWidth: 100,
               align: 'center',
-			  formatter: (_row, _column, cellValue) => {
-			    return this.getDictValue('仓库', _row.storageCode);
-			  }
+              formatter: (_row, _column, cellValue) => {
+                return this.getDictValue('仓库', _row.storageCode);
+              }
             },
             {
               label: '操作',
@@ -1059,17 +1059,17 @@
         }
       };
     },
-    created () {
-      this.workOrderId = this.$route.query.id;
+    created() {
+      this.workOrderId = this.$route.params.id;
       this.getInfo(this.workOrderId);
-	  this.requestDict('仓库');
+      this.requestDict('仓库');
     },
     methods: {
-      handlePrint () {
+      handlePrint() {
         this.$refs.orderPrintRef.open();
       },
 
-      handleTabClick (tab) {
+      handleTabClick(tab) {
         if (this.chooseIndex != tab.index) {
           this.chooseIndex = Number(tab.index);
           const chooseItem = this.tabList[this.chooseIndex];
@@ -1084,7 +1084,7 @@
           this.setData();
         }
       },
-      setData () {
+      setData() {
         this.request.completeNum = this.tabList[this.chooseIndex].number;
         if (this.chooseIndex == this.tabList.length - 1) {
           this.request.isLast = 1;
@@ -1094,7 +1094,7 @@
             this.tabList[this.chooseIndex + 1].number;
         }
       },
-      async datasource ({ page, limit, where }) {
+      async datasource({ page, limit, where }) {
         const res = await reportPage({ ...where, pageNum: page, size: limit });
         if (typeof res.list == 'string') {
           res.list = [];
@@ -1102,12 +1102,12 @@
         return res;
       },
       /* 刷新表格 */
-      reload (where) {
+      reload(where) {
         this.$nextTick(() =>
           this.$refs.table.reload({ page: 1, limit: 10, where })
         );
       },
-      async getInfo (id) {
+      async getInfo(id) {
         const res = await getInfoById(id);
         this.infoData = res;
         if (typeof res.taskTypeProcessDiagrams == 'string') {
@@ -1124,19 +1124,19 @@
         this.getReportCount();
         this.setData();
       },
-      async getReportCount () {
+      async getReportCount() {
         const res = await reportCount({
           taskCode: this.taskCode,
           workOrderId: this.workOrderId
         });
         this.countMsg = res;
       },
-      openOther () {
+      openOther() {
         this.$refs.otherMissionRef.open();
       },
 
       // 冲销
-      writeOff (row) {
+      writeOff(row) {
         const h = this.$createElement;
         this.$confirm('', {
           message: h('div', null, [
@@ -1213,11 +1213,11 @@
           .catch(() => {});
       },
 
-      check (row) {
+      check(row) {
         this.$refs.bomListRef.open(row);
       },
 
-      async refreshData () {
+      async refreshData() {
         const res = await getInfoById(this.workOrderId);
         this.infoData = res;
         if (typeof res.taskTypeProcessDiagrams == 'string') {

+ 20 - 21
src/views/produceOrder/index.vue

@@ -100,7 +100,7 @@
   import createDialog from './components/createDialog.vue';
   import unpackDialog from './components/unpackDialog.vue';
   import pickingDialog from './components/pickingDialog.vue';
-	import { positiveIntegerReg } from 'ele-admin';
+  import { positiveIntegerReg } from 'ele-admin';
   export default {
     components: {
       produceOrderSearch,
@@ -108,7 +108,7 @@
       createDialog,
       unpackDialog
     },
-    data () {
+    data() {
       return {
         activeName: 'first',
 
@@ -137,7 +137,7 @@
     },
     computed: {
       // 表格列配置
-      columns () {
+      columns() {
         const opt = {
           first: [
             // {
@@ -305,16 +305,16 @@
         ];
       }
     },
-		// created(){
-		// 	 console.log('positiveIntegerReg',positiveIntegerReg)
-		// },
+    // created(){
+    // 	 console.log('positiveIntegerReg',positiveIntegerReg)
+    // },
     methods: {
-      handlePicking () {
+      handlePicking() {
         this.$router.push({
           path: '/produceOrder/picking'
         });
       },
-      statusFormatter (status) {
+      statusFormatter(status) {
         const obj = this.statusOpt[this.activeName].find(
           (i) => i.value == status
         );
@@ -322,21 +322,21 @@
         return obj && obj.label;
       },
       /* 表格数据源 */
-      datasource ({ page, limit, where }) {
+      datasource({ page, limit, where }) {
         return getPage({
           pageNum: page,
           size: limit,
           ...where
         });
       },
-      createSuccess () {
+      createSuccess() {
         this.reload();
       },
-      handleCreate () {
+      handleCreate() {
         this.$refs.createRef.open(0);
       },
       // 发布工单
-      handleOrderPublish (type, row) {
+      handleOrderPublish(type, row) {
         this.$router.push({
           path: '/produceOrder/report',
           query: {
@@ -346,7 +346,7 @@
         });
       },
       // 完结与批量完结
-      toEnd (row) {
+      toEnd(row) {
         if (row) {
           this.$confirm(`是否要完结工单【${row.code}】?`, '提醒', {
             confirmButtonText: '确认',
@@ -396,7 +396,7 @@
       },
 
       // 取消完结
-      toCancel (row) {
+      toCancel(row) {
         cancelCompletion([row.id]).then((res) => {
           this.$message.success('成功');
           this.reload();
@@ -404,15 +404,15 @@
       },
 
       // 拆分
-      toUnpack (row) {
+      toUnpack(row) {
         this.$refs.unpackRef.open(row);
       },
-      handleTabChange () {
+      handleTabChange() {
         this.$refs.searchRef.reset();
       },
 
       /* 刷新表格 */
-      reload (where = {}) {
+      reload(where = {}) {
         this.$nextTick(() => {
           where.statusList = (
             where.status || this.statusOpt[this.activeName][0].value
@@ -421,16 +421,15 @@
         });
       },
 
-      goDetail (row) {
+      goDetail(row) {
         this.$router.push({
-          path: '/produceOrder/detail',
+          path: '/produceOrder/detail/' + row.id,
           query: {
-            id: row.id,
             produceVersionId: row.produceVersionId
           }
         });
       },
-      handleDelete ({ id }) {
+      handleDelete({ id }) {
         this.$confirm('确定删除当前数据?', '提示').then(async () => {
           await del(id);
           this.$message.success('删除成功!');