Procházet zdrojové kódy

工艺模板下载

yejian016332 před 3 roky
rodič
revize
ab2de92e86

+ 294 - 273
imcs-ui/src/api/runManageCenter/planMgr.js

@@ -1,273 +1,294 @@
-/*********************** 【计划管理】API ********************/
-import axiosApi from '../AxiosApi.js'
-
-const apiList = {
-	getList: {
-	    method: 'POST',
-	    url: `/authority/plan/all`
-	},
-  page: {
-    method: 'POST',
-    url: `/authority/plan/page`
-  },
-  pageList: {
-    method: 'POST',
-    url: `/authority/plan/pageList`
-  },
-  update: {
-    method: 'POST',
-    url: `/authority/plan/update`
-  },
-  save: {
-    method: 'POST',
-    url: `/authority/plan/save`
-  },
-  // 一键排产 
-  oneTouchSchedule: {  
-    method: 'POST',
-    url: `/authority/plan/oneTouchSchedule`
-  },
-  // 高级排产 
-  advSchedule: {  
-    method: 'POST',
-    url: `/authority/plan/advSchedule`
-  },
-  // 一键生产 
-  confirmSchedule: {  
-    method: 'POST',
-    url: `/authority/plan/confirmSchedule`
-  },
-  // 审核状态
-  updateStatus: {   
-    method: 'POST',
-    url: `/authority/plan/updateStatus`
-  },
-  remove: {
-    method: 'DELETE',
-    url: `/authority/plan`
-  },
-  delete: {
-    method: 'POST',
-    url: `/authority/plan/delete`
-  },
-  // 计划【更多-启用】
-  planEnable: {
-    method: 'POST',
-    url: `/authority/plan/planEnable`
-  },
-  // 计划【更多-暂停】
-  planSuspend: {
-    method: 'POST',
-    url: `/authority/plan/planSuspend`
-  },
-  // 计划【更多-优先级】
-  updateData: {
-    method: 'POST',
-    url: `/authority/plan/updateData`
-  },
-  // 计划【更多-生产单元】
-  setProductionUnit: {
-    method: 'POST',
-    url: `/authority/planZone/setProductionUnit`
-  },
-  // 计划【修改数量】
-  updateNumber: {
-    method: 'POST',
-    url: `/authority/plan/updateNumber`
-  },
-  // 计划【更多-删除】
-  deletePlan: {  
-    method: 'POST',
-    url: `/authority/plan/deletePlan`
-  },
-  // 计划【状态数量统计】
-  getPlanStatusCount: {  
-    method: 'POST',
-    url: `/authority/plan/getPlanStatusCount`
-  },
-  get: {
-    method: 'POST',
-    url: `/authority/plan/get`
-  },
-  list: {
-    method: 'POST',
-    url: `/authority/plan/query`
-  },
-  preview: {
-    method: 'POST',
-    url: `/authority/plan/preview`
-  },
-  export: {
-    method: 'POST',
-    url: `/authority/plan/export`
-  },
-  import: {
-    method: 'POST',
-    url: `/authority/plan/import`
-  }
-}
-
-export default {
-	getList (data) {
-    return axiosApi({
-      ...apiList.getList,
-      data
-    })
-  },
-  page (data) {
-    return axiosApi({
-      ...apiList.page,
-      data
-    })
-  },
-  pageList (data) {
-    return axiosApi({
-      ...apiList.pageList,
-      data
-    })
-  },
-  save (data) {
-    return axiosApi({
-      ...apiList.save,
-      data
-    })
-  },
-  // 一键排产
-  oneTouchSchedule (data) {
-    return axiosApi({
-      ...apiList.oneTouchSchedule,
-      data
-    })
-  },
-  // 高级排产
-  advSchedule (data) {
-    return axiosApi({
-      ...apiList.advSchedule,
-      data
-    })
-  },
-  // 一键生产
-  confirmSchedule (data) {
-    return axiosApi({
-      ...apiList.confirmSchedule,
-      data
-    })
-  },
-  update (data) {
-    return axiosApi({
-      ...apiList.update,
-      data
-    })
-  },
-  updateStatus (data) {
-    return axiosApi({
-      ...apiList.updateStatus,
-      data
-    })
-  },
-  remove (data) {
-    return axiosApi({
-      ...apiList.remove,
-      data
-    })
-  },
-  delete (data) {
-    return axiosApi({
-      ...apiList.delete,
-      data
-    })
-  },
-  // 计划【更多-启用】
-  planEnable (data) {
-    return axiosApi({
-      ...apiList.planEnable,
-      data
-    })
-  },
-  // 计划【更多-暂停】
-  planSuspend (data) {
-    return axiosApi({
-      ...apiList.planSuspend,
-      data
-    })
-  },
-  // 计划【优先级 】
-  updateData (data) {
-    return axiosApi({
-      ...apiList.updateData,
-      data
-    })
-  },
-  // 计划【生产单元】
-  setProductionUnit (data) {
-    return axiosApi({
-      ...apiList.setProductionUnit,
-      data
-    })
-  },
-  // 计划【修改数量】
-  updateNumber (data) {
-    return axiosApi({
-      ...apiList.updateNumber,
-      data
-    })
-  },
-  // 计划【更多-删除】
-  deletePlan (data) {
-    return axiosApi({
-      ...apiList.deletePlan,
-      data
-    })
-  },
-  // 【计划状态数量统计】
-  getPlanStatusCount (data) {
-    return axiosApi({
-      ...apiList.getPlanStatusCount,
-      data
-    })
-  },
-  get (data) {
-    return axiosApi({
-      ...apiList.get,
-      data
-    })
-  },
-  list (data) {
-    return axiosApi({
-      ...apiList.list,
-      data
-    })
-  },
-  check (code) {
-    return axiosApi({
-      method: 'GET',
-      url: `/authority/plan/check/${code}`
-    })
-  },
-  checkField (data) {
-    return axiosApi({
-      method: 'POST',
-      url: `/authority/plan/check`,
-      data
-    })
-  },
-  preview (data) {
-    return axiosApi({
-      ...apiList.preview,
-      data
-    })
-  },
-  export (data) {
-    return axiosApi({
-      ...apiList.export,
-      responseType: "blob",
-      data
-    })
-  },
-  import (data) {
-    return axiosApi({
-      ...apiList.import,
-      data
-    })
-  }
-}
+/*********************** 【计划管理】API ********************/
+import axiosApi from '../AxiosApi.js'
+
+const apiList = {
+	getList: {
+	    method: 'POST',
+	    url: `/authority/plan/all`
+	},
+  getFinishPlanList: {
+    method: 'POST',
+    url: `/authority/plan/getFinishPlanList`
+  },
+  page: {
+    method: 'POST',
+    url: `/authority/plan/page`
+  },
+  pageList: {
+    method: 'POST',
+    url: `/authority/plan/pageList`
+  },
+  update: {
+    method: 'POST',
+    url: `/authority/plan/update`
+  },
+  save: {
+    method: 'POST',
+    url: `/authority/plan/save`
+  },
+  // 一键排产
+  oneTouchSchedule: {
+    method: 'POST',
+    url: `/authority/plan/oneTouchSchedule`
+  },
+  // 高级排产
+  advSchedule: {
+    method: 'POST',
+    url: `/authority/plan/advSchedule`
+  },
+  // 一键生产
+  confirmSchedule: {
+    method: 'POST',
+    url: `/authority/plan/confirmSchedule`
+  },
+  // 审核状态
+  updateStatus: {
+    method: 'POST',
+    url: `/authority/plan/updateStatus`
+  },
+  remove: {
+    method: 'DELETE',
+    url: `/authority/plan`
+  },
+  delete: {
+    method: 'POST',
+    url: `/authority/plan/delete`
+  },
+  // 计划【更多-启用】
+  planEnable: {
+    method: 'POST',
+    url: `/authority/plan/planEnable`
+  },
+  // 计划【更多-暂停】
+  planSuspend: {
+    method: 'POST',
+    url: `/authority/plan/planSuspend`
+  },
+  // 计划【更多-优先级】
+  updateData: {
+    method: 'POST',
+    url: `/authority/plan/updateData`
+  },
+  // 计划【更多-生产单元】
+  setProductionUnit: {
+    method: 'POST',
+    url: `/authority/planZone/setProductionUnit`
+  },
+  // 计划【修改数量】
+  updateNumber: {
+    method: 'POST',
+    url: `/authority/plan/updateNumber`
+  },
+  // 计划【更多-删除】
+  deletePlan: {
+    method: 'POST',
+    url: `/authority/plan/deletePlan`
+  },
+  // 计划【状态数量统计】
+  getPlanStatusCount: {
+    method: 'POST',
+    url: `/authority/plan/getPlanStatusCount`
+  },
+  get: {
+    method: 'POST',
+    url: `/authority/plan/get`
+  },
+  list: {
+    method: 'POST',
+    url: `/authority/plan/query`
+  },
+  preview: {
+    method: 'POST',
+    url: `/authority/plan/preview`
+  },
+  export: {
+    method: 'POST',
+    url: `/authority/plan/export`
+  },
+  import: {
+    method: 'POST',
+    url: `/authority/plan/import`
+  },
+  downloadCraftCards: {
+    method: 'POST',
+    url: `/authority/plan/downloadCraftCards`
+  }
+}
+
+export default {
+	getList (data) {
+    return axiosApi({
+      ...apiList.getList,
+      data
+    })
+  },
+  page (data) {
+    return axiosApi({
+      ...apiList.page,
+      data
+    })
+  },
+  pageList (data) {
+    return axiosApi({
+      ...apiList.pageList,
+      data
+    })
+  },
+  save (data) {
+    return axiosApi({
+      ...apiList.save,
+      data
+    })
+  },
+  // 一键排产
+  oneTouchSchedule (data) {
+    return axiosApi({
+      ...apiList.oneTouchSchedule,
+      data
+    })
+  },
+  // 高级排产
+  advSchedule (data) {
+    return axiosApi({
+      ...apiList.advSchedule,
+      data
+    })
+  },
+  // 一键生产
+  confirmSchedule (data) {
+    return axiosApi({
+      ...apiList.confirmSchedule,
+      data
+    })
+  },
+  update (data) {
+    return axiosApi({
+      ...apiList.update,
+      data
+    })
+  },
+  updateStatus (data) {
+    return axiosApi({
+      ...apiList.updateStatus,
+      data
+    })
+  },
+  remove (data) {
+    return axiosApi({
+      ...apiList.remove,
+      data
+    })
+  },
+  delete (data) {
+    return axiosApi({
+      ...apiList.delete,
+      data
+    })
+  },
+  // 计划【更多-启用】
+  planEnable (data) {
+    return axiosApi({
+      ...apiList.planEnable,
+      data
+    })
+  },
+  // 计划【更多-暂停】
+  planSuspend (data) {
+    return axiosApi({
+      ...apiList.planSuspend,
+      data
+    })
+  },
+  // 计划【优先级 】
+  updateData (data) {
+    return axiosApi({
+      ...apiList.updateData,
+      data
+    })
+  },
+  // 计划【生产单元】
+  setProductionUnit (data) {
+    return axiosApi({
+      ...apiList.setProductionUnit,
+      data
+    })
+  },
+  // 计划【修改数量】
+  updateNumber (data) {
+    return axiosApi({
+      ...apiList.updateNumber,
+      data
+    })
+  },
+  // 计划【更多-删除】
+  deletePlan (data) {
+    return axiosApi({
+      ...apiList.deletePlan,
+      data
+    })
+  },
+  // 【计划状态数量统计】
+  getPlanStatusCount (data) {
+    return axiosApi({
+      ...apiList.getPlanStatusCount,
+      data
+    })
+  },
+  get (data) {
+    return axiosApi({
+      ...apiList.get,
+      data
+    })
+  },
+  list (data) {
+    return axiosApi({
+      ...apiList.list,
+      data
+    })
+  },
+  check (code) {
+    return axiosApi({
+      method: 'GET',
+      url: `/authority/plan/check/${code}`
+    })
+  },
+  checkField (data) {
+    return axiosApi({
+      method: 'POST',
+      url: `/authority/plan/check`,
+      data
+    })
+  },
+  preview (data) {
+    return axiosApi({
+      ...apiList.preview,
+      data
+    })
+  },
+  export (data) {
+    return axiosApi({
+      ...apiList.export,
+      responseType: "blob",
+      data
+    })
+  },
+  import (data) {
+    return axiosApi({
+      ...apiList.import,
+      data
+    })
+  },
+  getFinishPlanList (data) {
+    return axiosApi({
+      ...apiList.getFinishPlanList,
+      data
+    })
+  },
+  downloadCraftCards(data) {
+    return axiosApi({
+      ...apiList.downloadCraftCards,
+      responseType: "blob",
+      data
+    })
+  },
+}

