list.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="getTitle" @clickLeft="back">
  4. </uni-nav-bar>
  5. <view class="top-wrapper">
  6. <uni-section>
  7. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="keyWord"
  8. placeholder="工单单号,计划单号,记录规则名称">
  9. </uni-easyinput>
  10. </uni-section>
  11. <button class="search_btn" @click="doSearch">搜索</button>
  12. </view>
  13. <div style="height: 100rpx; width: 475rpx"></div>
  14. <view class="wrapper">
  15. <u-list @scrolltolower="scrolltolower" class="listContent">
  16. <view v-for="(item, index) in tableList" :key="index" style="position: relative">
  17. <myCard :item="item" :index="index + 1" :btnList="btnList" :columns="columns" :title="item.code"
  18. :status="statusMap[item.status]" @goDetail="goDetail(item, 'view')" @openRedeployOther="openRedeployOther(item)"
  19. @edit="goDetail(item, 'edit')">
  20. </myCard>
  21. </view>
  22. <view style="width: 100%; height: 40rpx"></view>
  23. <view style="margin-top: 20vh" v-if="tableList.length == 0">
  24. <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
  25. </view>
  26. </u-list>
  27. </view>
  28. <u-toast ref="uToast"></u-toast>
  29. <workOrderReport ref="workOrderReportRef" :pageName="pageName" @refresh="successInit"></workOrderReport>
  30. <Assign ref="Assign" @refresh="successInit"></Assign>
  31. </view>
  32. </template>
  33. <script>
  34. import dictMixns from "@/mixins/dictMixins";
  35. import myCard from "./components/myCard.vue";
  36. import Assign from "./components/Assign.vue";
  37. import workOrderReport from "./components/workOrderReport.vue";
  38. import {
  39. producetaskrulerecordQueryRecordWorkOrderPage
  40. } from "@/api/recordRules/index";
  41. export default {
  42. components: {
  43. myCard,
  44. workOrderReport,Assign,
  45. },
  46. mixins: [dictMixns],
  47. props: {
  48. pageName: {
  49. default: "",
  50. },
  51. },
  52. data() {
  53. return {
  54. statusMap: {
  55. 0: "未报工",
  56. 1: "执行中",
  57. 2: "已执行",
  58. },
  59. planTypeList: {
  60. productionRecords: 2,
  61. steamInjectionInspectionRecord: 3,
  62. solidWasteRecord: 4,
  63. qualityTestRecords: 5,
  64. boilerOperationRecord: 6,
  65. },
  66. btnList: [{
  67. name: "报工",
  68. apiName: "edit",
  69. btnType: "primary",
  70. judge: [{
  71. key: "status",
  72. value: [1],
  73. }, ],
  74. }, {
  75. name: "转派",
  76. apiName: "openRedeployOther",
  77. btnType: "primary",
  78. judge: [{
  79. key: "status",
  80. value: [1],
  81. }, ],
  82. }],
  83. columns: [
  84. [{
  85. label: "计划单号:",
  86. prop: "planCode",
  87. className: "perce100",
  88. }, ],
  89. [{
  90. label: "记录规则名称:",
  91. prop: "ruleName",
  92. className: "perce100",
  93. }, ],
  94. [{
  95. label: "场站名称:",
  96. className: "perce100",
  97. prop: "productLineName",
  98. }, ],
  99. [{
  100. className: "perce100",
  101. label: "班组:",
  102. prop: "teamName",
  103. }, ],
  104. [{
  105. label: "工单生成时间:",
  106. className: "perce100",
  107. prop: "createTime",
  108. }, ],
  109. [{
  110. label: "检查时间:",
  111. className: "perce100",
  112. prop: "checkStartTime",
  113. }, ],
  114. [{
  115. label: "报工时间:",
  116. className: "perce100",
  117. prop: "checkFinishTime",
  118. }, ],
  119. [{
  120. label: "执行人:",
  121. className: "perce100",
  122. prop: "executeUsers",
  123. formatter: (row) => {
  124. if ((row.type == 1 && row.status == 2) || row.type != 1) {
  125. return row.executeUsers && row.executeUsers.map((i) => i.userName).join(',');
  126. }
  127. },
  128. }, ],
  129. [{
  130. label: "甲方检查人:",
  131. prop: "contactName",
  132. className: "perce100",
  133. isNone: this.pageName != "steamInjectionInspectionRecord",
  134. },
  135. {
  136. label: "处理方:",
  137. prop: "supplierName",
  138. className: "perce100",
  139. isNone: this.pageName != "solidWasteRecord",
  140. },
  141. {
  142. label: "联合站检查人:",
  143. prop: "contactName",
  144. className: "perce100",
  145. isNone: this.pageName != "qualityTestRecords",
  146. },
  147. ],
  148. [{
  149. label: "操作:",
  150. prop: "action",
  151. type: "action",
  152. className: "perce100",
  153. }, ],
  154. ].filter((item) => !item.isNone),
  155. tableList: [],
  156. page: 1,
  157. size: 10,
  158. isEnd: false,
  159. keyWord: "",
  160. userInfo: {},
  161. };
  162. },
  163. computed: {
  164. getTitle() {
  165. return this.pageName == "productionRecords" ?
  166. "生产记录" :
  167. this.pageName == "steamInjectionInspectionRecord" ?
  168. "注汽检查记录" :
  169. this.pageName == "solidWasteRecord" ?
  170. "固废记录" :
  171. this.pageName == "qualityTestRecords" ?
  172. "质量检查检测记录" :
  173. "锅炉运行记录";
  174. },
  175. },
  176. created() {
  177. this.requestDict("记录规则类型");
  178. },
  179. onLoad() {},
  180. methods: {
  181. goDetail(item, type) {
  182. console.log(item, "item");
  183. this.$refs.workOrderReportRef.open(item, type);
  184. },
  185. openRedeployOther(row){
  186. this.$refs.Assign.open(row)
  187. },
  188. successInit() {
  189. uni.showLoading({
  190. title: "加载中",
  191. });
  192. let data = {
  193. pageNum: 1,
  194. size: this.tableList.length,
  195. keyword: this.keyWord,
  196. planType: this.planTypeList[this.pageName],
  197. currentLoginUserId: this.userInfo.userId,
  198. };
  199. producetaskrulerecordQueryRecordWorkOrderPage(data)
  200. .then((res) => {
  201. this.tableList = res.list;
  202. })
  203. .then(() => {
  204. uni.hideLoading();
  205. });
  206. },
  207. doSearch() {
  208. this.isEnd = false;
  209. this.page = 1;
  210. this.getList();
  211. },
  212. //获取列表信息
  213. getList() {
  214. this.userInfo = uni.getStorageSync("userInfo");
  215. if (this.isEnd || !this.userInfo.userId) {
  216. return;
  217. }
  218. uni.showLoading({
  219. title: "加载中",
  220. });
  221. let data = {
  222. pageNum: this.page,
  223. size: this.size,
  224. keyword: this.keyWord,
  225. planType: this.planTypeList[this.pageName],
  226. currentLoginUserId: this.userInfo.userId,
  227. };
  228. producetaskrulerecordQueryRecordWorkOrderPage(data)
  229. .then((res) => {
  230. if (this.page === 1) {
  231. this.tableList = res.list;
  232. } else {
  233. this.tableList.push(...res.list);
  234. }
  235. this.page += 1;
  236. this.isEnd = this.tableList.length >= res.count;
  237. })
  238. .then(() => {
  239. uni.hideLoading();
  240. });
  241. },
  242. scrolltolower() {
  243. if (this.isEnd) {
  244. return;
  245. }
  246. this.getList();
  247. },
  248. },
  249. };
  250. </script>
  251. <style lang="scss" scoped>
  252. .mainBox {
  253. background-color: #f3f8fb;
  254. }
  255. // .wrapper{
  256. // }
  257. .top-wrapper {
  258. background-color: #fff;
  259. display: flex;
  260. width: 750rpx;
  261. height: 88rpx;
  262. padding: 16rpx 32rpx;
  263. align-items: center;
  264. // gap: 16rpx;
  265. position: absolute;
  266. z-index: 999;
  267. // top: 44px;
  268. // // #ifdef APP-PLUS
  269. // top: 140rpx;
  270. // // #endif
  271. /deep/.uni-section {
  272. margin-top: 0px;
  273. }
  274. /deep/.uni-section-header {
  275. padding: 0px;
  276. }
  277. .search_btn {
  278. width: 120rpx;
  279. height: 70rpx;
  280. line-height: 70rpx;
  281. padding: 0 24rpx;
  282. background: $theme-color;
  283. font-size: 32rpx;
  284. color: #fff;
  285. margin: 0;
  286. margin-left: 26rpx;
  287. }
  288. .menu_icon {
  289. width: 44rpx;
  290. height: 44rpx;
  291. margin-left: 14rpx;
  292. }
  293. }
  294. </style>