addBacklog.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. export default {
  56. components: {
  57. },
  58. data() {
  59. return {
  60. // 顶部轮播图片
  61. backlogPhotoList:[],
  62. showPicker: false, // 是否显示时间弹窗
  63. form: {
  64. storeName: '', // 门店
  65. storeId: '', // 门店id
  66. clsName: '',// 考评指标
  67. putUser: '', // 处理人
  68. receiveUser: '', // 抄送人
  69. effectiveEndTime: '' // 整改到期日
  70. },
  71. storeSelected : [], // 已选门店
  72. remarks: '' // 备注
  73. }
  74. },
  75. onLoad(option) {
  76. uni.$on('selKpStores',this.setStore)
  77. },
  78. methods: {
  79. // 获取选择门店
  80. setStore (data) {
  81. console.log(data,'eeeeeeee')
  82. this.storeSelected = data
  83. this.form.storeName = this.storeSelected[0].name
  84. this.form.storeId = this.storeSelected[0].id
  85. console.log(this.storeSelected,this.form.storeName,'2222222')
  86. },
  87. // 拍照 或从相册选相片
  88. takePhone () {
  89. let _this = this
  90. uni.chooseImage({
  91. count: 6, //默认9
  92. success: function (res) {
  93. console.log(JSON.stringify(res.tempFilePaths));
  94. _this.backlogPhotoList = res.tempFilePaths
  95. }
  96. })
  97. },
  98. // 确认日期选择
  99. onSelected (v) {
  100. console.log(v,'vvvvvvvv')
  101. this.form.effectiveEndTime = v.value
  102. this.showPicker = false
  103. },
  104. // 选择门店
  105. chooseStore () {
  106. uni.navigateTo({
  107. url: `/pages/spotCheckConfigure/evaluateStore?type=${'radio'}&item=${encodeURIComponent(JSON.stringify(this.storeSelected))}`
  108. })
  109. },
  110. // 选择考评指标
  111. chooseClsName () {
  112. uni.navigateTo({
  113. url: '/pages/spotCheckConfigure/evaluateItem'
  114. })
  115. }
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. .back-body {
  121. height: 100%;
  122. background-color: #eee;
  123. display: flex;
  124. flex-direction: column;
  125. .back-content {
  126. flex: 1;
  127. overflow-y: scroll;
  128. }
  129. .paizhao {
  130. background-color: #fff;
  131. height: 340upx;
  132. display: flex;
  133. align-items: center;
  134. justify-content: center;
  135. .icon{
  136. width: 160upx;
  137. height: 160upx;
  138. border: 1px solid #eee;
  139. display: flex;
  140. align-items: center;
  141. justify-content: center;
  142. }
  143. }
  144. .text-right {
  145. text-align: right;
  146. }
  147. .top-ad-swiper{
  148. background-color: #fff;
  149. height: 340upx;
  150. }
  151. .swiper-item-imgse{
  152. width: 750upx;
  153. height: 340upx;
  154. }
  155. .form-content{
  156. background-color: #fff;
  157. padding: 0 30upx;
  158. }
  159. .remarks{
  160. background-color: #fff;
  161. padding: 0 30upx;
  162. margin-top: 20upx;
  163. }
  164. .save-btn{
  165. width: 90%;
  166. margin-bottom: 20upx;
  167. }
  168. }
  169. </style>