workOrderPublish.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never">
  4. <div class="page-title">
  5. <el-page-header @back="back" content="发布工单"> </el-page-header>
  6. </div>
  7. <el-descriptions title="" :column="6" border class="mb-20">
  8. <el-descriptions-item label="计划编号">{{
  9. infoData.code
  10. }}</el-descriptions-item>
  11. <el-descriptions-item label="计划类型">{{
  12. planType[infoData.planType]
  13. }}</el-descriptions-item>
  14. <el-descriptions-item label="物料编码">{{
  15. infoData.productCode
  16. }}</el-descriptions-item>
  17. <el-descriptions-item label="牌号">{{
  18. infoData.brandNo
  19. }}</el-descriptions-item>
  20. <el-descriptions-item label="型号">{{
  21. infoData.model
  22. }}</el-descriptions-item>
  23. <el-descriptions-item label="生产版本">{{
  24. infoData.produceVersionName
  25. }}</el-descriptions-item>
  26. <el-descriptions-item label="工艺路线名称">{{
  27. infoData.routingName
  28. }}</el-descriptions-item>
  29. <el-descriptions-item label="工艺路线版本">{{
  30. infoData.routingVersion
  31. }}</el-descriptions-item>
  32. <el-descriptions-item label="产品数量"
  33. >{{ infoData.productNum }}PCS</el-descriptions-item
  34. >
  35. <el-descriptions-item label="产品重量"
  36. >{{ infoData.productWeight
  37. }}{{ infoData.productUnitWeight }}</el-descriptions-item
  38. >
  39. <el-descriptions-item label="要求成型数量"
  40. >{{ infoData.requiredFormingNum }}PCS</el-descriptions-item
  41. >
  42. <el-descriptions-item label="要求成型重量"
  43. >{{ infoData.requiredFormingWeight }}kg</el-descriptions-item
  44. >
  45. </el-descriptions>
  46. <!-- <div class="rules-box">
  47. <div class="rule-label">工单生成规则</div>
  48. <div class="rule-wrapper">
  49. <div class="content">
  50. <div class="select-box" v-for="(item, index) in rules" :key="index">
  51. <el-radio-group v-model="item.value" v-if="item.type === 'radio'">
  52. <el-radio
  53. v-for="(itm, idx) in item.list"
  54. :key="idx"
  55. :label="itm.label"
  56. ></el-radio>
  57. </el-radio-group>
  58. <el-checkbox-group v-model="item.value" v-else>
  59. <el-checkbox
  60. v-for="(itm, idx) in item.list"
  61. :key="idx"
  62. :label="itm.label"
  63. :disabled="
  64. itm.lastDisabled
  65. ? item.value.length < item.list.length - 1
  66. : false
  67. "
  68. ></el-checkbox>
  69. </el-checkbox-group>
  70. </div>
  71. </div>
  72. <div class="btn-box">
  73. <el-tooltip
  74. placement="top-start"
  75. title="标题"
  76. width="200"
  77. trigger="hover"
  78. content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
  79. >
  80. <el-button type="text" icon="el-icon-question"></el-button>
  81. </el-tooltip>
  82. <el-button type="primary" plain>一键生成方案</el-button>
  83. </div>
  84. </div>
  85. </div> -->
  86. <planView key="first" :infoData="infoData" :orderList="orderList" />
  87. <!-- <el-tabs v-model="activeName" type="card">
  88. <el-tab-pane label="默认" name="first"
  89. ><planView key="first" :infoData="infoData"
  90. /></el-tab-pane>
  91. <el-tab-pane
  92. v-for="(item, index) in planList"
  93. :label="item.label"
  94. :name="index"
  95. ><planView :key="index" :infoData="infoData"
  96. /></el-tab-pane>
  97. </el-tabs> -->
  98. </el-card>
  99. </div>
  100. </template>
  101. <script>
  102. import planView from './components/plan-view';
  103. import { getById, getReleaseInfoById } from '@/api/productionPlan/index';
  104. import { getRouteTabKey, removePageTab } from '@/utils/page-tab-util';
  105. export default {
  106. components: { planView },
  107. data () {
  108. return {
  109. activeName: 'first',
  110. planList: [],
  111. rules: [
  112. {
  113. type: 'radio',
  114. value: '',
  115. list: [
  116. { label: '多设备优先', value: 0 },
  117. { label: '多班次优先', value: 1 }
  118. ]
  119. },
  120. {
  121. type: 'checked',
  122. value: [],
  123. list: [
  124. { label: '设备产能优先', value: 0 },
  125. { label: '最早开始时间优先', value: 1 },
  126. { label: '开始时间优先', value: 2, lastDisabled: true }
  127. ]
  128. },
  129. {
  130. type: 'checked',
  131. value: [],
  132. list: [
  133. { label: '非空闲设备可用', value: 0 },
  134. { label: '检修设备可用', value: 1 },
  135. { label: '检修设备优先', value: 1, lastDisabled: true }
  136. ]
  137. },
  138. {
  139. type: 'radio',
  140. value: '',
  141. list: [{ label: '末单均衡', value: 0 }]
  142. }
  143. ],
  144. infoData: {},
  145. orderList: [],
  146. planType: ['', '内销计划', '外销计划', '预制计划'],
  147. id: null
  148. };
  149. },
  150. methods: {
  151. back () {
  152. const key = getRouteTabKey();
  153. if (this.type == 2) {
  154. this.$router.push('/productionPlan');
  155. removePageTab({ key });
  156. return;
  157. }
  158. this.$confirm('返回后将清空所有方案,是否要继续?', '提示').then(() => {
  159. this.$router.push('/productionPlan');
  160. removePageTab({ key });
  161. });
  162. },
  163. async getInfo () {
  164. const data = await getById(this.id);
  165. this.infoData = data;
  166. },
  167. async getReleaseInfoById () {
  168. const data = await getReleaseInfoById(this.id);
  169. this.infoData = data.productionPlan;
  170. this.orderList = data.workOrderList.map(itm => ({
  171. ...itm,
  172. productCode: data.productionPlan.productCode,
  173. productName: data.productionPlan.productName
  174. }));
  175. }
  176. },
  177. created () {
  178. const { query = {} } = this.$route;
  179. this.type = query.type;
  180. this.id = query.id;
  181. if (query.type == 2) {
  182. this.getReleaseInfoById();
  183. } else {
  184. this.getInfo();
  185. }
  186. }
  187. };
  188. </script>
  189. <style lang="scss" scoped>
  190. .rules-box {
  191. padding: 20px 0;
  192. display: flex;
  193. justify-content: space-between;
  194. .rule-label {
  195. font-size: 18px;
  196. font-weight: bold;
  197. }
  198. .rule-wrapper {
  199. flex: 1;
  200. display: flex;
  201. justify-content: space-between;
  202. align-items: flex-start;
  203. .content {
  204. flex: 1;
  205. display: flex;
  206. flex-wrap: wrap;
  207. align-items: center;
  208. padding: 0 10px;
  209. .select-box {
  210. border: 1px solid #ccc;
  211. padding: 5px 10px;
  212. margin: 0 10px 10px 0;
  213. }
  214. }
  215. .btn-box {
  216. display: flex;
  217. justify-content: space-between;
  218. width: 160px;
  219. }
  220. }
  221. }
  222. .mb-20 {
  223. margin-bottom: 20px;
  224. }
  225. </style>