index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <template>
  2. <div class="tenant">
  3. <div class="content">
  4. <byTable
  5. :source="sourceList.data"
  6. :pagination="sourceList.pagination"
  7. :tableHeight="tableHeight"
  8. :config="config"
  9. :loading="loading"
  10. highlight-current-row
  11. :selectConfig="selectConfig"
  12. :table-events="{}"
  13. :action-list="[]"
  14. :onMoreSearch="true"
  15. @moreSearch="clickMoreSearch"
  16. @get-list="getList"
  17. >
  18. <template #finishStatus="{ item }">
  19. <div>
  20. <span
  21. style="padding: 4px; color: #fff"
  22. :class="[item.finishStatus == 1 ? 'active' : 'disActive']"
  23. >
  24. {{
  25. proxy.dictValueLabel(item.finishStatus, finishStatusData)
  26. }}</span
  27. >
  28. </div>
  29. </template>
  30. </byTable>
  31. </div>
  32. <el-dialog
  33. :title="'高级检索'"
  34. v-model="dialogVisible"
  35. width="700"
  36. v-loading="loading"
  37. destroy-on-close
  38. >
  39. <byForm
  40. :formConfig="formConfig"
  41. :formOption="formOption"
  42. v-model="sourceList.pagination"
  43. :rules="rules"
  44. ref="byform"
  45. >
  46. </byForm>
  47. <template #footer>
  48. <el-button @click="moreSearchReset" size="large">重置</el-button>
  49. <el-button @click="moreSearchQuery" type="primary" size="large"
  50. >搜索</el-button
  51. >
  52. </template>
  53. </el-dialog>
  54. </div>
  55. </template>
  56. <script setup>
  57. import { ElMessage, ElMessageBox } from "element-plus";
  58. import byTable from "@/components/byTable/index";
  59. import byForm from "@/components/byForm/index";
  60. const { proxy } = getCurrentInstance();
  61. const loading = ref(false);
  62. const submitLoading = ref(false);
  63. const sourceList = ref({
  64. data: [],
  65. pagination: {
  66. total: 3,
  67. pageNum: 1,
  68. pageSize: 10,
  69. keyword: "",
  70. contractCode: "",
  71. workOrderCode: "",
  72. productionPlanCode: "",
  73. productionTaskCode: "",
  74. productCode: "",
  75. productName: "",
  76. productSn: "",
  77. dueDate: "",
  78. productionProcessesName: "",
  79. personLiableName: "",
  80. getFinishStatus: "",
  81. getFinishTime: "",
  82. },
  83. });
  84. const tableHeight = ref(0);
  85. const getTableHeight = () => {
  86. tableHeight.value = window.innerHeight - 275;
  87. };
  88. getTableHeight();
  89. const finishStatusData = ref([
  90. {
  91. label: "未完成",
  92. value: "0",
  93. },
  94. {
  95. label: "完成",
  96. value: "1",
  97. },
  98. ]);
  99. const dialogVisible = ref(false);
  100. const modalType = ref("add");
  101. const rules = ref({
  102. workOrderId: [{ required: true, message: "请选择工单", trigger: "change" }],
  103. startDate: [
  104. { required: true, message: "请选择计划开始时间", trigger: "change" },
  105. ],
  106. stopDate: [
  107. { required: true, message: "请选择计划结束时间", trigger: "change" },
  108. ],
  109. quantity: [{ required: true, message: "请输入计划数量", trigger: "blur" }],
  110. });
  111. const workOrderData = ref([]);
  112. const workOrderDataOne = ref([]);
  113. const statusData = ref([
  114. {
  115. label: "未开始",
  116. value: "0",
  117. },
  118. {
  119. label: "进行中",
  120. value: "1",
  121. },
  122. {
  123. label: "完成",
  124. value: "2",
  125. },
  126. ]);
  127. const selectConfig = reactive([
  128. {
  129. label: "完成状态",
  130. prop: "getFinishStatus",
  131. data: finishStatusData.value,
  132. },
  133. ]);
  134. const config = computed(() => {
  135. return [
  136. {
  137. attrs: {
  138. label: "合同编号",
  139. prop: "contractCode",
  140. width: 110,
  141. },
  142. },
  143. {
  144. attrs: {
  145. label: "工单编号",
  146. prop: "workOrderCode",
  147. width: 110,
  148. },
  149. },
  150. // {
  151. // attrs: {
  152. // label: "计划编号",
  153. // prop: "productionPlanCode",
  154. // width: 110,
  155. // },
  156. // },
  157. // {
  158. // attrs: {
  159. // label: "任务编号",
  160. // prop: "productionTaskCode",
  161. // width: 110,
  162. // },
  163. // },
  164. {
  165. attrs: {
  166. label: "产品SN",
  167. prop: "productSn",
  168. width: 140,
  169. },
  170. },
  171. {
  172. attrs: {
  173. label: "产品编号",
  174. prop: "productCode",
  175. width: 100,
  176. },
  177. },
  178. {
  179. attrs: {
  180. label: "产品名称",
  181. prop: "productName",
  182. "min-width": 150,
  183. },
  184. },
  185. {
  186. attrs: {
  187. label: "产品规格",
  188. prop: "productSpec",
  189. width: 100,
  190. },
  191. },
  192. {
  193. attrs: {
  194. label: "任务完成期限",
  195. prop: "dueDate",
  196. width: 110,
  197. },
  198. },
  199. {
  200. attrs: {
  201. label: "工序名称列表",
  202. prop: "productionProcessesNames",
  203. "min-width": 250,
  204. },
  205. },
  206. {
  207. attrs: {
  208. label: "当前工序名称",
  209. prop: "productionProcessesName",
  210. width: 120,
  211. },
  212. },
  213. {
  214. attrs: {
  215. label: "当前工序负责人",
  216. prop: "personLiableName",
  217. width: 130,
  218. },
  219. },
  220. {
  221. attrs: {
  222. label: "完成状态",
  223. slot: "finishStatus",
  224. width: 80,
  225. align: "center",
  226. },
  227. // render(finishStatus) {
  228. // return proxy.dictValueLabel(finishStatus, finishStatusData.value);
  229. // },
  230. },
  231. {
  232. attrs: {
  233. label: "完成时间",
  234. prop: "finishTime",
  235. width: 155,
  236. },
  237. },
  238. ];
  239. });
  240. const formOption = reactive({
  241. inline: true,
  242. labelWidth: 100,
  243. itemWidth: 100,
  244. rules: [],
  245. });
  246. const byform = ref(null);
  247. const formConfig = computed(() => {
  248. return [
  249. {
  250. type: "input",
  251. itemType: "text",
  252. prop: "contractCode",
  253. label: "合同编号",
  254. itemWidth: 50,
  255. },
  256. {
  257. type: "input",
  258. itemType: "text",
  259. prop: "workOrderCode",
  260. label: "工单编号",
  261. itemWidth: 50,
  262. },
  263. {
  264. type: "input",
  265. itemType: "text",
  266. prop: "productionPlanCode",
  267. label: "计划编号",
  268. itemWidth: 50,
  269. },
  270. {
  271. type: "input",
  272. itemType: "text",
  273. prop: "productionTaskCode",
  274. label: "任务编号",
  275. itemWidth: 50,
  276. },
  277. {
  278. type: "input",
  279. itemType: "text",
  280. prop: "productCode",
  281. label: "产品编号",
  282. itemWidth: 50,
  283. },
  284. {
  285. type: "input",
  286. itemType: "text",
  287. prop: "productName",
  288. label: "产品名称",
  289. itemWidth: 50,
  290. },
  291. {
  292. type: "input",
  293. itemType: "text",
  294. prop: "productSn",
  295. label: "产品Sn",
  296. itemWidth: 50,
  297. },
  298. {
  299. type: "date",
  300. itemType: "date",
  301. prop: "dueDate",
  302. label: "任务完成期限",
  303. itemWidth: 50,
  304. style: {
  305. width: "100%",
  306. },
  307. },
  308. {
  309. type: "input",
  310. itemType: "text",
  311. prop: "productionProcessesName",
  312. label: "当前工序名称",
  313. itemWidth: 50,
  314. },
  315. {
  316. type: "input",
  317. itemType: "text",
  318. prop: "personLiableName",
  319. label: "当前工序负责人",
  320. itemWidth: 50,
  321. },
  322. {
  323. type: "select",
  324. prop: "getFinishStatus",
  325. label: "任务完成状态",
  326. itemWidth: 50,
  327. style: {
  328. width: "100%",
  329. },
  330. data: finishStatusData.value,
  331. },
  332. {
  333. type: "date",
  334. itemType: "date",
  335. prop: "getFinishTime",
  336. label: "任务完成时间",
  337. itemWidth: 50,
  338. style: {
  339. width: "100%",
  340. },
  341. },
  342. ];
  343. });
  344. const getList = async (req) => {
  345. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  346. loading.value = true;
  347. proxy
  348. .post("/productionTaskDetail/taskProgressPage", sourceList.value.pagination)
  349. .then((message) => {
  350. sourceList.value.data = message.rows;
  351. sourceList.value.pagination.total = message.total;
  352. setTimeout(() => {
  353. loading.value = false;
  354. }, 200);
  355. });
  356. };
  357. getList();
  358. const clickMoreSearch = () => {
  359. dialogVisible.value = true;
  360. };
  361. const moreSearchQuery = () => {
  362. dialogVisible.value = false;
  363. getList();
  364. };
  365. const moreSearchReset = () => {
  366. sourceList.value.pagination = {
  367. total: 0,
  368. pageNum: sourceList.value.pagination.pageNum,
  369. pageSize: sourceList.value.pagination.pageSize,
  370. keyword: "",
  371. contractCode: "",
  372. workOrderCode: "",
  373. productionPlanCode: "",
  374. productionTaskCode: "",
  375. productCode: "",
  376. productName: "",
  377. productSn: "",
  378. dueDate: "",
  379. productionProcessesName: "",
  380. personLiableName: "",
  381. getFinishStatus: "",
  382. getFinishTime: "",
  383. };
  384. moreSearchQuery();
  385. };
  386. </script>
  387. <style lang="scss" scoped>
  388. .tenant {
  389. padding: 20px;
  390. }
  391. ::v-deep(.el-input-number .el-input__inner) {
  392. text-align: left;
  393. }
  394. .active {
  395. background: #a6dd82;
  396. }
  397. .disActive {
  398. background: #fa9841;
  399. }
  400. </style>