+ 44 - 38
imcs-ui/src/lang/zh/order.js

@@ -1,38 +1,44 @@
-export default {
-	order: {
-		// 本模型下的共通
-		common: {
-			
-		},
-		// 列表搜索表单名称
-		searchForm: {
-			
-		},
-		// 按钮的名称
-	  	buttons: {
-	  		add: '新增',
-		    edit: '修改',
-		    delete: '删除',
-	  		view: '查看',
-	  		search: '查询',
-	  		reset: '重置',
-		    clear: '清除',
-		    confirm: '确定',
-		    cancel: '取消',
-		    copy: '复制',
-		    upload: '上传',
-	  	},
-	  	// 列表的cell名称
-		table: {
-		
-		},
-		// 表单数据名称
-		form: {
-			
-		},
-		// 表单验证规则提示信息
-		rules: {
-			
-		}
-	}
-}
+export default {
+	order: {
+		// 本模型下的共通
+		common: {
+      craftCardDialogName: '导出零件工艺模板'
+		},
+		// 列表搜索表单名称
+		searchForm: {
+
+		},
+		// 按钮的名称
+	  	buttons: {
+	  		add: '新增',
+		    edit: '修改',
+		    delete: '删除',
+	  		view: '查看',
+	  		search: '查询',
+	  		reset: '重置',
+		    clear: '清除',
+		    confirm: '确定',
+		    cancel: '取消',
+		    copy: '复制',
+		    upload: '上传',
+	  	},
+	  	// 列表的cell名称
+		table: {
+
+		},
+		// 表单数据名称
+		form: {
+      craftCard:{
+        partName: '零件',
+        partCode: '零部件编号',
+        deliveryTime: '零件交货日期',
+        partCount: '零件总数',
+      }
+
+		},
+		// 表单验证规则提示信息
+		rules: {
+
+		}
+	}
+}

