addBacklog.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="back-body">
  3. <view class="back-content">
  4. <!-- 轮播图 -->
  5. <swiper v-if="backlogPhotoList.length" class="top-ad-swiper" :indicator-dots="false" :autoplay="true" :interval="5000" :duration="600" :circular="true">
  6. <swiper-item v-for="(item,index) in backlogPhotoList" :key="index">
  7. <div class="swiper-item uni-bg-red">
  8. <u-image mode="scaleToFill" width="750upx" height="400upx" :src="item"></u-image>
  9. </div>
  10. </swiper-item>
  11. </swiper>
  12. <view v-else class="paizhao">
  13. <view class="icon" @click="takePhone">
  14. <u-icon name="xianchangpaishe" custom-prefix="xd-icon" size="64" color="#888888"></u-icon>
  15. </view>
  16. </view>
  17. <u-form class="form-content" :model="form" ref="uForm" label-width="180">
  18. <u-form-item label="门店" prop="storeName">
  19. <u-input @click="chooseStore" input-align="right" v-model="form.storeName" disabled placeholder="请选择门店" />
  20. <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
  21. </u-form-item>
  22. <u-form-item label="考评指标" prop="clsName">
  23. <u-input @click="chooseClsName" input-align="right" v-model="form.clsName" disabled placeholder="请选择考评指标" />
  24. <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
  25. </u-form-item>
  26. <u-form-item label="抄送人" prop="receiveUser">
  27. <u-input input-align="right" v-model="form.clsName" disabled placeholder="请选择抄送人" />
  28. <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
  29. </u-form-item>
  30. <u-form-item label="整改到期日" prop="effectiveEndTime" >
  31. <u-input @click="showPicker=true" input-align="right" v-model="form.effectiveEndTime" disabled placeholder="请选择整改到期日" />
  32. <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
  33. </u-form-item>
  34. </u-form>
  35. <view class="remarks">
  36. <u-input v-model="remarks" type="textarea" placeholder="请输入备注..." />
  37. </view>
  38. </view>
  39. <u-button class="save-btn" type="primary">保存</u-button>
  40. <!-- 时间选择器 -->
  41. <w-picker
  42. class="date-picker"
  43. :visible.sync="showPicker"
  44. mode="date"
  45. :current="true"
  46. fields="day"
  47. :value="form.effectiveEndTime"
  48. @confirm="onSelected($event,'date')"
  49. @cancel="showPicker=false"
  50. ref="date"
  51. ></w-picker>
  52. </view>
  53. </template>
  54. <script>
  55. import MxDatePicker from "@/components/mx-datepicker/mx-datepicker.vue"
  56. export default {
  57. components: {
  58. MxDatePicker
  59. },
  60. data() {
  61. return {
  62. // 顶部轮播图片
  63. backlogPhotoList:[],
  64. showPicker: false, // 是否显示时间弹窗
  65. form: {
  66. storeName: '', // 门店
  67. storeId: '', // 门店id
  68. clsName: '',// 考评指标
  69. putUser: '', // 处理人
  70. receiveUser: '', // 抄送人
  71. effectiveEndTime: '' // 整改到期日
  72. },
  73. storeSelected : [], // 已选门店
  74. remarks: '' // 备注
  75. }
  76. },
  77. onLoad(option) {
  78. uni.$on('selKpStores',this.setStore)
  79. },
  80. methods: {
  81. // 获取选择门店
  82. setStore (data) {
  83. console.log(data,'eeeeeeee')
  84. this.storeSelected = data
  85. this.form.storeName = this.storeSelected[0].name
  86. this.form.storeId = this.storeSelected[0].id
  87. console.log(this.storeSelected,this.form.storeName,'2222222')
  88. },
  89. // 拍照 或从相册选相片
  90. takePhone () {
  91. let _this = this
  92. uni.chooseImage({
  93. count: 6, //默认9
  94. success: function (res) {
  95. console.log(JSON.stringify(res.tempFilePaths));
  96. _this.backlogPhotoList = res.tempFilePaths
  97. }
  98. })
  99. },
  100. // 确认日期选择
  101. onSelected (v) {
  102. console.log(v,'vvvvvvvv')
  103. this.form.effectiveEndTime = v.value
  104. this.showPicker = false
  105. },
  106. // 选择门店
  107. chooseStore () {
  108. uni.navigateTo({
  109. url: `/pages/spotCheckConfigure/evaluateStore?type=${'radio'}&item=${encodeURIComponent(JSON.stringify(this.storeSelected))}`
  110. })
  111. },
  112. // 选择考评指标
  113. chooseClsName () {
  114. uni.navigateTo({
  115. url: '/pages/spotCheckConfigure/evaluateItem'
  116. })
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .back-body {
  123. height: 100%;
  124. background-color: #eee;
  125. display: flex;
  126. flex-direction: column;
  127. .back-content {
  128. flex: 1;
  129. overflow-y: scroll;
  130. }
  131. .paizhao {
  132. background-color: #fff;
  133. height: 340upx;
  134. display: flex;
  135. align-items: center;
  136. justify-content: center;
  137. .icon{
  138. width: 160upx;
  139. height: 160upx;
  140. border: 1px solid #eee;
  141. display: flex;
  142. align-items: center;
  143. justify-content: center;
  144. }
  145. }
  146. .text-right {
  147. text-align: right;
  148. }
  149. .top-ad-swiper{
  150. background-color: #fff;
  151. height: 340upx;
  152. }
  153. .swiper-item-imgse{
  154. width: 750upx;
  155. height: 340upx;
  156. }
  157. .form-content{
  158. background-color: #fff;
  159. padding: 0 30upx;
  160. }
  161. .remarks{
  162. background-color: #fff;
  163. padding: 0 30upx;
  164. margin-top: 20upx;
  165. }
  166. .save-btn{
  167. width: 90%;
  168. margin-bottom: 20upx;
  169. }
  170. }
  171. </style>