index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <template>
  2. <view class="maintenance-container">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="发货确认单" background-color="#157A2C" color="#fff" @clickLeft="back"></uni-nav-bar>
  4. <view class="maintenance-wrapper">
  5. <scroll-view :scroll-y='true' class="kd-baseInfo">
  6. <view class="kd-cell">
  7. <text class="kd-label">发货单:</text>
  8. <text class="kd-content">
  9. {{info.sendNo}}
  10. <!-- <u-input disabled v-mode='info.sendNo'>
  11. <template slot="suffix">
  12. </template>
  13. </u-input> -->
  14. </text>
  15. <button
  16. class="search_btn"
  17. @click="handleInvoiceList"
  18. text="选择"
  19. type="primary"
  20. size="mini"
  21. >选择</button>
  22. </view>
  23. <template>
  24. <view class="kd-cell">
  25. <text class="kd-label">回执附件:</text>
  26. <file-doc v-model="info.repliedFiles"></file-doc>
  27. <text class="kd-content text-warning"></text>
  28. </view>
  29. </template>
  30. </scroll-view>
  31. <template>
  32. <button class="btn-execute" type="primary" @click="handleSubmit">提交</button>
  33. <button class="btn-reassignment" type="error" @click="back">取消</button>
  34. </template>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import fileDoc from '../doc/index.vue'
  40. import {
  41. saleordersendrecordInfo,
  42. saleordersendconfirmSave,
  43. saleordersendconfirmInfo
  44. } from '@/api/saleManage/saleorder/index.js'
  45. import {
  46. processInstanceCreateAPI,
  47. processInstancePage
  48. } from '@/api/wt/index.js'
  49. export default {
  50. components: {fileDoc},
  51. data() {
  52. return {
  53. info: {
  54. sendNo:'',
  55. repliedFiles:[],
  56. },
  57. }
  58. },
  59. onLoad(options={}) {
  60. // 详情
  61. if(options.id){
  62. this.getInfo(options.id)
  63. }
  64. },
  65. computed: {
  66. },
  67. methods: {
  68. back() {
  69. uni.switchTab({
  70. url: '/pages/index/index'
  71. })
  72. },
  73. async getInfo(id) {
  74. const data = await saleordersendrecordInfo(id);
  75. if (data) {
  76. this.info = data;
  77. this.info.sendId = this.info.id
  78. this.info.sendNo = this.info.docNo
  79. this.info.docNo = ''
  80. this.info.id = ''
  81. }
  82. },
  83. async handleSubmit() {
  84. if(!this.info.sendNo){
  85. uni.showModal({
  86. title: `请选择发货单`,
  87. content: '',
  88. icon: 'error',
  89. confirmText: '确认',
  90. showCancel: false, // 是否显示取消按钮,默认为 true
  91. })
  92. return
  93. }
  94. if(!this.info.repliedFiles.length){
  95. uni.showModal({
  96. title: `请上传回执附件`,
  97. content: '',
  98. icon: 'error',
  99. confirmText: '确认',
  100. showCancel: false, // 是否显示取消按钮,默认为 true
  101. })
  102. return
  103. }
  104. try{
  105. //后台不提供接口
  106. let id = await saleordersendconfirmSave(this.info)
  107. let data = await saleordersendconfirmInfo(id)
  108. let list = await processInstancePage({pageNo: 1,pageSize: 1,reset: true,key: 'sales_sendconfirm_approve'})
  109. let params = {
  110. businessId: data.id,
  111. businessKey : 'sales_sendconfirm_approve',
  112. formCreateUserId: data.createUserId,
  113. processDefinitionId: list?.list[0]?.processDefinition.id,
  114. variables: {
  115. businessCode: data.docNo
  116. },
  117. }
  118. await processInstanceCreateAPI(params)
  119. uni.showModal({
  120. title: `提交成功`,
  121. content: '',
  122. confirmText: '确认',
  123. showCancel: false, // 是否显示取消按钮,默认为 true
  124. success:()=> {
  125. this.back()
  126. }
  127. })
  128. }catch{
  129. }
  130. },
  131. handleInvoiceList() {
  132. uni.navigateTo({
  133. url: `/pages/invoiceConfirm/invoice`
  134. })
  135. },
  136. }
  137. }
  138. </script>
  139. <style lang="scss" scoped>
  140. .list-cell {
  141. display: flex;
  142. align-items: center;
  143. justify-content: space-between;
  144. color: $uni-text-color-grey;
  145. padding: 5rpx 20rpx;
  146. }
  147. .font-sm {
  148. font-size: $uni-font-size-sm;
  149. }
  150. .font-text {
  151. color: $uni-text-color;
  152. }
  153. .btn-execute {
  154. background-color: $j-primary-border-green;
  155. width: 450rpx;
  156. margin-top: 10vh;
  157. }
  158. .btn-sparepart {
  159. width: 450rpx;
  160. margin-top: 20rpx;
  161. }
  162. .btn-reassignment {
  163. color: $uni-color-error;
  164. background-color: transparent;
  165. border: none;
  166. box-shadow: none;
  167. &::after {
  168. display: none;
  169. }
  170. }
  171. .maintenance-container {
  172. position: fixed;
  173. top: 0;
  174. bottom: 0;
  175. width: 100vw;
  176. display: flex;
  177. flex-direction: column;
  178. /deep/.u-popup {
  179. flex: none !important;
  180. }
  181. }
  182. .maintenance-wrapper {
  183. position: relative;
  184. flex: 1;
  185. }
  186. .maintenance-content {
  187. padding-top: 40rpx;
  188. box-sizing: border-box;
  189. // height: calc(100vh - 88rpx);
  190. position: absolute;
  191. top: 0;
  192. bottom: 0;
  193. left: 0;
  194. right: 0;
  195. display: flex;
  196. flex-direction: column;
  197. }
  198. .kd-cell {
  199. line-height: 90rpx;
  200. border-bottom: 1px dashed #dadada;
  201. display: flex;
  202. justify-content: space-between;
  203. align-items: center;
  204. .kd-label {
  205. display: inline-block;
  206. width: 5em;
  207. font-weight: bold;
  208. }
  209. .kd-content {
  210. flex: 1;
  211. text-align: left;
  212. word-break: break-all;
  213. padding: 0 30rpx 0 0;
  214. }
  215. }
  216. .kd-baseInfo {
  217. padding: 0 32rpx;
  218. font-size: 28rpx;
  219. height: 70%;
  220. }
  221. .kd-equipment {
  222. flex: 1;
  223. display: flex;
  224. flex-direction: column;
  225. overflow: hidden;
  226. .kd-type-box {
  227. text-align: center;
  228. padding: 26rpx 0;
  229. view {
  230. position: relative;
  231. display: inline-block;
  232. width: 120rpx;
  233. padding: 4rpx 0;
  234. color: #747474;
  235. margin: 0 20rpx;
  236. background-color: rgba(215, 215, 215, 0.5);
  237. &.type—active {
  238. background-color: #1e7f35;
  239. color: #fff;
  240. }
  241. .count {
  242. position: absolute;
  243. top: -9px;
  244. right: -9px;
  245. width: 18px;
  246. height: 18px;
  247. border-radius: 50%;
  248. font-size: 12px;
  249. background-color: red;
  250. color: #fff;
  251. }
  252. }
  253. }
  254. .kd-list-container {
  255. flex: 1;
  256. display: flex;
  257. flex-direction: column;
  258. overflow: hidden;
  259. padding: 12rpx 18rpx;
  260. background-color: $page-bg;
  261. .u-list {
  262. flex: 1;
  263. height: 100% !important;
  264. }
  265. }
  266. }
  267. .spare-parts {
  268. flex: 1;
  269. overflow: hidden;
  270. }
  271. .kd-card {
  272. background-color: #fff;
  273. margin-bottom: 20rpx;
  274. padding: 8rpx 0;
  275. font-size: 28rpx;
  276. word-break: break-all;
  277. .kd-card-wrapper {
  278. padding: 0 30rpx;
  279. border-bottom: 1px solid #dadada;
  280. }
  281. .kd-cell {
  282. line-height: 60rpx;
  283. }
  284. .kd-cell:last-of-type {
  285. border-bottom: none;
  286. }
  287. .status-box {
  288. margin-right: 16rpx;
  289. }
  290. .card-footer {
  291. display: flex;
  292. justify-content: flex-end;
  293. align-items: center;
  294. padding: 8rpx 0 20rpx;
  295. button {
  296. width: 180rpx;
  297. height: 56rpx;
  298. line-height: 56rpx;
  299. font-size: 28rpx;
  300. margin: 0 8rpx;
  301. }
  302. .primary-btn {
  303. background-color: $j-primary-border-green;
  304. }
  305. }
  306. }
  307. .apply-box {
  308. width: 70%;
  309. margin: 0 auto;
  310. display: flex;
  311. align-items: center;
  312. justify-content: space-around;
  313. }
  314. .top-wrapper {
  315. background-color: #fff;
  316. display: flex;
  317. width: 750rpx;
  318. height: 88rpx;
  319. padding: 16rpx 0;
  320. align-items: center;
  321. gap: 16rpx;
  322. /deep/.uni-section {
  323. margin-top: 0px;
  324. }
  325. /deep/.uni-section-header {
  326. padding: 0px;
  327. }
  328. .search_btn {
  329. width: 120rpx;
  330. height: 70rpx;
  331. line-height: 70rpx;
  332. padding: 0 50rpx;
  333. background: $theme-color;
  334. font-size: 32rpx;
  335. color: #fff;
  336. margin: 0;
  337. margin-left: 26rpx;
  338. }
  339. .menu_icon {
  340. width: 44rpx;
  341. height: 44rpx;
  342. margin-left: 14rpx;
  343. }
  344. }
  345. .search_btn {
  346. width: 120rpx;
  347. height: 70rpx;
  348. padding: 0 24rpx;
  349. background: $theme-color;
  350. font-size: 32rpx;
  351. color: #fff;
  352. transform: translate(-25px, 0px);
  353. }
  354. </style>