succession.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <view class="checkSubmit">
  3. <view class="form-box" style="margin:0 30rpx">
  4. <uni-forms ref="baseForm" :modelValue="formData" label-position="left">
  5. <view class="commons-title">
  6. 交班人员
  7. </view>
  8. <uni-forms-item label="交班人员">
  9. <view style="padding-top:18rpx"><span v-for="(i) in userName">{{i}}</span> </view>
  10. </uni-forms-item>
  11. <view class="commons-title">
  12. 转班明细
  13. </view>
  14. <view style="border-bottom: 1rpx solid #000;" v-for="(i,index) in listData" :key="i.qrCode">
  15. <uni-forms-item label="物料名称" >
  16. <view style="padding-top:18rpx">{{i.materialName}}</view>
  17. </uni-forms-item>
  18. <uni-forms-item label="称重结果" >
  19. <view style="padding-top:18rpx">{{i.weighingResults}}kg</view>
  20. </uni-forms-item>
  21. <uni-forms-item label="有无外包装" >
  22. <view style="padding-top:18rpx">{{i.outerPackaging ? '有' : '无'}}</view>
  23. </uni-forms-item>
  24. <uni-forms-item label="有无卷芯" >
  25. <view style="padding-top:18rpx">{{i.convolution ? '有' : '无'}}</view>
  26. </uni-forms-item>
  27. </view>
  28. </uni-forms>
  29. </view>
  30. <view class="submit-box">
  31. <view class="" style="line-height: 80rpx;text-align: center;">
  32. 本次转班:{{listData.length}} 件
  33. </view>
  34. <button @click="shiftChange" style="background: #0066CC;color:#fff;margin-bottom: 30rpx;">提交</button>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import {
  40. getInfo
  41. } from "@/util/api.js";
  42. import Vue from 'vue'
  43. import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue'
  44. import {
  45. dateFormat,
  46. getTime
  47. } from '../../util/uitl.js'
  48. export default {
  49. components: {
  50. htzImageUpload,
  51. },
  52. data() {
  53. return {
  54. formData: {
  55. },
  56. userName:[],
  57. listData:[],
  58. req:{
  59. shiftChangeId:null,
  60. },
  61. }
  62. },
  63. onLoad(option) {
  64. const v = this
  65. uni.getStorage({
  66. key: "userInfo",
  67. success(_data) {
  68. v.req.shiftChangeId = _data.data.id
  69. v.getData()
  70. },
  71. fail() {
  72. }
  73. })
  74. },
  75. methods: {
  76. shiftChange(){
  77. const v = this
  78. if(v.listData.length == 0){
  79. uni.showToast({
  80. icon:'none',
  81. title: '暂无交接信息',
  82. duration: 2000
  83. });
  84. return
  85. }
  86. v.$post("/mgr/shiftChange/updateShift",v.req).then(res=>{
  87. if(res.code == 200){
  88. uni.showToast({
  89. title:'接班成功,跳转中!'
  90. })
  91. setTimeout(()=>{
  92. wx.reLaunch({
  93. url: '/pages/home'
  94. })
  95. },1000)
  96. }
  97. })
  98. },
  99. getData(){
  100. const v = this
  101. v.$post('/mgr/shiftChange/selectSuccession',v.req).then(res=>{
  102. if(res.code == 200){
  103. for (var i = 0; i < res.data.length; i++) {
  104. v.userName.push(res.data[i].nickName)
  105. }
  106. v.userName = [...new Set(v.userName)]
  107. if(res.data.length != 0 ){
  108. v.listData = res.data
  109. }
  110. }
  111. })
  112. },
  113. switchChange(){
  114. },
  115. bindPickerChange2(){
  116. },
  117. imgDelete(_index){
  118. const v = this
  119. v.imgs.splice(_index,1)
  120. },
  121. zidingyiSuccess() {
  122. },
  123. checkSubmit(_type) {
  124. const v = this
  125. v.formData.checkJudgment = _type
  126. v.$post('/wx/check/temp',v.formData).then(res=>{
  127. if(res.code == 200){
  128. uni.showToast({
  129. title: '提交成功,跳转中!'
  130. })
  131. setTimeout(() => {
  132. wx.reLaunch({
  133. url: '/pages/check/checkDtl?data=' + encodeURIComponent(JSON.stringify(v.optionCopy))
  134. })
  135. }, 2000)
  136. }
  137. })
  138. },
  139. select(e) {
  140. console.log(e)
  141. const v = this
  142. v.$post('/wx/common/uploadFile', {
  143. file: e.tempFilePaths[0]
  144. }).then(res => {
  145. })
  146. },
  147. },
  148. }
  149. </script>
  150. <style lang="less">
  151. .checkSubmit {
  152. .submit-box {
  153. padding: 0 30rpx;
  154. }
  155. .dtl {
  156. padding: 30rpx;
  157. border-bottom: 1rpx solid #dcdcdc;
  158. font-size: 26rpx;
  159. line-height: 40rpx;
  160. }
  161. .addQrcode-list {
  162. height: 80rpx;
  163. display: flex;
  164. justify-content: space-between;
  165. padding: 15rpx;
  166. border-bottom: 1rpx solid #dcdcdc;
  167. font-size: 24rpx;
  168. .fl {
  169. display: flex;
  170. .code {
  171. margin-right: 20rpx;
  172. }
  173. }
  174. .fr {
  175. line-height: 80rpx;
  176. }
  177. }
  178. }
  179. .popup-input-warp {
  180. padding: 30rpx 40rpx;
  181. }
  182. .txt {
  183. margin-bottom: 20rpx;
  184. }
  185. .imglist {
  186. display: flex;
  187. flex-wrap: wrap;
  188. }
  189. .imglist .item {
  190. width: 150rpx;
  191. height: 150rpx;
  192. margin-right: 22rpx;
  193. margin-bottom: 10rpx;
  194. position: relative;
  195. }
  196. .imglist .last-item {
  197. width: 150rpx;
  198. height: 150rpx;
  199. text-align: center;
  200. line-height: 146rpx;
  201. border: 2rpx dashed #8B97A9;
  202. box-sizing: border-box;
  203. }
  204. .imglist .item image {
  205. width: 100%;
  206. height: 100%;
  207. }
  208. .imglist .item .delete {
  209. width: 30rpx;
  210. height: 30rpx;
  211. position: absolute;
  212. top: -25rpx;
  213. right: -12rpx;
  214. font-size: 40rpx;
  215. font-weight: bold;
  216. }
  217. </style>