+ 88 - 0
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/finishedOrder/components/craftCards/index.vue

@@ -0,0 +1,88 @@
+<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("order.form.craftCard.partName")' :show-overflow-tooltip="true"></el-table-column>
+      <!-- 零部件编号 -->
+      <el-table-column prop="no" :label='$t("order.form.craftCard.partCode")' :show-overflow-tooltip="true"></el-table-column>
+      <!-- 零件交货日期 -->
+      <el-table-column prop="deliveryTime" :label='$t("order.form.craftCard.deliveryTime")' :show-overflow-tooltip="true"></el-table-column>
+      <!-- 零件总数 -->
+      <el-table-column prop="planBomNum" :label='$t("order.form.craftCard.partCount")'></el-table-column>
+      <!-- 操作 -->
+      <el-table-column
+        :label="$t('table.operation')"
+        fixed="right"
+        align="center"
+        column-key="operation"
+      >
+        <template slot-scope="{ row }">
+          <a @click="downloadCraftCards(row)" style="color: #2db7f5">导出工艺流程卡</a>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+	// 【完成订单计划】-API
+	import planMgrApi from "@/api/runManageCenter/planMgr"
+  import { downloadFile } from '@/utils/commons'
+	export default {
+	  name: "craftCard",
+	  directives: {},
+	  components: {},
+    props: {
+      orderId: {
+        type:String,
+        default:''
+      }
+    },
+	  data () {
+	    return {
+	      tableKey: 0,
+	      loading: false,
+        rowData: {},
+        tableData:[]
+	    }
+	  },
+	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+	  created() {
+	  	// 加载列表数据
+	  	this.fetch()
+		},
+	  computed: {
+	  },
+	  mounted () {
+	  },
+	  methods: {
+	    fetch () {
+        console.log("this.orderId="+this.orderId)
+	      this.loading = true
+        planMgrApi.getFinishPlanList({ "orderId": this.orderId }).then(response => {
+	        const res = response.data
+	        if (res.isSuccess) {
+	          this.tableData = res.data
+	        }
+	      }).finally(() => this.loading = false)
+	    },
+
+      downloadCraftCards(data){
+        planMgrApi.downloadCraftCards(data).then(response => {
+          downloadFile(response)
+        })
+      }
+	  }
+	}
+</script>
+<style lang="scss" scoped></style>

