index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view class="kd-card">
  3. <view class="card-title">
  4. <view class="">
  5. <text v-if="orderTitle" class="orderTitle">{{ orderTitle }}</text>
  6. <text>{{ title }}</text>
  7. </view>
  8. <text v-if="status" class="status" :class="statusListStyle[item.status]">
  9. {{ statusListOptions[item.status] }}
  10. </text>
  11. </view>
  12. <view @click="handleDetail">
  13. <view class="card-body">
  14. <view class="card-col">
  15. <text class="label">计划单号</text>
  16. <text class="content">{{ item.planCode }}</text>
  17. </view>
  18. <view class="card-col">
  19. <text class="label">计划名称</text>
  20. <text class="content">{{ item.planName }}</text>
  21. </view>
  22. <view class="card-col">
  23. <text class="label">盘点仓库</text>
  24. <text class="content">{{ item.warehouseName }}</text>
  25. </view>
  26. <view class="card-col">
  27. <text class="label">盘点部门</text>
  28. <text class="content">{{ item.executeGroupName }}</text>
  29. </view>
  30. <view class="card-col">
  31. <text class="label">盘点人员</text>
  32. <text class="content">{{ item.executorName }}</text>
  33. </view>
  34. <view class="card-col">
  35. <text class="label">计划开始时间</text>
  36. <text class="content">{{ item.startTime }}</text>
  37. </view>
  38. <view class="card-col">
  39. <text class="label">计划结束时间</text>
  40. <text class="content">{{ item.endTime }}</text>
  41. </view>
  42. </view>
  43. <view v-if="item.status == 0" class="card-footer borer-bottom" @click="goInventory">
  44. 报工
  45. <u-icon name="arrow-right"></u-icon>
  46. </view>
  47. <view class="card-footer" @click="goDetail">
  48. 详情
  49. <u-icon name="arrow-right"></u-icon>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import itemConfig from './config.js'
  56. import dictMixins from '@/mixins/dictMixins'
  57. export default {
  58. mixins: [dictMixins],
  59. props: {
  60. title: String,
  61. orderTitle: String,
  62. item: {
  63. type: Object,
  64. default: () => ({})
  65. },
  66. type: {
  67. type: String,
  68. required: true
  69. },
  70. status: {
  71. type: Boolean,
  72. default: false
  73. }
  74. },
  75. data() {
  76. return {
  77. statusListStyle: {
  78. 0: 'text-danger',
  79. 1: 'text-warning',
  80. 2: 'text-normal'
  81. },
  82. statusListOptions: {
  83. 0: '待处理',
  84. 1: '执行中',
  85. 2: '已完成'
  86. },
  87. dictOpt: {
  88. asset: {
  89. 1: {
  90. color: '#027DB4',
  91. backgroundColor: '#def5ff'
  92. },
  93. 2: {
  94. color: '#B8741A',
  95. backgroundColor: '#fef1e8'
  96. },
  97. 3: {
  98. color: '#A30014',
  99. backgroundColor: '#f9e5e7'
  100. },
  101. 4: {
  102. color: 'green',
  103. backgroundColor: '#67C23A'
  104. },
  105. 5: {
  106. color: '#a30014',
  107. backgroundColor: '#F56C6C'
  108. },
  109. 6: {
  110. color: '#f56c6c',
  111. backgroundColor: '#fbc4c4'
  112. },
  113. 7: {
  114. color: '#e6a23c',
  115. backgroundColor: '#fdf6ec'
  116. }
  117. }
  118. }
  119. }
  120. },
  121. created() {
  122. // this.requestDict('物品类型')
  123. },
  124. computed: {
  125. colOptions() {
  126. return (
  127. itemConfig[this.type] || [
  128. { label: '单号', key: 'workOrderCode' },
  129. { label: '申请人', key: 'applicantName' },
  130. { label: '申请时间', key: 'createTime' }
  131. ]
  132. )
  133. }
  134. },
  135. methods: {
  136. // 报工
  137. goInventory() {
  138. let par = this.URLSearchParams({
  139. id: this.item.id,
  140. status: this.item.status
  141. })
  142. uni.navigateTo({
  143. url: '/pages/warehouse/workOrder/inventory/inventory?' + par
  144. })
  145. },
  146. // 详情
  147. goDetail() {
  148. let par = {
  149. id: this.item.id,
  150. planId: this.item.planId
  151. }
  152. par = this.URLSearchParams(par)
  153. uni.navigateTo({
  154. url: '/pages/warehouse/workOrder/details/details?' + par
  155. })
  156. },
  157. handleDetail() {
  158. this.$emit('handleDetail', this.item)
  159. }
  160. }
  161. }
  162. </script>
  163. <style lang="scss" scoped>
  164. .kd-card {
  165. font-size: 28rpx;
  166. color: #333;
  167. background-color: #fff;
  168. border-radius: 8rpx;
  169. word-break: break-all;
  170. .status {
  171. font-weight: normal;
  172. }
  173. .card-title {
  174. font-weight: bold;
  175. }
  176. .card-footer,
  177. .card-title {
  178. display: flex;
  179. justify-content: space-between;
  180. padding: 12rpx 16rpx;
  181. }
  182. .borer-bottom {
  183. border-bottom: 1px solid #f2f2f2;
  184. }
  185. .card-body {
  186. padding: 0 28rpx;
  187. border-top: 1rpx solid #f2f2f2;
  188. border-bottom: 1rpx solid #f2f2f2;
  189. position: relative;
  190. .asset {
  191. position: absolute;
  192. top: 5rpx;
  193. padding: 4rpx 8rpx;
  194. right: 20rpx;
  195. }
  196. .card-col {
  197. padding: 8rpx 0;
  198. display: flex;
  199. // line-height: ;
  200. .label {
  201. display: inline-block;
  202. width: 6em;
  203. color: #555;
  204. text-align: right;
  205. margin-right: 14rpx;
  206. }
  207. .content {
  208. flex: 1;
  209. }
  210. }
  211. }
  212. }
  213. .orderTitle {
  214. color: #4b7902;
  215. margin-right: 10rpx;
  216. }
  217. </style>