deliveryNoteList.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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 style="font-size:44rpx;" class="gui-header-leader-btns gui-color-white font-icons"
  7. @tap="goHome">&#xe6c5;</text>
  8. <!-- 导航文本此处也可以是其他自定义内容 -->
  9. <text
  10. class="gui-h4 gui-blod gui-flex1 gui-text-center gui-ellipsis gui-color-white gui-primary-text">送货单待回签列表</text>
  11. <!-- 此处加一个右侧展位元素与左侧同宽,实现标题居中 -->
  12. <!-- 实际宽度请根据自己情况设置 -->
  13. <view style="width:40px;" />
  14. <!-- 如果右侧有其他内容可以利用条件编译和定位来实现-->
  15. </view>
  16. </template>
  17. <template #gBody>
  18. <view class="list-content">
  19. <view class="scan">
  20. <view class="scan-card">
  21. <uni-easyinput ref="easyinput" v-model="scanNumber" :input-border="false" :clearable="false"
  22. type="text" focus @focus="handleInputFocus" placeholder="扫描标签" @confirm="handleKeydown" />
  23. <text class="font-icons" @click="handleMapass">&#xe6b7;</text>
  24. </view>
  25. </view>
  26. <view class="table-title">
  27. <span>待回签列表</span>
  28. </view>
  29. <view class="custom-table">
  30. <uni-table border stripe empty-text="暂无更多数据">
  31. <!-- 表头行 -->
  32. <uni-tr class="custom-table-head">
  33. <uni-th align="center" width="100px">通知单</uni-th>
  34. <uni-th align="center" width="100px">销售单</uni-th>
  35. <uni-th align="center" width="140px">客户名称</uni-th>
  36. </uni-tr>
  37. <!-- 表格数据行 -->
  38. <uni-tr v-for="(item, key) in saleOutOrderList" :key="key" @click="handleShowDetails(item)">
  39. <uni-td align="center">{{ item.saleOutNo }}</uni-td>
  40. <uni-td align="center">{{ item.erpOrderNo }}</uni-td>
  41. <uni-td align="center">{{ item.customerName }}</uni-td>
  42. </uni-tr>
  43. </uni-table>
  44. </view>
  45. </view>
  46. <uni-popup ref="errorTip" type="dialog">
  47. <uni-popup-dialog type="error" cancel-text="关闭" confirm-text="确认" title="提示" :content="errorTipMessage"
  48. @confirm="handleCloseErrorTipsModal" @close="handleCloseErrorTipsModal" />
  49. </uni-popup>
  50. </template>
  51. </gui-page>
  52. </template>
  53. <script>
  54. import {
  55. defineComponent,
  56. onBeforeMount,
  57. ref
  58. } from 'vue'
  59. export default defineComponent({
  60. setup() {
  61. const modalForm = ref('')
  62. const errorState = ref(0)
  63. const easyinput = ref()
  64. const errorTip = ref('')
  65. const errorTipMessage = ref('')
  66. const saleOutOrderList = ref([])
  67. const scanNumber = ref('')
  68. const search = function() {
  69. uni.$reqGet('getSaleOutOrderPage', {
  70. pageNo: 1,
  71. pageSize: 100
  72. })
  73. .then(({
  74. code,
  75. data,
  76. msg
  77. }) => {
  78. if (code === 0) {
  79. saleOutOrderList.value = data?.list ?? []
  80. } else {
  81. uni.showToast({
  82. title: msg,
  83. icon: 'none',
  84. duration: 2000
  85. })
  86. }
  87. })
  88. }
  89. onBeforeMount(() => {
  90. search()
  91. })
  92. const handleMapass = function() {
  93. // #ifdef APP-PLUS
  94. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
  95. mpaasScanModule.mpaasScan({
  96. // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
  97. 'scanType': ['qrCode', 'barCode'],
  98. // 是否隐藏相册,默认false不隐藏
  99. 'hideAlbum': false
  100. },
  101. (ret) => {
  102. if (ret.resp_code === 1000) {
  103. uni.$reqPost('saveOrScanSaleOutOrder', {
  104. qrCode: ret.resp_result
  105. })
  106. .then(({
  107. code,
  108. data,
  109. msg
  110. }) => {
  111. if (code === 0) {
  112. search()
  113. setInputFocus()
  114. uni.showToast({
  115. title: '回签成功',
  116. icon: 'none',
  117. duration: 2000
  118. })
  119. } else {
  120. // #ifdef APP-PLUS
  121. plus.device.beep(2)
  122. // #endif
  123. errorTipMessage.value = msg
  124. errorTip.value.open()
  125. errorState.value = 0
  126. }
  127. })
  128. }
  129. })
  130. // #endif
  131. }
  132. // 扫描完成品标签输入框回车事件
  133. const handleKeydown = function(e) {
  134. uni.$reqPost('saveOrScanSaleOutOrder', {
  135. qrCode: e
  136. })
  137. .then(({
  138. code,
  139. data,
  140. msg
  141. }) => {
  142. if (code === 0) {
  143. search()
  144. setInputFocus()
  145. uni.showToast({
  146. title: '回签成功',
  147. icon: 'none',
  148. duration: 2000
  149. })
  150. } else {
  151. // #ifdef APP-PLUS
  152. plus.device.beep(2)
  153. // #endif
  154. errorTipMessage.value = msg
  155. errorTip.value.open()
  156. errorState.value = 0
  157. }
  158. })
  159. }
  160. const handleShowDetails = function(ret) {
  161. uni.navigateTo({
  162. url: `/pages/workbranch/warehouse/deliveryNote/deliveryNoteDetail?saleOrderNo=${ret.saleOutNo}`
  163. })
  164. }
  165. const goHome = function() {
  166. uni.$goHome()
  167. }
  168. const setInputFocus = function() {
  169. scanNumber.value = ''
  170. easyinput.value.onBlur()
  171. easyinput.value.onFocus()
  172. }
  173. // 关闭错误信息弹窗
  174. const handleCloseErrorTipsModal = async function() {
  175. errorTip.value.close()
  176. if (errorState.value === 0) {
  177. await setInputFocus()
  178. }
  179. }
  180. // 禁用软键盘
  181. const handleInputFocus = function() {
  182. setTimeout(() => {
  183. uni.hideKeyboard()
  184. }, 100)
  185. }
  186. return {
  187. goHome,
  188. easyinput,
  189. errorTip,
  190. errorTipMessage,
  191. handleInputFocus,
  192. modalForm,
  193. scanNumber,
  194. handleMapass,
  195. handleKeydown,
  196. saleOutOrderList,
  197. handleShowDetails,
  198. handleCloseErrorTipsModal
  199. }
  200. }
  201. })
  202. </script>
  203. <style lang="scss" scoped>
  204. .gui-header-leader-btns {
  205. color: black;
  206. font-size: 24px !important;
  207. }
  208. .list-content {
  209. margin-top: 80px;
  210. background-color: #edeeee;
  211. }
  212. .input-200 {
  213. width: 200px;
  214. padding-left: 10px;
  215. }
  216. .font-icons {
  217. width: 40px;
  218. font-size: 20px;
  219. text-align: right;
  220. }
  221. .scan {
  222. height: 45px;
  223. width: calc(100% - 48px);
  224. margin: 12px;
  225. padding: 0 12px;
  226. display: flex;
  227. justify-content: space-between;
  228. align-items: center;
  229. border-radius: 6px;
  230. background-color: white;
  231. .scan-card {
  232. width: 100%;
  233. display: grid;
  234. grid-template-rows: 1fr;
  235. grid-template-columns: 7fr 2fr;
  236. align-items: center;
  237. input {
  238. height: 35px;
  239. line-height: 35px;
  240. }
  241. text {
  242. width: 100%;
  243. text-align: right;
  244. }
  245. }
  246. }
  247. .card-list-flexbox {
  248. width: calc(100vw - 24px);
  249. height: 195px;
  250. margin: 0 12px;
  251. display: flex;
  252. justify-content: center;
  253. flex-direction: column;
  254. align-items: center;
  255. overflow-y: scroll;
  256. .card-list-title {
  257. width: 100%;
  258. height: 35px;
  259. line-height: 35px;
  260. margin: 0 4px 0 4px;
  261. border-radius: 4px 4px 0 0;
  262. text-align: center;
  263. color: white;
  264. background-color: rgba(0, 160, 233, 1.0);
  265. }
  266. .card-list-item,
  267. .card-list-item-operation {
  268. width: 100%;
  269. height: 35px;
  270. margin: 0 4px 3rpx 4px;
  271. border-radius: 4px;
  272. display: flex;
  273. flex-direction: row;
  274. align-items: center;
  275. justify-content: space-between;
  276. background-color: #fff;
  277. uni-text {
  278. font-size: 14px;
  279. height: 50rpx;
  280. text-align: left;
  281. padding: 0 8px;
  282. display: flex;
  283. flex-direction: row;
  284. align-items: center;
  285. }
  286. .text-1 {
  287. flex: 1;
  288. height: 35px;
  289. justify-content: flex-start;
  290. }
  291. .text-2 {
  292. flex: 3;
  293. height: 35px;
  294. justify-content: flex-end;
  295. margin-right: 4px;
  296. padding: 2px 6px;
  297. }
  298. }
  299. }
  300. .table-title {
  301. height: 40px;
  302. line-height: 40px;
  303. margin: 4px 0 -3px 0;
  304. padding: 0 12px;
  305. font-size: 16px;
  306. font-weight: bold;
  307. background-color: white;
  308. }
  309. .custom-table {
  310. height: calc(100vh - 200px);
  311. // height: calc(100vh - 265px);
  312. min-height: 230px;
  313. margin: 5px 0;
  314. overflow-y: scroll;
  315. }
  316. </style>