search.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <!-- 搜索表单 -->
  2. <template>
  3. <seekPage :seekList="seekList" @search="search"></seekPage>
  4. </template>
  5. <script>
  6. import { getUserPage } from '@/api/system/organization';
  7. import { basicAreaPageAPI } from '@/api/regionalManage';
  8. import work from '@/api/technology/work';
  9. import producetask from '@/api/technology/production';
  10. import { getteampage } from '@/api/workforceManagement/team';
  11. import {
  12. getFactoryarea
  13. } from '@/api/factoryModel';
  14. export default {
  15. components: {},
  16. props: {
  17. options_groupId: {
  18. type: Array,
  19. default() {
  20. return [];
  21. }
  22. },
  23. options_factory: {
  24. type: Array,
  25. default() {
  26. return [];
  27. }
  28. }
  29. },
  30. data() {
  31. return {
  32. workCenterList: [],
  33. areaTreeList: [],
  34. sourceTaskList: [],
  35. leaderIdList: [],
  36. teamList: [],
  37. factoryList: [],
  38. workshopPlanList: [],
  39. workshopList: []
  40. };
  41. },
  42. computed: {
  43. seekList() {
  44. return [
  45. {
  46. label: '工位编码:',
  47. value: 'code',
  48. type: 'input',
  49. placeholder: '请输入'
  50. },
  51. {
  52. label: '所属区域:',
  53. value: 'areaId',
  54. type: 'selectTree',
  55. planList: this.areaTreeList,
  56. placeholder: '请选择'
  57. },
  58. {
  59. label: '工位名称:',
  60. value: 'name',
  61. type: 'input',
  62. placeholder: '请输入'
  63. },
  64. {
  65. label: '所属工作中心:',
  66. value: 'workCenterId',
  67. labelWidth: '120px',
  68. type: 'select',
  69. planList: this.workCenterList.map((item) => ({
  70. label: item.name,
  71. value: item.id
  72. })),
  73. placeholder: '请选择'
  74. },
  75. {
  76. label: '工序:',
  77. value: 'sourceTaskId',
  78. type: 'select',
  79. planList: this.sourceTaskList.map((item) => ({
  80. label: item.name,
  81. value: item.id
  82. })),
  83. placeholder: '请选择'
  84. },
  85. {
  86. label: '负责人:',
  87. value: 'leaderId',
  88. type: 'select',
  89. planList: this.leaderIdList.map((item) => ({
  90. label: item.name,
  91. value: item.id
  92. })),
  93. placeholder: '请选择'
  94. },
  95. {
  96. label: '所属班组:',
  97. value: 'teamId',
  98. type: 'select',
  99. planList: this.teamList.map((item) => ({
  100. label: item.name,
  101. value: item.id
  102. })),
  103. placeholder: '请选择'
  104. },
  105. {
  106. label: '所属工厂:',
  107. value: 'factoryId',
  108. type: 'select',
  109. planList: this.factoryList.map((item) => ({
  110. label: item.name,
  111. value: item.id
  112. })),
  113. placeholder: '请选择'
  114. },
  115. {
  116. label: '设备编码:',
  117. value: 'assetCode',
  118. type: 'input',
  119. placeholder: '请输入'
  120. },
  121. {
  122. label: '设备名称:',
  123. value: 'assetName',
  124. type: 'input',
  125. placeholder: '请输入'
  126. },
  127. {
  128. label: '所属厂房:',
  129. value: 'workshopPlanId',
  130. type: 'select',
  131. planList: this.workshopPlanList.map((item) => ({
  132. label: item.workshopPlanName || item.name,
  133. value: item.id
  134. })),
  135. placeholder: '请选择'
  136. },
  137. {
  138. label: '所属车间:',
  139. value: 'workshopId',
  140. type: 'select',
  141. planList: this.workshopList.map((item) => ({
  142. label: item.name,
  143. value: item.id
  144. })),
  145. placeholder: '请选择'
  146. }
  147. ];
  148. }
  149. },
  150. created() {
  151. this.getUserPage();
  152. this.getBasicAreaList();
  153. this.getListWorkCenter();
  154. this.getListProduce();
  155. this.getTeamPage();
  156. this.getFactoryList();
  157. this.getWorkshopPlanList();
  158. this.getWorkshopList();
  159. },
  160. methods: {
  161. /* 获取区域集合 */
  162. async getBasicAreaList() {
  163. this.areaList = await basicAreaPageAPI({
  164. pageNum: 1,
  165. size: 9999
  166. });
  167. this.areaTreeList = this.$util.toTreeData({
  168. data: this.areaList,
  169. idField: 'id',
  170. parentIdField: 'parentId'
  171. });
  172. },
  173. async getListWorkCenter() {
  174. await work.list({ pageNum: 1, size: -1 }).then((res) => {
  175. this.workCenterList = res.list;
  176. });
  177. },
  178. getListProduce() {
  179. producetask.list({ pageNum: 1, size: -1 }).then((res) => {
  180. this.sourceTaskList = res.list || [];
  181. });
  182. },
  183. /* 搜索 */
  184. search(where) {
  185. this.$emit('search', where);
  186. },
  187. // 获取人员
  188. getUserPage() {
  189. let par = {
  190. size: 999
  191. };
  192. getUserPage(par).then((res) => {
  193. this.leaderIdList = res.list;
  194. });
  195. },
  196. // 获取班组
  197. getTeamPage() {
  198. let param = {
  199. pageNum: 1,
  200. size: 9999
  201. };
  202. getteampage(param).then((res) => {
  203. this.teamList = res.list || [];
  204. });
  205. },
  206. // 获取工厂列表
  207. getFactoryList() {
  208. getFactoryarea({
  209. pageNum: 1,
  210. size: 999,
  211. type: 1,
  212. enable: 1
  213. }).then((res) => {
  214. this.factoryList = res.list || [];
  215. });
  216. },
  217. // 获取厂房列表
  218. getWorkshopPlanList() {
  219. getFactoryarea({
  220. pageNum: 1,
  221. size: 9999,
  222. type: 2,
  223. enable: 1
  224. }).then((res) => {
  225. this.workshopPlanList = res.list || [];
  226. });
  227. },
  228. // 获取车间列表
  229. getWorkshopList() {
  230. getFactoryarea({
  231. pageNum: 1,
  232. size: 9999,
  233. type: 3,
  234. enable: 1
  235. }).then((res) => {
  236. this.workshopList = res.list || [];
  237. });
  238. }
  239. }
  240. };
  241. </script>