+ 42 - 11
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/finishedOrder/index.vue

@@ -33,7 +33,7 @@
 	      </el-button>
       </span>
     </div>
-    
+
     <!-- 功能按钮 -->
     <!--<el-row class="filter-container">
     	<el-col>
@@ -144,7 +144,7 @@
         fixed="right"
         align="center"
         column-key="operation"
-        width="60px"
+        width="200px"
       >
         <template slot-scope="{ row }">
         	<el-tooltip class="item" :content='$t("runCenter.buttons.viewOrder")' effect="dark" placement="top-start">
@@ -168,6 +168,10 @@
 	            @click="singleDelete(row)"
 	          />
           </el-tooltip>-->
+
+
+          <a @click="down(row)" style="color: #2db7f5">导出工艺卡</a>
+
         </template>
       </el-table-column>
     </el-table>
@@ -203,6 +207,21 @@
         <div v-html="preview.context" />
       </el-scrollbar>
     </el-dialog>
+
+    <el-dialog
+      :visible.sync="craftCardsVisible"
+      :title='$t("order.common.craftCardDialogName")'
+      width="80%"
+      custom-class="dialogNoTop"
+      @close="craftCardsClose"
+    >
+      <!--【	维保】 -->
+      <craftCards
+        :row-data="rowData"
+        :order-id="orderId"
+        @close="craftCardsClose"
+      />
+    </el-dialog>
   </div>
 </template>
 
