铝交易,微信公众号
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.

605 lines
13 KiB

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