detailDialog.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <div style="margin-top: 20px">
  3. <el-form
  4. v-if="details"
  5. ref="formRef"
  6. :model="form"
  7. :rules="rules"
  8. label-width="130px"
  9. v-loading="loading"
  10. >
  11. <header-title title="订单生产计划信息"></header-title>
  12. <el-row style="margin-bottom: 20px">
  13. <el-col :span="8">
  14. <el-form-item label="计划编号">
  15. <el-input :value="details.code" disabled></el-input>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :span="8">
  19. <el-form-item label="计划类型">
  20. <el-input :value="planType" disabled></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="8">
  24. <el-form-item label="产品名称">
  25. <el-input :value="details.productName" disabled></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :span="8">
  29. <el-form-item label="产品编码">
  30. <el-input :value="details.productCode" disabled></el-input>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :span="8">
  34. <el-form-item label="批次号">
  35. <el-input :value="details.batchNo" disabled></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :span="8">
  39. <el-form-item label="牌号">
  40. <el-input :value="details.brandNo" disabled></el-input>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="8">
  44. <el-form-item label="规格">
  45. <el-input :value="details.specification" disabled></el-input>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="8">
  49. <el-form-item label="型号">
  50. <el-input :value="details.model" disabled></el-input>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="8">
  54. <el-form-item label="销售单数量">
  55. <el-input :value="details.codeNum" disabled></el-input>
  56. </el-form-item>
  57. </el-col>
  58. <el-col :span="8">
  59. <el-form-item label="生产类型">
  60. <el-input :value="produceTypeText" disabled></el-input>
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="8">
  64. <el-form-item label="工艺路线">
  65. <el-input :value="details.produceRoutingName" disabled></el-input>
  66. </el-form-item>
  67. </el-col>
  68. <!-- <el-col :span="8">
  69. <el-form-item label="订单总数量">
  70. <el-input :value="details.contractNum" disabled>
  71. <template slot="append">{{ details.measuringUnit }}</template>
  72. </el-input>
  73. </el-form-item>
  74. </el-col> -->
  75. <el-col :span="8">
  76. <el-form-item label="订单重量">
  77. <el-input :value="details.newSumOrderWeight" disabled>
  78. <template slot="append">{{ details.weightUnit }}</template>
  79. </el-input>
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="8">
  83. <el-form-item label="要求生产数量">
  84. <el-input :value="details.requiredFormingNum" disabled>
  85. <template slot="append">{{ details.measuringUnit }}</template>
  86. </el-input>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :span="8">
  90. <el-form-item label="要求生产重量">
  91. <el-input :value="details.requiredFormingWeight" disabled>
  92. <template slot="append">{{ details.newWeightUnit }}</template>
  93. </el-input>
  94. </el-form-item>
  95. </el-col>
  96. <el-col :span="8">
  97. <el-form-item label="计划开始日期">
  98. <el-input :value="details.startTime" disabled></el-input>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="8">
  102. <el-form-item label="计划结束日期">
  103. <el-input :value="details.endTime" disabled></el-input>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="8">
  107. <el-form-item label="要求完成日期">
  108. <el-input :value="details.reqMoldTime" disabled></el-input>
  109. </el-form-item>
  110. </el-col>
  111. <el-col :span="8">
  112. <el-form-item label="所属工厂">
  113. <el-input :value="details.factoriesName" disabled></el-input>
  114. </el-form-item>
  115. </el-col>
  116. </el-row>
  117. </el-form>
  118. </div>
  119. </template>
  120. <script>
  121. import dictMixins from '@/mixins/dictMixins';
  122. import { getByCode } from '@/api/system/dictionary-data';
  123. import { getById } from '@/api/bpm/components/producePlan';
  124. // import { getById as maintenanceGetById } from '@/api/maintenance/patrol_maintenance.js';
  125. import { getUserPage } from '@/api/system/organization';
  126. export default {
  127. name: 'editModal',
  128. mixins: [dictMixins],
  129. props: {
  130. // 业务id
  131. businessId: {
  132. default: ''
  133. }
  134. },
  135. data() {
  136. const formBaseData = {
  137. username: '',
  138. email: ''
  139. };
  140. return {
  141. visible: false,
  142. title: '表单弹窗',
  143. formBaseData,
  144. form: JSON.parse(JSON.stringify(formBaseData)),
  145. rules: {},
  146. tabOptions: [
  147. { key: 'main', name: '记录表1' },
  148. { key: 'bpm', name: '流程详情2' }
  149. ],
  150. // 详情或者是审核
  151. type: 'detail',
  152. // 当前选项
  153. activeComp: 'main',
  154. details: null,
  155. loading: false,
  156. // 计划信息
  157. eamPlanInfo: null,
  158. // 事项规则相关数据
  159. // 负责人
  160. executorList: [],
  161. // 审核人
  162. uerList: [],
  163. deviceList: [],
  164. // ruleInfo
  165. ruleInfo: '',
  166. planTypeList: [],
  167. planType: ''
  168. };
  169. },
  170. mounted() {
  171. this.getPlanTypeList('plan_type');
  172. setTimeout(() => {
  173. this.getDatails(this.businessId);
  174. }, 500);
  175. },
  176. computed: {
  177. produceTypeText() {
  178. const map = {
  179. 1: 'PBOM',
  180. 2: 'MBOM',
  181. 3: 'ABOM'
  182. };
  183. return map[this.details.produceType] || '';
  184. }
  185. },
  186. methods: {
  187. // 关闭时清理表单
  188. handleClose() {
  189. this.visible = false;
  190. },
  191. async getPlanTypeList(code) {
  192. let { data: res } = await getByCode(code);
  193. this.planTypeList = res.map((item) => {
  194. let values = Object.keys(item);
  195. return {
  196. value: Number(values[0]),
  197. label: item[values[0]]
  198. };
  199. });
  200. },
  201. // 获取详情
  202. async getDatails(id) {
  203. try {
  204. this.loading = true;
  205. const data = await getById(id);
  206. console.log('data 详情数据', data);
  207. this.details = data;
  208. const typeData = this.planTypeList.find(
  209. (it) => it.value == this.details.planType
  210. );
  211. if ((Object.keys(typeData).length = !0)) {
  212. this.planType = typeData.label;
  213. }
  214. this.loading = false;
  215. } catch (error) {
  216. this.loading = false;
  217. }
  218. },
  219. showCheckUserNames(userList) {
  220. if (userList.length == 0) return '';
  221. return userList
  222. .map((i) => {
  223. return i.groupName + '-' + i.userName;
  224. })
  225. .join(',');
  226. },
  227. // 事项规则 详情
  228. async maintenanceGetById(id) {
  229. const { data } = await maintenanceGetById(id);
  230. console.log('事项规则 data', data);
  231. data.executorId = data.executorId.split(',');
  232. this.eamPlanInfo = data;
  233. this.getUserList({ groupId: data.groupId });
  234. this.ruleInfo = data.ruleInfo;
  235. this.ruleInfo.ruleItems = data.planDeviceList[0]?.workItems || [];
  236. this.deviceList = data.planDeviceList.map((item) => {
  237. return {
  238. name: item.substance.name,
  239. position: item.substance.position,
  240. id: item.substance.id,
  241. fixCode: item.substance.fixCode,
  242. codeNumber: item.substance.codeNumber
  243. };
  244. });
  245. },
  246. // 获取审核人列表、巡点检人员
  247. async getUserList(params) {
  248. try {
  249. let data = { pageNum: 1, size: -1 };
  250. // 如果传了参数就是获取巡点检人员数据
  251. if (params) {
  252. data = Object.assign(data, params);
  253. }
  254. const res = await getUserPage(data);
  255. if (params) {
  256. this.executorList = res.list;
  257. } else {
  258. this.uerList = res.list;
  259. }
  260. } catch (error) {}
  261. }
  262. }
  263. };
  264. </script>
  265. <style scoped lang="scss">
  266. .el-form-item .el-form-item {
  267. margin-bottom: 0 !important;
  268. }
  269. ::v-deep .el-tab_box {
  270. display: flex;
  271. margin-top: 10px;
  272. height: 300px;
  273. width: 100%;
  274. .equipmentList_box {
  275. flex: 1;
  276. height: 100%;
  277. margin-right: 10px;
  278. display: flex;
  279. flex-direction: column;
  280. .divider {
  281. flex: 0 0 50px;
  282. .title {
  283. height: 35px;
  284. }
  285. }
  286. .el-table {
  287. overflow: auto;
  288. }
  289. }
  290. .ruleMatters_box {
  291. flex: 3;
  292. height: 100%;
  293. display: flex;
  294. flex-direction: column;
  295. overflow: hidden;
  296. .divider {
  297. flex: 0 0 50px;
  298. .title {
  299. height: 35px;
  300. }
  301. }
  302. .el-table {
  303. overflow: auto;
  304. .operationGuide_box {
  305. width: 100%;
  306. height: 50px;
  307. display: flex;
  308. overflow: hidden;
  309. cursor: pointer;
  310. .left_content {
  311. flex: 0 0 200px;
  312. padding: 10px;
  313. box-sizing: border-box;
  314. border: 1px solid #c0c4cc;
  315. border-radius: 10px;
  316. margin-right: 10px;
  317. overflow-y: auto;
  318. }
  319. .right_content {
  320. flex: 1;
  321. padding: 10px;
  322. box-sizing: border-box;
  323. border: 1px solid #c0c4cc;
  324. border-radius: 10px;
  325. overflow-y: auto;
  326. }
  327. }
  328. }
  329. .el-table::before {
  330. display: none;
  331. }
  332. }
  333. }
  334. </style>