ipqcList.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <gui-page :custom-header="true" :header-class="['gui-theme-background-color']">
  3. <template #gHeader>
  4. <view style="height:44px;" class="gui-flex gui-nowrap gui-rows gui-align-items-center">
  5. <!-- 使用组件实现返回按钮及返回首页按钮 -->
  6. <text
  7. style="font-size:44rpx;"
  8. class="gui-header-leader-btns gui-color-white font-icons"
  9. @tap="goHome"
  10. >&#xe6c5;</text>
  11. <!-- 导航文本此处也可以是其他自定义内容 -->
  12. <text
  13. class="gui-h4 gui-blod gui-flex1 gui-text-center gui-ellipsis gui-color-white gui-primary-text"
  14. >生产执行</text>
  15. <!-- 此处加一个右侧展位元素与左侧同宽,实现标题居中 -->
  16. <!-- 实际宽度请根据自己情况设置 -->
  17. <view style="width:40px;" />
  18. <!-- 如果右侧有其他内容可以利用条件编译和定位来实现-->
  19. </view>
  20. </template>
  21. <template #gBody>
  22. <view class="list-content">
  23. <view class="search">
  24. <view class="search-card">
  25. <text style="font-size: 12px;">生产订单</text>
  26. <view class="custom-select">
  27. <uni-easyinput
  28. v-model="queryParams.erpOrderNo"
  29. focus
  30. type="text"
  31. placeholder="请输入订单编号"
  32. />
  33. </view>
  34. </view>
  35. <view class="search-card">
  36. <text>产品编号</text>
  37. <view class="custom-select">
  38. <uni-easyinput v-model="queryParams.materialNo" type="text" placeholder="请输入产品编号" />
  39. </view>
  40. </view>
  41. <view class="search-card">
  42. <text>创建时间</text>
  43. <view class="custom-select">
  44. <uni-datetime-picker
  45. v-model="queryParams.createTime"
  46. type="daterange"
  47. @change="handlePickerChange"
  48. />
  49. </view>
  50. </view>
  51. <view class="search-card">
  52. <text>产品名称</text>
  53. <view class="custom-select">
  54. <uni-easyinput v-model="queryParams.materialName" type="text" placeholder="请输入产品名称" />
  55. </view>
  56. </view>
  57. <view class="search-card">
  58. <view class="custom-select">
  59. <button type="primary" size="mini" @click="search">搜索</button>
  60. </view>
  61. </view>
  62. </view>
  63. <view v-if="cardList?.length > 0" class="list-panel">
  64. <view
  65. v-for="item in cardList"
  66. :key="item.id"
  67. class="panel"
  68. @click="handleToScanMaterials(item)"
  69. >
  70. <view class="panel-row">
  71. <text>{{ item.erpOrderNo }}</text>
  72. <text class="text-2 font-icons">开始执行&#xe66b;</text>
  73. </view>
  74. <view class="panel-row">
  75. <text>产品编号</text>
  76. <text>{{ item.materialNo }}</text>
  77. </view>
  78. <view class="panel-row">
  79. <text>产品名称</text>
  80. <text>{{ item.materialName }}</text>
  81. </view>
  82. <view class="panel-row">
  83. <text>计划数量</text>
  84. <text>{{ item.materialAmount }}</text>
  85. </view>
  86. </view>
  87. </view>
  88. <view v-else>
  89. <view class="bg-image">
  90. <image src="@/static/empty.png" mode="heightFix" />
  91. <text>这里什么都没有...</text>
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. </gui-page>
  97. </template>
  98. <script>
  99. import {
  100. onReachBottom
  101. } from '@dcloudio/uni-app'
  102. import {
  103. ref,
  104. defineComponent,
  105. onMounted
  106. } from 'vue'
  107. export default defineComponent({
  108. setup() {
  109. const queryParams = ref({
  110. pageSize: 8,
  111. pageNo: 1,
  112. status: 1,
  113. erpOrderNo: '',
  114. materialNo: '',
  115. materialName: '',
  116. createTime: []
  117. })
  118. const cardList = ref([])
  119. const processList = ref([])
  120. const materialList = ref([])
  121. onMounted(() => {
  122. // uni.$reqGet("getProcessBaseList", queryParams.value)
  123. // .then(({
  124. // data,
  125. // msg
  126. // }) => {
  127. // if (data?.list.length > 0) {
  128. // data?.list.forEach(item => {
  129. // processList.value.push({
  130. // text: item.processName,
  131. // value: item.processNo
  132. // });
  133. // })
  134. // }
  135. // })
  136. // uni.$reqGet("getProcessMaterialList", queryParams.value)
  137. // .then((data) => {
  138. // if (data?.length > 0) {
  139. // data.forEach(item => {
  140. // materialList.value.push({
  141. // text: item.materialName,
  142. // value: item.materialNo
  143. // });
  144. // })
  145. // }
  146. // })
  147. search()
  148. })
  149. const search = function() {
  150. const params = {
  151. pageNo: queryParams.value.pageNo,
  152. pageSize: queryParams.value.pageSize,
  153. erpOrderNo: queryParams.value.erpOrderNo,
  154. materialNo: queryParams.value.materialNo,
  155. materialName: queryParams.value.materialName
  156. // 'createTime[0]': queryParams.value.createTime[0] ?? "",
  157. // 'createTime[1]': queryParams.value.createTime[1] ?? "",
  158. }
  159. uni.$reqGet('getProductionWorkOrderDetailPage', params)
  160. .then(({
  161. data,
  162. msg
  163. }) => {
  164. cardList.value = data?.list ?? []
  165. })
  166. }
  167. // const handleSelectProcess = function(e) {
  168. // queryParams.value.pageNo = 1;
  169. // queryParams.value.materialNo = "";
  170. // queryParams.value.processNo = e ?? "";
  171. // uni.$reqGet("getProcessMaterialList", queryParams.value)
  172. // .then((data) => {
  173. // materialList.value.length = 0;
  174. // if (data?.length > 0) {
  175. // data.forEach(item => {
  176. // materialList.value.push({
  177. // text: item.materialName,
  178. // value: item.materialNo
  179. // });
  180. // })
  181. // }
  182. // })
  183. // search();
  184. // }
  185. const handlePickerChange = function(e) {
  186. console.log('handlePickerChange事件:', e)
  187. }
  188. const handleSelectMaterial = function(e) {
  189. queryParams.value.pageNo = 1
  190. queryParams.value.materialNo = e ?? ''
  191. search()
  192. }
  193. const goHome = function() {
  194. uni.$goHome()
  195. }
  196. const handleToScanMaterials = function(params) {
  197. uni.navigateTo({
  198. url: `/pages/workbranch/production/IPQC/ipqcCheckout?params=${JSON.stringify(params)}`
  199. })
  200. }
  201. // uniapp移动端触底事件
  202. onReachBottom(() => {
  203. queryParams.value.pageNo += 1
  204. uni.$reqGet('getProductionWorkOrderDetailPage', queryParams.value)
  205. .then(({
  206. data
  207. }) => {
  208. Array.prototype.push.call(cardList.value, ...data?.list ?? [])
  209. })
  210. })
  211. return {
  212. search,
  213. goHome,
  214. queryParams,
  215. cardList,
  216. processList,
  217. materialList,
  218. handlePickerChange,
  219. // handleSelectProcess,
  220. handleSelectMaterial,
  221. handleToScanMaterials
  222. }
  223. }
  224. })
  225. </script>
  226. <style lang="scss" scoped>
  227. .gui-header-leader-btns {
  228. color: black;
  229. font-size: 24px !important;
  230. margin-left: 24rpx;
  231. }
  232. .list-content {
  233. margin-top: 80px;
  234. background-color: #edeeee;
  235. }
  236. .search {
  237. height: 160px;
  238. width: calc(100% - 48px);
  239. margin: 12px;
  240. padding: 0 12px;
  241. display: grid;
  242. grid-template-columns: 1fr 1fr;
  243. grid-template-rows: 1fr 1fr;
  244. align-items: center;
  245. border-radius: 6px;
  246. background-color: white;
  247. .search-card {
  248. width: 100%;
  249. display: grid;
  250. grid-template-rows: 1fr;
  251. grid-template-columns: 3fr 7fr;
  252. align-items: center;
  253. text {
  254. display: flex;
  255. justify-content: center;
  256. }
  257. }
  258. }
  259. .custom-select {
  260. width: 100%;
  261. }
  262. </style>