driverCheck.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <view class="app-container">
  3. <uni-nav-bar dark :fixed="true" shadow background-color="#007AFF" status-bar left-icon="left" left-text="返回"
  4. title="移位单" @clickLeft="handleBack" />
  5. <view class="scan-header">
  6. <uni-forms-item name="stockCode" label="单号" labelAlign="right"
  7. style="margin-bottom: 0px; padding: 0px 15px 0px 15px;" >
  8. <uni-easyinput type="text" :inputBorder="true" v-model="stockCode"
  9. :clearable="false" ></uni-easyinput>
  10. </uni-forms-item>
  11. <uni-forms-item name="dateRange" label="日期" labelAlign="right"
  12. style="margin-bottom: 0px; padding: 0px 15px 0px 15px;" >
  13. <uni-datetime-picker v-model="dateRange" type="daterange"/>
  14. </uni-forms-item>
  15. <view class="button-group">
  16. <button type="default" size="mini" @click="setDateRange(-30, 0)">30天</button>
  17. <button type="default" size="mini" @click="setDateRange(-1, -1)">昨日</button>
  18. <button type="default" size="mini" @click="setDateRange(0, 0)">今日</button>
  19. <button type="warn" size="mini" @click="examine">审核</button>
  20. <button type="primary" size="mini" @click="getList">查询</button>
  21. </view>
  22. </view>
  23. <scroll-view class="mxpop_scroll" scroll-y="true">
  24. <!-- <uni-section class="mb-10" :title="sectionTitle" type="line"> -->
  25. <view class="uni-list" style="margin-bottom: 60px;">
  26. <slot v-for="(item, index) in listData">
  27. <view class="uni-list-cell"
  28. hover-class="uni-list-cell-hover"
  29. :class="{ 'selected': rkid === item.id }"
  30. :key="index" @click="goProDetail(item, index, $event)"
  31. >
  32. <view style="display: flex;">
  33. <view class="detailList">单据:{{ item.stockCode }}|{{ item.wmsStockMoves.rowNumber }} {{ item.stockDate }}</view>
  34. </view>
  35. <view style="display: flex;">
  36. <view class="detailList">调出:{{ item.warehouseNameOut }}&emsp;调入:{{ item.warehouseNameIn }}</view>
  37. </view>
  38. <view style="display: flex;">
  39. <view class="detailList">物料:{{item.wmsStockMoves.materialName}}&emsp;规格:{{item.wmsStockMoves.materialSpecification}}</view>
  40. </view>
  41. <view style="display: flex;">
  42. <view class="detailList">标签:{{item.wmsStockMoves.labelCode}}&emsp;数量:{{ item.wmsStockMoves.stockQty }}{{ item.wmsStockMoves.unitName }}</view>
  43. </view>
  44. </view>
  45. <view class="s-line" />
  46. </slot>
  47. </view>
  48. <!-- </uni-section> -->
  49. </scroll-view>
  50. </view>
  51. </template>
  52. <script>
  53. import { auditListStockMove, checkStatus } from '@/api/wms/stockMove.js'
  54. import storage from '@/utils/storage'
  55. export default {
  56. onLoad(option) {},
  57. onUnload(){},
  58. data() {
  59. return {
  60. // 筛选
  61. stockCode: "",
  62. dateRange: ['', ''],
  63. listData: "", // 数据list
  64. rkid: "", // 当前选中数据
  65. }
  66. },
  67. created(){
  68. this.setDateRange(-1, 0)
  69. },
  70. methods: {
  71. getList() {
  72. let that = this;
  73. let queryParams = {
  74. stockCode: that.stockCode,
  75. status: 1,
  76. params: { "beginTime": this.dateRange[0],"endTime": this.dateRange[1] },
  77. //extendCode04: 无法传审核人id需要换接口
  78. }
  79. auditListStockMove(queryParams).then(res => {
  80. if(res.code === 200){
  81. const newData = res.rows.map((item) => {
  82. // 在每个对象中插入新变量
  83. item['selected'] = false;
  84. // 返回修改后的对象
  85. return item;
  86. });
  87. this.listData = newData;
  88. }
  89. });
  90. },
  91. examine(){//审核
  92. let queryParams = [];
  93. if(this.rkid != ""){
  94. queryParams.push(this.rkid);
  95. }else{
  96. return true;
  97. }
  98. uni.showModal({
  99. title: '审核',
  100. content: '确认审核吗?',
  101. success: (res) => {
  102. if (res.confirm) {
  103. checkStatus(queryParams).then(res => {
  104. if(res.code === 200){
  105. this.getList();
  106. }
  107. });
  108. }
  109. }
  110. });
  111. },
  112. goProDetail(item, index, event){ //选中行
  113. try{
  114. if( this.rkid == item.id ){
  115. this.rkid = "";
  116. }else{
  117. this.rkid = item.id;
  118. }
  119. }catch{
  120. this.rkid = "";
  121. }
  122. },
  123. setDateRange(start, end){ // 赋值日期期间
  124. let date1 = this.getYesterdayDate(start);
  125. let date2 = this.getYesterdayDate(end);
  126. this.dateRange = [date1, date2];
  127. this.getList();
  128. },
  129. getYesterdayDate(num) {// 获取当前日期
  130. let today = new Date();
  131. // 计算日期
  132. let yesterday = new Date(today);
  133. yesterday.setDate(yesterday.getDate() + parseInt(num));
  134. // 将日期格式化为YYYY-MM-DD格式的字符串
  135. let formattedDate = `${yesterday.getFullYear()}-${('0' + (yesterday.getMonth() + 1)).slice(-2)}-${('0' + yesterday.getDate()).slice(-2)}`;
  136. return formattedDate;
  137. },
  138. handleBack(){
  139. uni.showModal({
  140. title: '提示',
  141. content: '确认返回?',
  142. success: function (res) {
  143. if (res.confirm) {
  144. //用户点击确定;
  145. uni.navigateBack();
  146. } else if (res.cancel) {
  147. //用户点击取消;
  148. }
  149. }
  150. });
  151. },
  152. }
  153. }
  154. </script>
  155. <style>
  156. page{
  157. height: 100%;
  158. }
  159. .app-container{
  160. height: 100vh;
  161. display: flex;
  162. flex-direction: column;
  163. overflow: hidden;
  164. background: white;
  165. }
  166. .scan-header{
  167. position: fixed;
  168. /* #ifndef APP-PLUS */
  169. top: 45px;
  170. /* #endif */
  171. /* #ifdef APP-PLUS */
  172. top: 80px;
  173. /* #endif */
  174. width: 100%;
  175. background-color: white;
  176. z-index: 999;
  177. }
  178. .scroll-Y {
  179. /* height: 100%; */
  180. /* #ifndef APP-PLUS */
  181. margin-top: 44px;
  182. height: calc(100vh - 135px);
  183. /* #endif */
  184. /* #ifdef APP-PLUS */
  185. margin-top: 54px;
  186. height: calc(100vh - 175px);
  187. /* #endif */
  188. }
  189. ::v-deep .uni-forms-item{
  190. margin-bottom: 5px !important;
  191. }
  192. .detailList {
  193. margin-left: 4px;
  194. color: #333333;
  195. font-size: 13px;
  196. height: auto;
  197. line-height: 26px;
  198. width: 100vw;
  199. }
  200. .s-line{
  201. top: 0;
  202. right: 0;
  203. left: 0;
  204. height: 1px;
  205. margin-top: 5px;
  206. -webkit-transform: scaleY(0.5);
  207. transform: scaleY(0.5);
  208. background-color: #e5e5e5;
  209. z-index: 1;
  210. }
  211. .selected {
  212. background-color: #f8edb8;
  213. }
  214. .uni-list-cell {
  215. flex-direction: column;
  216. // margin-top: 10px;
  217. // background-color: white;
  218. padding: 8px 12px;
  219. }
  220. .mxpop_scroll{
  221. height: calc(100vh - 125px);
  222. margin-top: 130px;
  223. }
  224. /* 按钮行 */
  225. .button-group {
  226. margin-top: 5px;
  227. display: flex;
  228. justify-content: space-around;
  229. }
  230. </style>