fqcList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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. <uni-popup ref="popup" background-color="#fff">
  95. <view class="popup-process-content">
  96. <view class="list-title" style="margin-bottom: 8px;">
  97. <span
  98. class="font-icons"
  99. style="font-size: 20px;color: #00a0e9;width: 40px;text-align: center;"
  100. >&#xe6a3;</span>
  101. <span>FQC检验报告列表</span>
  102. </view>
  103. <view>
  104. <view style="display: flex;align-items: center;margin: 45px 6px 0 6px;">
  105. <text style="font-size: 14px;">设置检验时间</text>
  106. <picker
  107. mode="date"
  108. style="width: 20%;min-width: 135px;height: 40px;display: flex;justify-content: center;align-items: center;"
  109. :value="currentRow.oqcDate"
  110. @change="bindTimeChange($event)"
  111. >
  112. <view
  113. class="uni-input"
  114. style="
  115. width: 125px;
  116. height: 30px;
  117. display: flex;
  118. align-items: center;
  119. justify-content: center;
  120. border: 1px solid #6a6a6a;
  121. border-radius: 6px;
  122. font-size: 14px;
  123. "
  124. >
  125. {{ currentRow.oqcDate }}
  126. </view>
  127. </picker>
  128. </view>
  129. <view class="grid-box">
  130. <view
  131. v-for="(item, index) in dictDataList"
  132. :key="index"
  133. class="box"
  134. style="background-color: rgb(44, 183, 85);"
  135. @click="handleAddOQC(item.value)"
  136. >
  137. <text>新增{{ item.label }}检验</text>
  138. </view>
  139. </view>
  140. <view class="grid-box">
  141. <view
  142. v-for="(item, index) in oqcList"
  143. :key="index"
  144. class="box"
  145. @click="handleClickOQCName(item)"
  146. >
  147. <text>{{ item.ipqcDate }}</text>
  148. <text>{{ item.classFlagNmae }}</text>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. </uni-popup>
  154. </view>
  155. </template>
  156. </gui-page>
  157. </template>
  158. <script>
  159. import {
  160. onReachBottom
  161. } from '@dcloudio/uni-app'
  162. import {
  163. ref,
  164. defineComponent,
  165. computed,
  166. onMounted
  167. } from 'vue'
  168. import { formatDate } from '@/unit/default.js'
  169. export default defineComponent({
  170. setup() {
  171. const popup = ref()
  172. const oqcList = ref([])
  173. const currentRow = ref()
  174. const dictDataList = ref([])
  175. const queryParams = ref({
  176. pageSize: 8,
  177. pageNo: 1,
  178. erpOrderNo: '',
  179. materialNo: '',
  180. materialName: '',
  181. createTime: []
  182. })
  183. const cardList = ref([])
  184. const computedCreateTime = computed(() => {
  185. return item => {
  186. if (![NaN, null, undefined, ''].includes(item)) {
  187. return formatDate(item)
  188. }
  189. return ''
  190. }
  191. })
  192. onMounted(() => {
  193. search()
  194. // 获取班别字典数据
  195. uni.$reqGet('getDictDataPage', {
  196. dictType: 'class_flag',
  197. pageNo: 1,
  198. pageSize: 100
  199. })
  200. .then(({
  201. code,
  202. data,
  203. msg
  204. }) => {
  205. dictDataList.value = data?.list ?? []
  206. })
  207. })
  208. const search = function() {
  209. const params = {
  210. pageNo: queryParams.value.pageNo,
  211. pageSize: queryParams.value.pageSize,
  212. erpOrderNo: queryParams.value.erpOrderNo,
  213. materialNo: queryParams.value.materialNo,
  214. materialName: queryParams.value.materialName
  215. // 'createTime[0]': queryParams.value.createTime[0] ?? "",
  216. // 'createTime[1]': queryParams.value.createTime[1] ?? "",
  217. }
  218. uni.$reqGet('getProductionWorkOrderDetailPage', params)
  219. .then(({
  220. data,
  221. msg
  222. }) => {
  223. cardList.value = data?.list ?? []
  224. })
  225. }
  226. const goHome = function() {
  227. uni.$goHome()
  228. }
  229. const handleToScanMaterials = function(item) {
  230. if (popup.value?.showPopup === false) {
  231. popup.value.open('bottom')
  232. }
  233. currentRow.value = item
  234. uni.$reqGet('getInComingReceiptInspectionList', {
  235. detailErpId: item?.detailErpId
  236. })
  237. .then(({
  238. code,
  239. data,
  240. msg
  241. }) => {
  242. oqcList.value = data ?? []
  243. })
  244. }
  245. // 绑定日期时间事件
  246. const bindTimeChange = function(e) {
  247. currentRow.value.oqcDate = e.detail.value
  248. }
  249. const handleAddOQC = function(state) {
  250. // 调接口新增
  251. uni.$reqPost('createFQC', {
  252. detailErpId: currentRow.value?.detailErpId,
  253. processNo: 'FQC',
  254. materialNo: currentRow.value?.materialNo,
  255. classFlag: state,
  256. oqcDate: currentRow.value?.oqcDate
  257. })
  258. .then(({
  259. code,
  260. data,
  261. msg
  262. }) => {
  263. if (code === 0) {
  264. uni.navigateTo({
  265. url: `/pages/workbranch/production/FQC/fqcCheckout?params=${JSON.stringify({ id: data })}`
  266. })
  267. } else {
  268. uni.showToast({
  269. title: msg,
  270. duration: 2000,
  271. icon: 'none'
  272. })
  273. }
  274. })
  275. }
  276. // FQC检验列表选择事件
  277. const handleClickOQCName = function(params) {
  278. uni.navigateTo({
  279. url: `/pages/workbranch/production/FQC/fqcCheckout?params=${JSON.stringify(params)}`
  280. })
  281. }
  282. // uniapp移动端触底事件
  283. onReachBottom(() => {
  284. queryParams.value.pageNo += 1
  285. uni.$reqGet('getProductionWorkOrderDetailPage', queryParams.value)
  286. .then(({
  287. data
  288. }) => {
  289. Array.prototype.push.call(cardList.value, ...data?.list ?? [])
  290. })
  291. })
  292. return {
  293. popup,
  294. goHome,
  295. search,
  296. cardList,
  297. oqcList,
  298. currentRow,
  299. dictDataList,
  300. handleAddOQC,
  301. queryParams,
  302. bindTimeChange,
  303. computedCreateTime,
  304. handleClickOQCName,
  305. handleToScanMaterials
  306. }
  307. }
  308. })
  309. </script>
  310. <style lang="scss" scoped>
  311. .gui-header-leader-btns {
  312. color: black;
  313. font-size: 24px !important;
  314. margin-left: 24rpx;
  315. }
  316. .list-content {
  317. margin-top: 80px;
  318. background-color: #edeeee;
  319. }
  320. .search {
  321. height: 160px;
  322. width: calc(100% - 48px);
  323. margin: 12px;
  324. padding: 0 12px;
  325. display: grid;
  326. grid-template-columns: 1fr 1fr;
  327. grid-template-rows: 1fr 1fr;
  328. align-items: center;
  329. border-radius: 6px;
  330. background-color: white;
  331. .search-card {
  332. width: 100%;
  333. display: grid;
  334. grid-template-rows: 1fr;
  335. grid-template-columns: 3fr 7fr;
  336. align-items: center;
  337. text {
  338. display: flex;
  339. justify-content: center;
  340. }
  341. }
  342. }
  343. .popup-process-content {
  344. width: 100vw;
  345. height: 85vh;
  346. overflow-y: scroll;
  347. .list-title {
  348. position: fixed;
  349. top: 0;
  350. left: 0;
  351. z-index: 99999;
  352. width: 100%;
  353. display: flex;
  354. align-items: center;
  355. height: 45px;
  356. line-height: 45px;
  357. font-size: 16px;
  358. font-weight: bold;
  359. border-top-left-radius: 16px;
  360. border-top-right-radius: 16px;
  361. border-bottom: 1px solid #d4d4d4;
  362. background-color: white;
  363. .block {
  364. width: 6px;
  365. height: 60%;
  366. margin: 0 4px;
  367. background-color: rgb(0, 160, 233);
  368. }
  369. }
  370. .grid-box {
  371. display: grid;
  372. grid-template-columns: 1fr 1fr 1fr;
  373. .box {
  374. position: relative;
  375. height: 40px;
  376. padding: 10px 6px;
  377. border: 1px solid rgb(250, 250, 251);
  378. box-sizing: border-box;
  379. margin: 12px;
  380. display: flex;
  381. justify-content: center;
  382. align-items: center;
  383. font-size: 14px;
  384. font-weight: bold;
  385. border-radius: 4px;
  386. color: white;
  387. box-shadow: 0 3px 6px 0 rgba(121, 118, 118, 0.34);
  388. background-color: rgb(0, 160, 233);
  389. }
  390. .box::before {
  391. content: '';
  392. position: absolute;
  393. top: 20px;
  394. left: 0;
  395. bottom: 0;
  396. transform: translate(-50%, -50%);
  397. width: 12px;
  398. height: 12px;
  399. border-radius: 50%;
  400. z-index: 1;
  401. background-color: #ffffff;
  402. }
  403. }
  404. .grid-box:nth-of-type(1) {
  405. margin-top: 45px;
  406. }
  407. }
  408. </style>