Przeglądaj źródła

Merge remote-tracking branch 'origin/master' into master

姚云青 3 lat temu
rodzic
commit
2d79dd74ab

+ 114 - 106
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/components/checkCuttingTools/checkDetailCuttingTools.vue

@@ -1,106 +1,114 @@
-<template>
-  <div class="app-container">
-		<!-- 列表数据 -->
-    <el-table
-      :key="tableKey"
-      ref="table"
-      v-loading="loading"
-      :data="tableData"
-      border
-      fit
-      row-key="id"
-      style="width: 100%;"
-    >
-      <!-- 零件 -->
-      <el-table-column prop="name" :label='$t("runCenter.table.checkCuttingTool.partNo")' :show-overflow-tooltip="true"></el-table-column>
-      <!-- 工序 -->
-      <el-table-column prop="produceNo" :label='$t("runCenter.table.checkCuttingTool.procedureNo")' :show-overflow-tooltip="true"></el-table-column>
-      <!-- 可生产设备 -->
-      <el-table-column prop="resourceName" :label='$t("runCenter.table.checkCuttingTool.machine")' :show-overflow-tooltip="true"></el-table-column>
-      <!-- 刀具名称 -->
-      <el-table-column prop="needCuttingTools" :label='$t("runCenter.table.checkCuttingTool.cuttingToolName")' :show-overflow-tooltip="true"></el-table-column>
-      <!-- 检测结果 -->
-      <el-table-column prop="checkResult" :label='$t("runCenter.table.checkCuttingTool.checkResult")' :show-overflow-tooltip="true"></el-table-column>
-      <!-- 操作 -->
-      <el-table-column
-        :label="$t('table.operation')"
-        fixed="right"
-        align="center"
-        column-key="operation"
-      >
-        <template slot-scope="{ row }">
-          <a @click="applyCuttingTool(row)" style="color: #2db7f5">{{ row.checkResult === '不足' ? (row.applyId == null ? "申请装刀" : '已申请') : ''}} </a>
-        </template>
-      </el-table-column>
-    </el-table>
-  </div>
-</template>
-
-<script>
-	// 【订单计划】-API
-	import planMgrApi from "@/api/runManageCenter/planMgr"
-  // 【刀具安装申请】-API
-  import cuttingToolApplyMgrApi from "@/api/prepareProductMgr/CuttingToolApply"
-	export default {
-	  name: "checkDetailCuttingTool",
-	  directives: {},
-	  components: {},
-    props: {
-      detailPlanId: {
-        type:String,
-        default:''
-      }
-    },
-	  data () {
-	    return {
-	      tableKey: 0,
-	      loading: false,
-        tableData:[]
-	    }
-	  },
-	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
-	  created() {
-	  	// 加载列表数据
-	  	this.fetch()
-		},
-	  computed: {
-	  },
-	  mounted () {
-	  },
-	  methods: {
-	    // 查询计划刀具可用性
-	    fetch () {
-	      this.loading = true
-        planMgrApi.checkPlanDetailCuttingTools({ "planId": this.detailPlanId }).then(response => {
-	        const res = response.data
-	        if (res.isSuccess) {
-	          this.tableData = res.data
-	        }
-	      }).finally(() => this.loading = false)
-	    },
-
-      applyCuttingTool(data){
-	      // 申请装刀
-        if(data.checkResult === '不足' ){
-          if(data.applyId === null ) {
-            this.loading = true
-            data.cuttingToolName = data.needCuttingTools
-            cuttingToolApplyMgrApi.save(data).then(response => {
-              const res = response.data
-              if (res.isSuccess) {
-                this.$message({
-                    message: this.$t('tips.createSuccess'),
-                    type: 'success'
-                })
-              }
-            }).finally(() => this.loading = false)
-            fetch()
-          }else{ // 已装刀跳转到装刀申请页面
-            this.$router.push({path:'/prepareProductMgr/cuttingToolApplyMgr',query: data});
-          }
-        }
-      }
-	  }
-	}
-</script>
-<style lang="scss" scoped></style>
+<template>
+  <div class="app-container">
+		<!-- 列表数据 -->
+    <el-table
+      :key="tableKey"
+      ref="table"
+      v-loading="loading"
+      :data="tableData"
+      border
+      fit
+      row-key="id"
+      style="width: 100%;"
+    >
+      <!-- 零件 -->
+      <el-table-column prop="name" :label='$t("runCenter.table.checkCuttingTool.partNo")' :show-overflow-tooltip="true"></el-table-column>
+      <!-- 工序 -->
+      <el-table-column prop="produceNo" :label='$t("runCenter.table.checkCuttingTool.procedureNo")' :show-overflow-tooltip="true"></el-table-column>
+      <!-- 可生产设备 -->
+      <el-table-column prop="resourceName" :label='$t("runCenter.table.checkCuttingTool.machine")' :show-overflow-tooltip="true"></el-table-column>
+      <!-- 刀具名称 -->
+      <el-table-column prop="needCuttingTools" :label='$t("runCenter.table.checkCuttingTool.cuttingToolName")' :show-overflow-tooltip="true"></el-table-column>
+      <!-- 检测结果 -->
+      <el-table-column prop="checkResult" :label='$t("runCenter.table.checkCuttingTool.checkResult")' :show-overflow-tooltip="true"></el-table-column>
+      <!-- 操作 -->
+      <el-table-column
+        :label="$t('table.operation')"
+        fixed="right"
+        align="center"
+        column-key="operation"
+      >
+        <template slot-scope="{ row }">
+          <a @click="applyCuttingTool(row)" style="color: #2db7f5">{{ row.checkResult === '不足' ? (row.applyId == null ? "申请装刀" : '已申请') : ''}} </a>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+	// 【订单计划】-API
+	import planMgrApi from "@/api/runManageCenter/planMgr"
+  // 【刀具安装申请】-API
+  import cuttingToolApplyMgrApi from "@/api/prepareProductMgr/CuttingToolApply"
+	export default {
+	  name: "checkDetailCuttingTool",
+	  directives: {},
+	  components: {},
+    props: {
+      detailPlanId: {
+        type:String,
+        default:''
+      }
+    },
+	  data () {
+	    return {
+	      tableKey: 0,
+	      loading: false,
+        tableData:[]
+	    }
+	  },
+	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+	  created() {
+	  	// 加载列表数据
+	  	this.fetch()
+		},
+    watch: {
+      'detailPlanId': {
+        handler(val, oldVal) {
+          // 加载列表数据
+          this.fetch()
+        }
+      }
+    },
+	  computed: {
+	  },
+	  mounted () {
+	  },
+	  methods: {
+	    // 查询计划刀具可用性
+	    fetch () {
+	      this.loading = true
+        planMgrApi.checkPlanDetailCuttingTools({ "planId": this.detailPlanId }).then(response => {
+	        const res = response.data
+	        if (res.isSuccess) {
+	          this.tableData = res.data
+	        }
+	      }).finally(() => this.loading = false)
+	    },
+
+      applyCuttingTool(data){
+	      // 申请装刀
+        if(data.checkResult === '不足' ){
+          if(data.applyId === null ) {
+            this.loading = true
+            data.cuttingToolName = data.needCuttingTools
+            cuttingToolApplyMgrApi.save(data).then(response => {
+              const res = response.data
+              if (res.isSuccess) {
+                this.$message({
+                    message: this.$t('tips.createSuccess'),
+                    type: 'success'
+                })
+              }
+            }).finally(() => this.loading = false)
+            fetch()
+          }else{ // 已装刀跳转到装刀申请页面
+            this.$router.push({path:'/prepareProductMgr/cuttingToolApplyMgr',query: data});
+          }
+        }
+      }
+	  }
+	}
+</script>
+<style lang="scss" scoped></style>

+ 8 - 0
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/components/checkCuttingTools/index.vue

@@ -72,6 +72,14 @@
 	  	// 加载列表数据
 	  	this.fetch()
 		},
+    watch: {
+      'planId': {
+        handler(val, oldVal) {
+          // 加载列表数据
+          this.fetch()
+        }
+      }
+    },
 	  computed: {
 	  },
 	  mounted () {