@@ -210,15 +229,15 @@
 	import Pagination from "@/components/Pagination"
 	import TenantEdit from "./components/Edit"
 	import TenantView from "./components/View"
+  import craftCards from "@/views/zuihou/runManageCenter/orderMgr/components/finishedOrder/components/craftCards/index"
 	// 【订单管理】-API
 	import orderMgrApi from "@/api/runManageCenter/orderMgr"
 	import elDragDialog from '@/directive/el-drag-dialog'
-	import { downloadFile, initEnums, initDicts, initQueryParams } from '@/utils/commons'
-	import axios from 'axios'
+	import { initQueryParams } from '@/utils/commons'
 	export default {
 	  name: "DraftOrder",
 	  directives: { elDragDialog },
-	  components: { Pagination, TenantEdit, TenantView },
+	  components: { Pagination, TenantEdit, TenantView ,craftCards},
 	  props: {
 	  },
 	  data () {
@@ -232,7 +251,10 @@
 	        context: ''
 	      },
 	      tenantViewVisible: false,
+        craftCardsVisible: false,
 	      tableKey: 0,
+        orderId:"",
+        rowData:{},
 	      queryParams: initQueryParams({}),
 	      selection: [],
 	      loading: false,
@@ -283,7 +305,7 @@
 	  computed: {
 	  },
 	  mounted () {
-	    
+
 	  },
 	  methods: {
 	  	// 【提交审核】按钮-事件
@@ -388,7 +410,7 @@
 	        })
 	        return
 	      }
-	
+
 	      this.$confirm(this.$t("lineSide.tips.wareTips"), this.$t("common.tips"), {
 	      	distinguishCancelAndClose: true,
 	        confirmButtonText: this.$t("common.confirm"),
@@ -459,7 +481,7 @@
 	        this.queryParams.map.deliveryTime_st = this.queryParams.timeRange[0]
 	        this.queryParams.map.deliveryTime_ed = this.queryParams.timeRange[1]
 	      }
-	
+
 	      this.queryParams.current = params.current ? params.current : this.queryParams.current
 	      this.queryParams.size = params.size ? params.size : this.queryParams.size
 	      // 查询必须参数-已完成:orderstatus  = 3(当生产状态等于已完成的时候,同时设置订单状态已完成)
@@ -473,7 +495,7 @@
 	        }
 	        // eslint-disable-next-line no-return-assign
 	      }).finally(() => this.loading = false)
-	     
+
 	    },
 	    cellClick (row, column) {
 	      if (column['columnKey'] === "operation") {
@@ -486,11 +508,20 @@
 	          this.$refs.table.toggleRowSelection(row)
 	        }
 	      })
-	
+
 	      if (!flag) {
 	        this.$refs.table.toggleRowSelection(row, true)
 	      }
-	    }
+	    },
+      craftCardsClose(){
+          this.craftCardsVisible = false
+      },
+      //【工艺卡下载】按钮-事件
+      down(row){
+          this.orderId = row.id
+          this.rowData = row
+          this.craftCardsVisible = true
+      },
 	  }
 	}
 </script>