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

741 lines
17 KiB

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