铝交易,微信公众号
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

533 lines
12 KiB

1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
1 year ago
11 months ago
1 year ago
10 months ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
1 year ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
1 year ago
  1. <template>
  2. <view class="page">
  3. <navbar :title="titleList[titleIndex]" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="frame">
  5. <view class="title">
  6. <span
  7. style="width: 10rpx;height: 40rpx;background-color: #1f1c39;border-radius: 10rpx;overflow: hidden;"></span>
  8. <span>{{ $t('other.aluminumProducts') }}</span>
  9. </view>
  10. <view class="basic-info">
  11. <!--供应商名称-->
  12. <!-- <view v-if="titleIndex == 1" class="item">
  13. <view>{{ $t('other.supplierName') }}</view>
  14. <view>华南铝业有限公司</view>
  15. </view> -->
  16. <!--商品主图-->
  17. <view class="item">
  18. <view>商品主图</view>
  19. <view class="">
  20. <uv-upload
  21. :fileList="fileList"
  22. :maxCount="1"
  23. multiple
  24. width="150rpx"
  25. height="150rpx"
  26. name="fileList"
  27. @delete="deleteImage"
  28. @afterRead="afterRead"
  29. :previewFullImage="true"></uv-upload>
  30. </view>
  31. </view>
  32. <!--商品详情-->
  33. <view class="item">
  34. <view>商品内容</view>
  35. <view class="">
  36. <uv-upload
  37. :fileList="contentFileList"
  38. :maxCount="3"
  39. multiple
  40. width="150rpx"
  41. height="150rpx"
  42. name="contentFileList"
  43. @delete="deleteImage"
  44. @afterRead="afterRead"
  45. :previewFullImage="true"></uv-upload>
  46. </view>
  47. </view>
  48. <!--商品规格-->
  49. <view class="item"
  50. @click="$refs.unitListPicker.open()">
  51. <view>{{ $t('components.productSpe') }}</view>
  52. <view>
  53. {{ unit.specsName }}
  54. </view>
  55. <view class="icon">
  56. <uv-icon name="arrow-right" size="30rpx"></uv-icon>
  57. </view>
  58. </view>
  59. <view class="addressA" @click="openAddress">
  60. <view class="title">提货地点</view>
  61. <view class="address" style="width: 70%">
  62. <image mode="" src="/static/image/address/selectIcon.png"></image>
  63. <view class="">
  64. {{ address.name }}
  65. </view>
  66. <view class="icon">
  67. <uv-icon name="arrow-right" size="30rpx"></uv-icon>
  68. </view>
  69. </view>
  70. </view>
  71. <!--提货地点-->
  72. <!--<view class="currentRegion">-->
  73. <!-- <view>{{ $t('components.pickupLocation') }}</view>-->
  74. <!-- <view @click.stop="selectAddr">-->
  75. <!-- <input class="input" disabled v-model="form.currentRegion"-->
  76. <!-- :placeholder=" $t('components.selectRegion')">-->
  77. <!-- </input>-->
  78. <!-- <view class="orientation">-->
  79. <!-- <img src="../../static/image/address/selectIcon.png"-->
  80. <!-- style="width:30rpx;height: 30rpx;margin:5rpx 5rpx 5rpx 5rpx;">-->
  81. <!-- </view>-->
  82. <!-- </view>-->
  83. <!--</view>-->
  84. <!--详细地址-->
  85. <view v-if="address.addressDetail" class="item">
  86. <view>{{ $t('components.detailedAddress') }}</view>
  87. <view>
  88. <view class="">
  89. {{ address.address + ' ' + address.addressDetail }}
  90. <!--</view>-->
  91. <!--<view class="">-->
  92. <!-- {{ address.addressDetail }}-->
  93. </view>
  94. </view>
  95. </view>
  96. <view class="item">
  97. <view>{{ $t('components.deliveryDate') }}</view>
  98. <view>
  99. {{ form.transactionTime }}
  100. <uv-datetime-picker
  101. ref="startDateRef"
  102. v-model="form.transactionTime" mode="date"
  103. @confirm="startDateChange"></uv-datetime-picker>
  104. </view>
  105. <view class="icon">
  106. <uv-icon name="arrow-right" size="30rpx"></uv-icon>
  107. </view>
  108. </view>
  109. <!--暂定数量-->
  110. <view class="item">
  111. <view>{{ $t('other.tentativeQuantity') }}</view>
  112. <view>
  113. <uv-number-box v-model="form.num"></uv-number-box>
  114. </view>
  115. </view>
  116. <!--单价-->
  117. <view class="item">
  118. <view>{{ $t('components.unitPrice') }}</view>
  119. <view>
  120. <input v-model="form.price" clearable></input>
  121. </view>
  122. </view>
  123. <!-- 检测报告 -->
  124. <view class="item">
  125. <view>检测报告</view>
  126. <view class="">
  127. <uv-upload
  128. :fileList="reportFileList"
  129. :maxCount="3"
  130. multiple
  131. width="150rpx"
  132. height="150rpx"
  133. name="reportFileList"
  134. @delete="deleteImage"
  135. @afterRead="afterRead"
  136. :previewFullImage="true"></uv-upload>
  137. </view>
  138. </view>
  139. <!--提交报价和提交审核-->
  140. <view class="btns">
  141. <span @click="confirmBtn" class="ljxd">
  142. {{ titleIndex == 0 ? $t('other.submitQuotation') : $t('other.submitReview') }}
  143. </span>
  144. <span class="lxwm" @click="contactUs">
  145. {{ $t('components.contactUs') }}
  146. </span>
  147. <span class="tip">如有疑问请联系我们</span>
  148. </view>
  149. </view>
  150. </view>
  151. <!-- 联系客服弹框 -->
  152. <customerServicePopup ref="customerServicePopup" />
  153. <!-- 地址选择弹框 -->
  154. <uv-popup ref="addressPopup" :round="30">
  155. <addressList ref="addressList" height="60vh" @select="selectAddress" />
  156. </uv-popup>
  157. <uv-picker ref="unitListPicker"
  158. keyName="specsName"
  159. :columns="unitList"
  160. itemHeight="80"
  161. @confirm="unitListConfirm"></uv-picker>
  162. </view>
  163. </template>
  164. <script>
  165. import topbar from "@/components/base/topbar.vue";
  166. import tabber from "@/components/base/tabbar.vue";
  167. import customerServicePopup from "@/components/config/customerServicePopup.vue";
  168. import Position from "@/utils/position";
  169. import dayjs from "dayjs";
  170. import AddressList from "@/pages_order/components/address/addressList.vue";
  171. export default {
  172. name: "offer",
  173. components: {
  174. AddressList,
  175. customerServicePopup,
  176. tabber,
  177. topbar
  178. },
  179. onLoad(options) {
  180. this.titleIndex = options.titleIndex;
  181. },
  182. data() {
  183. return {
  184. titleIndex: 0,
  185. titleList: [
  186. // 0 供应商报价
  187. this.$t('pages.index.index.supplierQuotation'),
  188. this.$t('pages.index.index.supplierBillLading')
  189. ],
  190. form: {
  191. "addressId": "",
  192. "num": 1,
  193. "price": 0,
  194. "transactionTime": dayjs(new Date()).format("YYYY-MM-DD")
  195. },
  196. address: {
  197. name: '请选择地址',
  198. addressDetail: '',
  199. },
  200. addressTotal: 0,
  201. fileList : [],//商品主图
  202. reportFileList : [],//检测报告
  203. contentFileList : [],//商品内容
  204. unitList : [],//规格列表
  205. unit : {//选中的规格
  206. specsName : '请选择规格'
  207. },
  208. }
  209. },
  210. onShow() {
  211. this.getUnitList()
  212. },
  213. methods: {
  214. // 查询规格
  215. getUnitList(){
  216. this.$api('specsList', {
  217. pageNo : 1,
  218. pageSize : 9999999,
  219. }, res => {
  220. if(res.code == 200){
  221. this.unitList.push(res.result.records)
  222. }
  223. })
  224. },
  225. //获取地址列表
  226. getAddressListA() {
  227. this.$refs.addressList
  228. .getAddressList()
  229. .then(res => {
  230. if (res.total == 0) {
  231. this.$refs.addressPopup.close()
  232. return uni.navigateTo({
  233. url: '/pages_order/center/addressListManage?type=back'
  234. })
  235. }
  236. })
  237. },
  238. // 提交报价/提交审核
  239. confirmBtn() {
  240. //TODO
  241. this.form.addressId = this.address.id
  242. this.form.specsId = this.unit.id
  243. this.form.pic = this.fileList.map(n => n.url).join(',')
  244. this.form.report = this.reportFileList.map(n => n.url).join(',')
  245. this.form.picDetail = this.contentFileList.map(n => n.url).join(',')
  246. if (this.$utils.verificationAll(this.form, {
  247. "pic": '请上传主图',
  248. "picDetail": '请上传内容图片',
  249. specsId : "请选择规格",
  250. "addressId": '请选择提货地点',
  251. "num": '请选择吨数',
  252. "price": '请输入单价',
  253. "transactionTime": '请选择交货时间',
  254. })) {
  255. return
  256. }
  257. this.$api('addProduct', this.form, res => {
  258. if (res.code == 200) {
  259. uni.showToast({
  260. title: '提交成功',
  261. icon: 'none'
  262. })
  263. setTimeout(() => {
  264. uni.reLaunch({
  265. url: '/pages/index/index'
  266. })
  267. }, 1000)
  268. }
  269. })
  270. },
  271. // 选中规格时
  272. unitListConfirm(e){
  273. this.unit = e.value[0]
  274. },
  275. openAddress() {
  276. this.$refs.addressPopup.open('bottom')
  277. // this.getAddressList()
  278. this.$nextTick(() => {
  279. this.getAddressListA()
  280. })
  281. },
  282. // 选择地址
  283. selectAddress(e) {
  284. this.address = e
  285. this.$refs.addressPopup.close()
  286. },
  287. startDateChange(val) {
  288. this.$nextTick(() => {
  289. this.form.transactionTime = dayjs(val.value).format("YYYY-MM-DD")
  290. });
  291. },
  292. startDateOpen() {
  293. this.$refs.startDateRef.open();
  294. },
  295. // 联系我们
  296. contactUs() {
  297. this.$refs.customerServicePopup.open()
  298. },
  299. //地图上选择地址
  300. selectAddr() {
  301. Position.getLocation(res => {
  302. Position.selectAddress(res.longitude, res.latitude, success => {
  303. this.setAddress(success)
  304. })
  305. })
  306. Position.getLocationDetail(res => {
  307. console.log(res);
  308. this.form.address = res
  309. })
  310. },
  311. // 上传图片
  312. afterRead(e) {
  313. let self = this
  314. e.file.forEach(file => {
  315. self.$Oss.ossUpload(file.url).then(url => {
  316. self[e.name].push({
  317. url
  318. })
  319. })
  320. })
  321. },
  322. // 删除图片
  323. deleteImage(e) {
  324. this[e.name].splice(e.index, 1)
  325. },
  326. },
  327. }
  328. </script>
  329. <style scoped lang="scss">
  330. .page {
  331. height: 100vh;
  332. .frame {
  333. background-color: #FFF;
  334. .title {
  335. display: flex;
  336. font-size: 30rpx;
  337. font-weight: 700;
  338. padding: 0rpx 0 0rpx 20rpx;
  339. margin: 20rpx 0 0 0;
  340. >span:nth-of-type(1) {
  341. margin: 4rpx 0 0 8rpx;
  342. background-color: #FFF;
  343. }
  344. >span:nth-of-type(2) {
  345. margin: 0 0 0 8rpx;
  346. background-color: #FFF;
  347. }
  348. }
  349. .basic-info {
  350. display: flex;
  351. flex-direction: column;
  352. gap: 10rpx;
  353. //margin-top: 20rpx;
  354. padding: 20rpx 20rpx 20rpx 20rpx;
  355. .addressA {
  356. display: flex;
  357. align-items: center;
  358. background-color: #FFF;
  359. height: 80rpx;
  360. .title {
  361. display: flex;
  362. align-items: center;
  363. justify-content: flex-start;
  364. font-weight: 400;
  365. width: 30%;
  366. }
  367. .address {
  368. width: 70%;
  369. display: flex;
  370. padding: 20rpx;
  371. background-color: #fff;
  372. image {
  373. width: 30rpx;
  374. height: 30rpx;
  375. margin: 10rpx;
  376. }
  377. view {
  378. //margin: 20rpx;
  379. overflow: hidden; //超出的文本隐藏
  380. text-overflow: ellipsis; //溢出用省略号显示
  381. white-space: nowrap; //溢出不换行
  382. }
  383. .icon {
  384. display: flex;
  385. justify-content: center;
  386. align-items: center;
  387. margin-left: auto;
  388. }
  389. }
  390. }
  391. .Tip {
  392. display: flex;
  393. align-items: center;
  394. justify-content: center;
  395. .span {
  396. color: #999;
  397. font-size: 24rpx;
  398. }
  399. }
  400. .btns {
  401. width: 100%;
  402. display: flex;
  403. flex-direction: column;
  404. align-items: center;
  405. justify-content: center;
  406. gap: 20rpx;
  407. .ljxd {
  408. display: flex;
  409. align-items: center;
  410. justify-content: center;
  411. width: 500rpx;
  412. height: 70rpx;
  413. border-radius: 40rpx;
  414. color: #FFF;
  415. font-size: 28rpx;
  416. margin: 20rpx 10rpx 0 0;
  417. background: $uni-color;
  418. //margin-top: 20rpx;
  419. border-radius: 40rpx;
  420. }
  421. .lxwm {
  422. display: flex;
  423. align-items: center;
  424. justify-content: center;
  425. width: 500rpx;
  426. height: 70rpx;
  427. border-radius: 40rpx;
  428. color: #000000;
  429. font-size: 28rpx;
  430. margin: 20rpx 10rpx 0 0;
  431. background: #f1f1f1;
  432. //margin-top: 20rpx;
  433. border-radius: 40rpx;
  434. }
  435. .tip {
  436. display: flex;
  437. align-items: center;
  438. justify-content: center;
  439. font-size: 24rpx;
  440. color: #999;
  441. //width: 500rpx;
  442. }
  443. }
  444. .item {
  445. display: flex;
  446. align-items: center;
  447. background-color: #FFF;
  448. margin: 10rpx 0 0 0;
  449. padding: 10rpx 20rpx;
  450. >view:nth-of-type(1) {
  451. width: 30%;
  452. // font-weight: 700;
  453. }
  454. >view:nth-of-type(2) {
  455. flex: 1;
  456. border-radius: 10rpx;
  457. overflow: hidden;
  458. input {
  459. background-color: #FFF;
  460. font-size: 28rpx;
  461. padding: 16rpx 8rpx 16rpx 15rpx;
  462. }
  463. }
  464. }
  465. }
  466. }
  467. }
  468. </style>