report-add.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <view class="container qualifications" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0' }">
  3. <view class="remarks-content">
  4. <template v-if="handleType === '1'">
  5. <view class="list-view-title">
  6. <view class="list-view-h1">机构名称:<text class="none">蔡欣欣夕是大街上的按键上的</text></view>
  7. </view>
  8. <view class="list-view-title">
  9. <view class="list-view-h1">联系人:<text class="none">欧特是</text></view>
  10. </view>
  11. </template>
  12. <template v-else>
  13. <view class="list-view-title">
  14. <view class="list-view-h1">咨询人:<text class="none">阿萨德对方水电费</text></view>
  15. </view>
  16. </template>
  17. <view class="list-view-title"> <view class="list-view-h1">报备商品:</view> </view>
  18. <view class="tui-remarks-content">
  19. <view class="tui-remarks-goods-input" v-if="handleGoods.length === 0" @click="handleShowGoodPopup">
  20. <view class="input-add"> <text class="iconfont icon-jiahao"></text> </view>
  21. <view class="input-text"> 点击添加客户咨询的商品 </view>
  22. </view>
  23. <view class="tui-remarks-showgoods" v-else>
  24. <view class="tui-remarks-goods" v-for="(pros, index) in handleGoods" :key="index">
  25. <view class="goods-image"> <image :src="pros.images" mode=""></image> </view>
  26. <view class="goods-main">
  27. <view class="name"> {{ pros.name }} </view>
  28. <view class="shop"> 供应商:{{ pros.shopName }} </view>
  29. </view>
  30. </view>
  31. <view class="tui-remarks-btn">
  32. <view class="btn delete" @click="handleClean">删除</view>
  33. <view class="btn update" @click="handleShowGoodPopup">更换</view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="list-view-title">
  38. <view class="list-view-h1"><text>*</text>报备事由:</view>
  39. </view>
  40. <view class="remarks-textarea">
  41. <textarea
  42. class="textarea"
  43. v-model="remarksParams.extra"
  44. value=""
  45. placeholder="请输入其他需要说明的内容"
  46. maxlength="200"
  47. @input="conInput"
  48. />
  49. <text class="limit-text">{{ min }}/{{ max }}</text>
  50. </view>
  51. </view>
  52. <!-- 商品列表弹窗 -->
  53. <cm-goodspopup
  54. ref="cmgoodspopup"
  55. v-if="isGoodspopup"
  56. :show="isGoodspopup"
  57. @handleChoiceaGoods="handleChoiceaGoodsData"
  58. >
  59. </cm-goodspopup>
  60. </view>
  61. </template>
  62. <script>
  63. import { mapState, mapMutations } from 'vuex'
  64. import authorize from '@/common/config/authorize.js'
  65. import cmGoodspopup from '@/components/cm-module/cm-seller/cm-goods-popup'
  66. export default {
  67. components: {
  68. cmGoodspopup
  69. },
  70. data() {
  71. return {
  72. isIphoneX: this.$store.state.isIphoneX,
  73. min: 0,
  74. max: 200,
  75. isGoodspopup: false,
  76. handleGoods: [],
  77. handleType:'',// 1 机构添加报备 2 未注册客户添加报备
  78. remarksParams: {},
  79. remarksId: 0
  80. }
  81. },
  82. onLoad(option) {
  83. console.log(option)
  84. this.remarksId = option.remarksId
  85. this.handleType = option.type
  86. this.getUserRemarksVisitDetail()
  87. },
  88. methods: {
  89. ...mapMutations(['login']),
  90. getUserRemarksVisitDetail() {
  91. //资料详情
  92. this.UserService.getUserRemarksVisitDetail({
  93. remarksId: this.remarksId
  94. })
  95. .then(response => {
  96. this.remarksParams = response.data
  97. })
  98. .catch(error => {
  99. this.$util.msg(error.msg, 2000)
  100. })
  101. },
  102. handleShowGoodPopup() {
  103. // 显示添加商品弹窗
  104. this.isGoodspopup = true
  105. },
  106. handleClean(){//删除选择的商品
  107. this.handleGoods = []
  108. },
  109. handleChoiceaGoodsData(data) {
  110. console.log('data', data)
  111. this.handleGoods = []
  112. this.handleGoods.push(data)
  113. },
  114. conInput(e) {
  115. //备注文字字数限制
  116. let value = e.detail.value
  117. let len = parseInt(value.length)
  118. if (len > this.max) return
  119. this.min = len
  120. if (this.min == 200) {
  121. this.$util.msg('您输入的字数已达上限', 2000)
  122. }
  123. }
  124. },
  125. onShow() {}
  126. }
  127. </script>
  128. <style lang="scss">
  129. page {
  130. height: auto;
  131. background: #ffffff;
  132. }
  133. .remarks-content {
  134. width: 100%;
  135. height: auto;
  136. box-sizing: border-box;
  137. padding: 0 24rpx;
  138. padding-bottom: 80rpx;
  139. .list-view-title {
  140. width: 100%;
  141. height: auto;
  142. margin-bottom: 16rpx;
  143. margin-top: 40rpx;
  144. .list-view-h1 {
  145. line-height: 40rpx;
  146. font-size: $font-size-30;
  147. color: #333333;
  148. text-align: left;
  149. font-weight: bold;
  150. text {
  151. color: #ff2a2a;
  152. &.none{
  153. color: #999999;
  154. font-weight: normal;
  155. }
  156. }
  157. }
  158. }
  159. .remarks-textarea {
  160. width: 100%;
  161. height: 226rpx;
  162. padding: 16rpx;
  163. margin: 20rpx 0 0 0;
  164. border-radius: 6rpx;
  165. position: relative;
  166. border: 1px solid #b2b2b2;
  167. box-sizing: border-box;
  168. .textarea {
  169. width: 100%;
  170. height: 100%;
  171. line-height: 36rpx;
  172. font-size: $font-size-26;
  173. color: $text-color;
  174. z-index: 1;
  175. }
  176. .limit-text {
  177. position: absolute;
  178. right: 20rpx;
  179. bottom: 16rpx;
  180. line-height: 44rpx;
  181. font-size: $font-size-24;
  182. color: #b2b2b2;
  183. }
  184. }
  185. .tui-remarks-content {
  186. width: 100%;
  187. height: auto;
  188. margin-bottom: 24rpx;
  189. .tui-remarks-goods-input {
  190. width: 100%;
  191. height: 180rpx;
  192. box-sizing: border-box;
  193. background-color: #f7f7f7;
  194. padding: 26rpx;
  195. border-radius: 6rpx;
  196. .input-add {
  197. width: 128rpx;
  198. height: 128rpx;
  199. line-height: 128rpx;
  200. float: left;
  201. text-align: center;
  202. box-sizing: border-box;
  203. border: 1px dashed #b2b2b2;
  204. border-radius: 6rpx;
  205. .iconfont {
  206. font-size: 44rpx;
  207. color: #b2b2b2;
  208. }
  209. }
  210. .input-text {
  211. height: 128rpx;
  212. box-sizing: border-box;
  213. padding: 0 32rpx;
  214. line-height: 128rpx;
  215. text-align: left;
  216. font-size: 26rpx;
  217. color: #b2b2b2;
  218. float: left;
  219. }
  220. }
  221. .tui-remarks-showgoods {
  222. width: 100%;
  223. height: 180rpx;
  224. box-sizing: border-box;
  225. .tui-remarks-btn {
  226. width: 90rpx;
  227. height: 180rpx;
  228. float: right;
  229. .btn {
  230. width: 100%;
  231. height: 90rpx;
  232. float: left;
  233. line-height: 90rpx;
  234. text-align: center;
  235. font-size: 26rpx;
  236. &.delete {
  237. color: #f94b4b;
  238. }
  239. &.update {
  240. color: #1890f9;
  241. }
  242. }
  243. }
  244. .tui-remarks-goods {
  245. width: 612rpx;
  246. height: 180rpx;
  247. box-sizing: border-box;
  248. background-color: #f7f7f7;
  249. padding: 26rpx;
  250. border-radius: 6rpx;
  251. float: left;
  252. .goods-image {
  253. width: 128rpx;
  254. height: 128rpx;
  255. float: left;
  256. image {
  257. width: 128rpx;
  258. height: 128rpx;
  259. display: block;
  260. border-radius: 4rpx;
  261. }
  262. }
  263. .goods-main {
  264. width: 432rpx;
  265. height: 128rpx;
  266. box-sizing: border-box;
  267. padding-left: 32rpx;
  268. float: right;
  269. .name {
  270. width: 100%;
  271. height: 60rpx;
  272. box-sizing: border-box;
  273. line-height: 60rpx;
  274. color: #333333;
  275. text-overflow: ellipsis;
  276. overflow: hidden;
  277. display: -webkit-box;
  278. -webkit-line-clamp: 1;
  279. line-clamp: 1;
  280. -webkit-box-orient: vertical;
  281. font-size: 26rpx;
  282. }
  283. .shop {
  284. line-height: 60rpx;
  285. color: #999999;
  286. font-size: 26rpx;
  287. text-overflow: ellipsis;
  288. overflow: hidden;
  289. display: -webkit-box;
  290. -webkit-line-clamp: 1;
  291. line-clamp: 1;
  292. -webkit-box-orient: vertical;
  293. }
  294. }
  295. }
  296. }
  297. }
  298. .list-view {
  299. width: 100%;
  300. height: auto;
  301. margin-top: 20rpx;
  302. .list-view-text {
  303. width: 100%;
  304. float: left;
  305. .input {
  306. width: 500rpx;
  307. height: 50rpx;
  308. box-sizing: border-box;
  309. line-height: 50rpx;
  310. color: #333333;
  311. text-overflow: ellipsis;
  312. overflow: hidden;
  313. display: -webkit-box;
  314. -webkit-line-clamp: 1;
  315. line-clamp: 1;
  316. -webkit-box-orient: vertical;
  317. float: left;
  318. font-size: 26rpx;
  319. }
  320. .delbtn {
  321. width: 96rpx;
  322. height: 44rpx;
  323. border-radius: 8rpx;
  324. font-size: $font-size-24;
  325. color: #e15616;
  326. line-height: 44rpx;
  327. text-align: center;
  328. float: left;
  329. &.down {
  330. color: #1890f9;
  331. }
  332. }
  333. }
  334. }
  335. }
  336. </style>