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

738 lines
17 KiB

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