OutboundTask.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. <template>
  2. <view :class="{popupShow:popupShow}">
  3. <view class="searchBox">
  4. <u-search placeholder="请输入订单号" v-model="page.ordNo" clearabled :actionStyle="{'color':'#fff'}"
  5. @custom="qingkongfun" @search="qingkongfun" @clear="qingkongfun"></u-search>
  6. </view>
  7. <view style="width: 95%;margin: 0 auto;">
  8. <u-tabs :list="tabsList" keyName="label" :current="tabsCurrent" @click="tabsClick"></u-tabs>
  9. </view>
  10. <view class="bottombox">
  11. <view class="listbox">
  12. <view class="listforBox" v-for="(item,index) in shipListData" :key="index"
  13. @click="editBox(item,index,true)">
  14. <view class="disableFlexBox">
  15. <view class="title">{{item.ordNo?item.ordNo:'--'}}</view>
  16. <view class="text" style="padding: 5rpx 30rpx;border:1rpx solid #FD4B09;border-radius: 100rpx;color: #FD4B09;">
  17. <text>{{item.statusName}}</text>
  18. </view>
  19. </view>
  20. <view class="text">{{item.customerName}}</view>
  21. <view class="text">{{item.storageName}}</view>
  22. <view style="display: flex;align-items: center;justify-content: space-between;">
  23. <view class="text">{{item.stockClerkName?item.stockClerkName:'--'}}</view>
  24. <view class="text">{{item.businesDate}}</view>
  25. </view>
  26. <!-- <view class="positioningview">
  27. <view class="positioningButton"
  28. v-if="item.statusName == '待处理'"
  29. @click.stop="editBox(item,index,true)">编辑</view>
  30. <view v-if="item.statusName == '已派工'" class="positioningButton"
  31. @click.stop="DispatchingWorkersfun(item,index,'撤销派工')">撤销派工</view>
  32. <view v-else class="positioningButton"
  33. @click.stop="DispatchingWorkersfun(item,index,'派工')">派工</view>
  34. </view> -->
  35. </view>
  36. </view>
  37. </view>
  38. <u-loadmore v-if="total !== 0" :status="status" />
  39. <!-- 距离底部的距离 -->
  40. <view style="height: 40rpx;"></view>
  41. <!-- 编辑弹窗层 -->
  42. <u-popup :show="popupShow" mode="center" overlay round="8" customStyle="width:80%;">
  43. <view class="popupbox">
  44. <view class="formBox">
  45. <view class="inputBox">
  46. <view>销售单号</view>
  47. <view class="huicolor">{{popupRow.ordNo}}</view>
  48. </view>
  49. <view class="inputBox">
  50. <view>业务对象</view>
  51. <view class="huicolor">{{popupRow.customerName}}</view>
  52. </view>
  53. <view class="inputBox" @click="tanchuangfun()">
  54. <view style="color: #dd451b;">发货仓库</view>
  55. <u--input
  56. placeholder="请选择发货仓库"
  57. border="none"
  58. inputAlign="right"
  59. disabled
  60. disabledColor="#fff"
  61. v-model="popupRow.storageName"
  62. ></u--input>
  63. <!-- <view>{{popupRow.storageName}}</view> -->
  64. </view>
  65. <view class="inputBox" @click="KGtanchuangfun()">
  66. <view style="color: #dd451b;">库管</view>
  67. <u--input
  68. placeholder="请选择库管"
  69. border="none"
  70. inputAlign="right"
  71. disabled
  72. disabledColor="#fff"
  73. v-model="popupRow.stockClerkName"
  74. ></u--input>
  75. <!-- <view v-else>{{popupRow.stockClerkName}}</view> -->
  76. </view>
  77. <view class="inputBox">
  78. <view>业务来源</view>
  79. <view class="huicolor">{{popupRow.bsType}}</view>
  80. </view>
  81. <view class="inputBox">
  82. <view>来源公司</view>
  83. <view class="huicolor">{{popupRow.sourceCompanyName}}</view>
  84. </view>
  85. <view class="inputBox">
  86. <view>收货地址</view>
  87. <view class="huicolor">{{popupRow.recAddress}}</view>
  88. </view>
  89. <view class="inputBox">
  90. <view>销售数量</view>
  91. <view class="huicolor">{{popupRow.goodsTotalNum}}</view>
  92. </view>
  93. <view class="inputBox">
  94. <view>发货数量</view>
  95. <view class="huicolor">{{popupRow.sendTotalNum?popupRow.sendTotalNum:'--'}}</view>
  96. </view>
  97. <view class="inputBox">
  98. <view>联系人</view>
  99. <view class="huicolor">{{popupRow.contacts}}</view>
  100. </view>
  101. <view class="inputBox">
  102. <view>电话</view>
  103. <view class="huicolor">{{popupRow.phone}}</view>
  104. </view>
  105. <view class="inputBox">
  106. <view style="width: 100rpx;color: #dd451b;">备注</view>
  107. <view style="width: 100%;">
  108. <u--textarea v-model="popupRow.remarks" border="none" :disabled="!popupType"
  109. placeholder="请输入备注" ></u--textarea>
  110. </view>
  111. <!-- <view>{{popupRow.remarks?popupRow.remarks:'--'}}</view> -->
  112. </view>
  113. </view>
  114. <view class="bottomflex" >
  115. <view class="buttombox" @click="popupShowfalse">取消</view>
  116. <view v-if="popupRow.statusName != '已完成'">
  117. <view v-if="popupRow.statusName == '已派工'" class="buttombox"
  118. @click.stop="DispatchingWorkersfun(popupRow,'撤销派工')">撤销派工</view>
  119. <view v-else class="buttombox"
  120. @click.stop="shipEditfun(popupRow)">派工</view>
  121. </view>
  122. <!-- <view v-if="popupType" class="buttombox" @click="shipEditfun(popupRow)">派工</view> -->
  123. <!-- DispatchingWorkersfun(item,index,'派工') -->
  124. </view>
  125. </view>
  126. </u-popup>
  127. <!-- 发货仓库选择弹窗 -->
  128. <u-picker :show="pickerShow" :columns="pickerColumns"
  129. keyName="cname" :loading="loading"
  130. @confirm="pickerConfirm" @cancel="pickerCancel"></u-picker>
  131. <!-- 库管选择弹窗 -->
  132. <u-picker :show="KGpickerShow" :columns="KGpickerColumns"
  133. keyName="name" :loading="loading"
  134. @confirm="KGpickerConfirm" @cancel="KGpickerCancel"></u-picker>
  135. <!-- 提示确认弹窗 -->
  136. <u-modal :show="modalShow" :title="modalTitle" :content='modalContent'
  137. showCancelButton @confirm="modalConfirm" @cancel="modalCancel"></u-modal>
  138. <u-toast ref="uToast"></u-toast>
  139. </view>
  140. </template>
  141. <script>
  142. import { shipList,storageDescListAll,
  143. stockClerkList,shipEdit,shipOutboundWorkOrder,shipRevokeWorkOrder } from '@/api/OutboundTask/index.js'
  144. export default {
  145. data() {
  146. return {
  147. // 列表请求参数
  148. page:{
  149. ordNo:null,
  150. current: 1,
  151. size: 10,
  152. bizTypeName: 'FHRW',
  153. statusName:'待处理'
  154. },
  155. // 总条数
  156. total:0,
  157. status:'loadmore',
  158. // 列表数据
  159. shipListData:[],
  160. // 编辑弹窗的开启
  161. popupShow:false,
  162. // 编辑弹窗的数据
  163. popupRow:{},
  164. // 当前编辑弹窗的下标
  165. popupIndex:0,
  166. // 发货仓库弹窗的开启和关闭
  167. pickerShow:false,
  168. // 发货仓库弹窗的数据
  169. pickerColumns:[],
  170. // 库管弹窗的数据
  171. KGpickerColumns:[],
  172. // 库管弹窗的开启和关闭
  173. KGpickerShow:false,
  174. // 提示弹窗
  175. modalShow:false,
  176. modalTitle:'',
  177. modalContent:'',
  178. // 弹窗加载
  179. loading:false,
  180. // tbas切换数据
  181. tabsList:[
  182. {
  183. label: '全部',
  184. value: null
  185. },
  186. {
  187. label: '待处理',
  188. value: '待处理'
  189. },{
  190. label: '处理中',
  191. value: '已派工'
  192. }, {
  193. label: '已完成',
  194. value: '已完成'
  195. }
  196. ],
  197. // 弹窗是编辑还是详情的判断
  198. popupType:false,
  199. // tbas当前选择的下标
  200. tabsCurrent:1,
  201. }
  202. },
  203. onLoad() {
  204. },
  205. onShow() {
  206. this.shipListData = []
  207. this.shipListfun()
  208. },
  209. onReachBottom() {
  210. if (this.page.current * this.page.size < this.total) {
  211. this.page.current++
  212. this.status = 'loadmore'
  213. this.shipListfun()
  214. } else {
  215. this.status = 'nomore'
  216. }
  217. },
  218. methods: {
  219. // 派工,取消派工的弹窗确认按钮
  220. modalConfirm(){
  221. if (this.modalTitle == '派工') {
  222. shipOutboundWorkOrder({ids:this.popupRow.id}).then(res=>{
  223. if (res.code == 200) {
  224. this.$refs.uToast.show({
  225. type: 'success',
  226. message: "派工成功",
  227. })
  228. this.modalShow = false
  229. this.popupShow = false
  230. this.qingkongfun()
  231. }else {
  232. this.$refs.uToast.show({
  233. type: 'error',
  234. message: res.msg,
  235. })
  236. }
  237. })
  238. }else {
  239. shipRevokeWorkOrder({ids:this.popupRow.id}).then(res=>{
  240. if (res.code == 200) {
  241. this.$refs.uToast.show({
  242. type: 'success',
  243. message: "撤销派工成功"
  244. })
  245. this.modalShow = false
  246. this.popupShow = false
  247. this.qingkongfun()
  248. }else {
  249. this.$refs.uToast.show({
  250. type: 'error',
  251. message: res.msg,
  252. })
  253. }
  254. })
  255. }
  256. },
  257. // 派工,取消派工的弹窗取消按钮
  258. modalCancel(){
  259. this.modalShow = false
  260. },
  261. // 派工接口
  262. DispatchingWorkersfun(row,text){
  263. this.modalShow = true
  264. this.popupRow = row
  265. // this.popupIndex = index
  266. this.modalTitle = text
  267. this.modalContent = `是否确认要${text}`
  268. },
  269. // 编辑弹窗相关部分-------------------------
  270. // 编辑弹窗的开启
  271. editBox(row,index,type){
  272. this.$u.route('/pages/OutboundTask/OutboundTask_XQ', {
  273. row:JSON.stringify(row)
  274. });
  275. // this.popupShow = true
  276. this.popupRow = row
  277. this.popupIndex = index
  278. // 点击的状态是编辑还是详情
  279. this.popupType = type
  280. },
  281. // 编辑弹窗保存
  282. popupShowupData(){
  283. this.shipEditfun()
  284. // this.popupShow = false
  285. },
  286. // 编辑弹窗取消
  287. popupShowfalse(){
  288. this.popupShow = false
  289. },
  290. // 保存接口
  291. shipEditfun(item){
  292. shipEdit(this.popupRow).then(res=>{
  293. console.log(res,302);
  294. this.DispatchingWorkersfun(item,'派工')
  295. })
  296. },
  297. // 发货仓库相关部分----------------------
  298. // 发货仓库弹窗的确认
  299. pickerConfirm(e){
  300. console.log(e);
  301. this.popupRow.storageName = e.value[0].canme
  302. this.popupRow.storageId = e.value[0].id
  303. this.pickerShow = false
  304. },
  305. // 发货仓库弹窗的打开
  306. tanchuangfun(type){
  307. if (!this.popupType) return
  308. if (this.KGpickerShow) return
  309. if (this.popupRow.statusName == '已派工') return
  310. this.pickerShow = true
  311. this.loading = true
  312. this.pickerColumns = []
  313. this.storageDescListAllfun()
  314. },
  315. // 发货仓库弹窗的取消
  316. pickerCancel(){
  317. this.pickerShow = false
  318. },
  319. // 获取发货仓库数据
  320. storageDescListAllfun(){
  321. storageDescListAll().then(res=>{
  322. this.pickerColumns = [res.data]
  323. console.log(this.pickerColumns,205);
  324. this.loading = false
  325. })
  326. },
  327. // 库管相关部分------------------------
  328. // 库管弹窗的确认
  329. KGpickerConfirm(e){
  330. this.popupRow.stockClerkName = e.value[0].name
  331. this.popupRow.stockClerkId = e.value[0].id
  332. this.KGpickerShow = false
  333. },
  334. // 库管的弹窗的开启
  335. KGtanchuangfun(){
  336. if (!this.popupType) return
  337. if (this.pickerShow) return
  338. if (this.popupRow.statusName == '已派工') return
  339. this.KGpickerShow = true
  340. this.loading = true
  341. this.stockClerkListfun()
  342. },
  343. // 发货仓库弹窗的取消
  344. KGpickerCancel(){
  345. this.KGpickerShow = false
  346. },
  347. // 获取库管数据
  348. stockClerkListfun(){
  349. stockClerkList().then(res=>{
  350. this.KGpickerColumns = [res.data]
  351. this.loading = false
  352. })
  353. },
  354. // 仓库列表数据相关部分-----------------------------
  355. // tabs切换
  356. tabsClick(e){
  357. console.log(e.value,309);
  358. this.page.statusName = e.value
  359. this.qingkongfun()
  360. },
  361. // 清空获取数据
  362. qingkongfun(){
  363. this.page.current = 1
  364. this.shipListData = []
  365. this.shipListfun()
  366. },
  367. // 获取仓库列表数据
  368. shipListfun(){
  369. shipList(this.page).then(res=>{
  370. this.shipListData = [...this.shipListData,...res.data.records]
  371. this.total = res.data.total
  372. if (this.page.current * this.page.size >= this.total) {
  373. this.status = 'nomore'
  374. }
  375. })
  376. },
  377. }
  378. }
  379. </script>
  380. <style lang="scss" scoped>
  381. .popupShow {
  382. // overflow: hidden;
  383. // position: fixed;
  384. // position: fixed;
  385. // width: 100vw;
  386. // height: 100vh; // 固定高度
  387. // touch-action: none;
  388. // overflow: hidden;
  389. // overflow-y: scroll; // 超出滚动
  390. // overscroll-behavior: none; // 禁止滚动溢出
  391. }
  392. .huicolor {
  393. color: #999;
  394. }
  395. .searchBox {
  396. background: #fd4b09;
  397. padding: 25rpx;
  398. box-sizing: border-box;
  399. }
  400. .bottombox {
  401. width: 95%;
  402. margin: 20rpx auto 0;
  403. }
  404. .listbox {
  405. .listforBox {
  406. background: #fff;
  407. border-radius: 12rpx;
  408. padding: 30rpx 35rpx;
  409. box-sizing: border-box;
  410. margin-bottom: 20rpx;
  411. position: relative;
  412. }
  413. }
  414. .disableFlexBox {
  415. display: flex;
  416. align-items: center;
  417. justify-content: space-between;
  418. }
  419. .title {
  420. font-size: 32rpx;
  421. color: #fd4b09;
  422. }
  423. .text {
  424. font-size: 28rpx;
  425. margin: 5rpx 0;
  426. }
  427. .positioningview {
  428. position: absolute;
  429. bottom: 20rpx;
  430. right: 25rpx;
  431. display: flex;
  432. align-items: center;
  433. }
  434. .positioningButton {
  435. margin: 0 10rpx;
  436. font-size: 30rpx;
  437. background: #fd4b09;
  438. padding: 15rpx 25rpx;
  439. color: #fff;
  440. font-weight: 500;
  441. border-radius: 12rpx;
  442. }
  443. .popupbox {
  444. padding: 20rpx;
  445. box-sizing: border-box;
  446. .formBox {
  447. font-size: 30rpx;
  448. .inputBox {
  449. display: flex;
  450. align-items: center;
  451. justify-content: space-between;
  452. border-bottom: 1rpx solid #dcdde0;
  453. padding: 15rpx 0;
  454. margin: 5rpx 0;
  455. }
  456. }
  457. .bottomflex {
  458. display: flex;
  459. align-items: center;
  460. justify-content: space-around;
  461. margin-top: 30rpx;
  462. .buttombox {
  463. padding: 20rpx 50rpx;
  464. background: #fd4b09;
  465. font-size: 30rpx;
  466. color: #fff;
  467. border-radius: 12rpx;
  468. }
  469. }
  470. }
  471. </style>