bottomOperate.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <view class="bottom_box">
  3. <view class="nav_box rx-cc" @click="open">
  4. <image class="open_icon" :class="{open_icon_reversal : isOperate}" src="~@/static/pda/open.svg"></image>
  5. </view>
  6. <view class="operate_list" v-show="isOperate">
  7. <view v-for="(item, index) in btnList[btnState]" :key="index" class="list rx-bc"
  8. @click="operate(item.type, item)">
  9. <view class="round">{{index + 1}}</view>
  10. <view class="name">{{item.name}}</view>
  11. <image class="arrow_right" src="~@/static/pda/arrow_right.svg"></image>
  12. </view>
  13. </view>
  14. <view class="btn_box">
  15. <view class="btn">暂停</view>
  16. <view class="btn">终止</view>
  17. <view class="btn">转派</view>
  18. <view class="btn" @click="handOutsource()">委外</view>
  19. </view>
  20. <SearchPopup mode="center" v-if="outsourceShow">
  21. <template v-slot:list>
  22. <view class="popup_list">
  23. <view class="title">【{{taskObj.currentTaskName}}】是否委外</view>
  24. <u-form labelPosition="left" :model="outsourceForm" labelWidth="180" labelAlign="left" class="">
  25. <u-form-item label="委外数量:" borderBottom prop="num">
  26. <input class="uni-input" v-model="outsourceForm.formedNumLast" type='number'
  27. disabled></input>
  28. </u-form-item>
  29. <u-form-item label="完成时间:" borderBottom prop="time">
  30. <picker mode="date" :value="outsourceForm.date" @change="onDateChange">
  31. <view class="uni-input">{{ outsourceForm.date || '选择日期' }}</view>
  32. </picker>
  33. </u-form-item>
  34. </u-form>
  35. </view>
  36. </template>
  37. <template v-slot:operate>
  38. <view class="operate_box rx-bc">
  39. <u-button size="small" class="u-reset-button" @click="outCancel">
  40. 取消
  41. </u-button>
  42. <u-button type="success" size="small" class="u-reset-button" @click="outsourceOk">
  43. 确定
  44. </u-button>
  45. </view>
  46. </template>
  47. </SearchPopup>
  48. </view>
  49. </template>
  50. <script>
  51. import {
  52. getTwoTreeByPid,
  53. checkOutsource
  54. } from '@/api/pda/workOrder.js'
  55. import SearchPopup from './searchPopup.vue'
  56. export default {
  57. components: {
  58. SearchPopup
  59. },
  60. props: {
  61. state: String | Number,
  62. taskObj: Object
  63. },
  64. watch: {
  65. btns: {
  66. immediate: true,
  67. deep: true,
  68. handler(newVal) {
  69. this.btnsList = []
  70. this.btnsList = newVal
  71. }
  72. },
  73. state: {
  74. immediate: true,
  75. deep: true,
  76. handler(newVal) {
  77. this.btnState = newVal
  78. }
  79. },
  80. taskObj: {
  81. immediate: true,
  82. deep: true,
  83. handler(newVal) {
  84. this.newTaskObj = newVal
  85. }
  86. }
  87. },
  88. data() {
  89. return {
  90. isOperate: false,
  91. btnsList: [],
  92. btnState: 1,
  93. btnList: {
  94. 1: [{
  95. name: '领料',
  96. type: 'picking'
  97. },
  98. {
  99. name: '投料',
  100. type: 'feeding'
  101. },
  102. {
  103. name: '报工',
  104. type: 'jobBooking'
  105. },
  106. {
  107. name: '更换周转车',
  108. type: 'turnover'
  109. },
  110. ],
  111. 2: [{
  112. name: '取样',
  113. type: 'sample'
  114. },
  115. {
  116. name: '报工',
  117. type: 'sampleJob'
  118. },
  119. ],
  120. 3: [{
  121. name: '报工',
  122. type: 'inspection'
  123. }, ],
  124. 4: [{
  125. name: '领料',
  126. type: 'picking'
  127. },
  128. {
  129. name: '投料',
  130. type: 'feeding'
  131. },
  132. {
  133. name: '报工',
  134. type: 'jobBooking'
  135. },
  136. ],
  137. 5: [{
  138. name: '入库',
  139. type: 'warehousing'
  140. },
  141. ],
  142. },
  143. newTaskObj: {},
  144. outsourceShow: false,
  145. outsourceForm: {}
  146. }
  147. },
  148. created() {
  149. this.getTwoTree()
  150. },
  151. methods: {
  152. getTwoTree() {
  153. getTwoTreeByPid(12).then(res => {
  154. let _arr = res.map(m => {
  155. m.type = 'inspection'
  156. return m
  157. })
  158. this.btnList[3] = []
  159. this.btnList[3] = [
  160. ..._arr,
  161. {
  162. name: '报工',
  163. type: 'inspectionJob'
  164. }
  165. ]
  166. })
  167. },
  168. open() {
  169. this.isOperate = !this.isOperate
  170. },
  171. operate(type, item) {
  172. this.$emit('operate', type, item)
  173. },
  174. handOutsource() {
  175. let param = {
  176. taskId: this.newTaskObj.currentTaskId,
  177. workOrderId: this.newTaskObj.workOrderId
  178. }
  179. checkOutsource(param).then(res => {
  180. this.outsourceForm.formedNumLast = res.formedNumLast
  181. if (res.outsource) {
  182. this.outsourceShow = true
  183. } else {
  184. uni.showToast({
  185. title: '此工序不能委外',
  186. icon: 'none'
  187. })
  188. }
  189. })
  190. },
  191. outCancel() {
  192. this.outsourceShow = false
  193. },
  194. onDateChange: function(e) {
  195. this.outsourceForm.date = e.detail.value;
  196. this.$forceUpdate()
  197. },
  198. outsourceOk() {},
  199. }
  200. }
  201. </script>
  202. <style lang="scss" scoped>
  203. .bottom_box {
  204. background: #fff;
  205. }
  206. .nav_box {
  207. width: 750rpx;
  208. height: 40rpx;
  209. background: $theme-color;
  210. .open_icon {
  211. width: 48rpx;
  212. height: 48rpx;
  213. }
  214. .open_icon_reversal {
  215. transform: scaleY(-1);
  216. /* 垂直翻转 */
  217. }
  218. }
  219. .operate_list {
  220. margin: 0 32rpx;
  221. .list {
  222. border-radius: 8rpx;
  223. border: 1rpx solid $theme-color;
  224. background: #F0F8F2;
  225. height: 64rpx;
  226. padding: 0rpx 16rpx;
  227. margin-top: 16rpx;
  228. }
  229. .round {
  230. width: 32rpx;
  231. height: 32rpx;
  232. line-height: 32rpx;
  233. text-align: center;
  234. border-radius: 50%;
  235. background: $theme-color;
  236. font-size: 24rpx;
  237. font-style: normal;
  238. font-weight: 400;
  239. color: #fff;
  240. }
  241. .name {
  242. font-family: PingFang HK;
  243. font-size: 24rpx;
  244. font-style: normal;
  245. font-weight: 600;
  246. color: $theme-color;
  247. }
  248. .arrow_right {
  249. width: 32rpx;
  250. height: 32rpx;
  251. }
  252. }
  253. .btn_box {
  254. display: flex;
  255. padding: 16rpx 32rpx;
  256. align-items: flex-start;
  257. gap: 16rpx;
  258. align-self: stretch;
  259. .btn {
  260. width: 160rpx;
  261. height: 64rpx;
  262. line-height: 64rpx;
  263. background: $theme-color;
  264. text-align: center;
  265. border-radius: 8rpx;
  266. color: #fff;
  267. font-family: PingFang HK;
  268. font-size: 24rpx;
  269. font-style: normal;
  270. font-weight: 600;
  271. }
  272. }
  273. .operate_box {
  274. padding: 10rpx 60rpx;
  275. /deep/ .u-button {
  276. width: 160rpx;
  277. }
  278. }
  279. .popup_list {
  280. width: 65vw;
  281. min-height: 300rpx;
  282. padding: 0 32rpx;
  283. .title {
  284. color: #333;
  285. font-size: 28rpx;
  286. text-align: center;
  287. padding: 30rpx;
  288. }
  289. }
  290. </style>