123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720 |
- <template>
- <view class="container">
- <!-- <block v-if="TabCur==2"> -->
- <view v-for="(item , index) in lists" :Key="index">
-
-
- <view class="cu-form-group">
- <view class="title">采购</view>
-
- <text style="margin-left: -30%;">编号{{item.contractNo}}{{item.procurementPlanType}}</text>
- <text>{{item.status}}</text>
- </view>
- <view class="cu-form-group">
- <view class="title">买方</view>
- <text style="margin-left: -45%;">{{item.customer}}</text>
- <text></text>
- </view>
- <view class="cu-form-group">
- <view class="title">{{item.goodsName}}:<text>{{item.goodsName}}</text></view>
- <view class="title">单价:<text>{{item.unitPrice}}</text></view>
- <view class="title">基差:<text>{{item.basis}}</text></view>
- </view>
- <view class="c-row b-b">
- <text><button class="cu-btn commit margin-tb-sm lg" style=" width: 75px;height: 25px; margin-left: 15px;"
- @click="commit">附件</button></text>
-
- <text><button class="cu-btn commit margin-tb-sm lg" style=" margin-left: 15px; width: 75px;height: 25px;"
- @click="someprice(item)">点价</button></text>
-
-
- <text><button class="cu-btn commit margin-tb-sm lg" style=" margin-left: 15px; width: 75px;height: 25px;"
- @click="commit1(item)">发货</button></text>
-
- </view>
-
- </view>
- <view v-if='pricestatus' class='shade'>
- <view class='shade-content'>
- <view class='shade-content-item'>
- <input v-model='price' placeholder="请输入点价价格" type="number">元/吨
- </view>
- <view>
- <button style='width:50%;display:inline-block;' @click='pricestatus=false'>取消</button>
- <button style='width:50%;display:inline-block;' @click='amendprice'>确定</button>
- </view>
- </view>
- </view>
- <view v-if='shadestatus' class='shade'>
- <view class='shade-content'>
- <view class='shade-content-item'>
- <view>请于以下时间段进行点价操作:</view>
- <view>11:30 ~ 12:30</view>
- <view>15:30 ~ 20:00</view>
- <view>23:00 ~ 08:00</view>
- </view>
- <button style='width:50%;display:inline-block;' @click='shadestatus=false'>取消</button>
- </view>
- </view>
- <view class="padding flex flex-direction">
- <!-- <button class="cu-btn commit margin-tb-sm lg" @click="commit">提交</button> -->
- </view>
- <!-- </block> -->
- </view>
- </template>
- <script>
-
- import uploadImage from '@/components/ossutil/uploadFile.js';
- import {
- mapState
- } from 'vuex';
- export default {
- name: "trust",
- data() {
- return {
- lists:[],
- shadestatus:false,
- pricestatus:false,
- goods: {
- pageSize:10,
- currentPage:1,
- id:"41651544",
- // pcFlag : 0,
- },
- procurementPlanInfo:{
- pageSize:10,
- currentPage:1
- },
- tran: {
- total: 0,
- price: 0,
- startPlace: undefined,
- endPlace: undefined,
- goodsName: undefined,
- sender: '',
- senderPhone: '',
- status: 0,
- receiver: '',
- receiverPhone: '',
- verifyCode: '',
- driver: '',
- driverPhone: '',
- carNo: '',
- personNoImg: '',
- personNoImg1: '',
- driverNoImg: '',
- driverNoImg1: '',
- carNoImg: '',
- carNoImg1: ''
- },
- id:0,
- PageCur: "trust",
- TabCur: 0,
- priceTypeIndex: -1,
- priceType: ['库内价', '到库价', '到港价'],
- unitPrice: 0,
- price: 0,
- seller: '',
- sellerPhone: '',
- minSale: '',
- exsitCount: 0,
- origin: '',
- stock: '',
- goodsName: '',
- verifyCode: '',
- sendText0: '获取验证码',
- sendText1: '获取验证码',
- sendText2: '获取验证码',
- sendText3: '获取验证码',
- sendDisabled0: false,
- sendDisabled1: false,
- sendDisabled2: false,
- sendDisabled3: false,
- buyer: '',
- buyerPhone: '',
- level: '',
- sender: '',
- senderPhone: '',
- receiver: '',
- receiverPhone: '',
- total: 0,
- startPlace: '',
- endPlace: '',
- driver: '',
- driverPhone: '',
- carNo: '',
- personNoImg: '',
- personNoImg1: '',
- driverNoImg: '',
- driverNoImg1: '',
- carNoImg: '',
- carNoImg1: '',
- showTran: true
- };
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- // onShow() {
- // this.loadData()
- // },
- onLoad(){
- this.getList()
- },
- methods: {
- amendprice(){
- this.$api.doRequest('post','/purchaseOrder/api/pointPrice',{id:this.id,unitPrice:Number(this.price)}).then(res => {
- if(res.data.code==200){
- this.pricestatus=false
- }else{
- uni.showToast({
- title: res.data.message,
- icon:'none',
- duration: 2000
- })
- }
- })
- .catch(res => {
- uni.showToast({
- title: res.errmsg,
- icon:'none',
- duration: 2000
- })
- });
- },
- someprice(item){
- var time=new Date().getTime()
- var time1=new Date(new Date(new Date().toLocaleDateString()).getTime()-(1*60*60*1000))
- var time2=new Date()
- time2.setHours(8);
- time2.setMinutes(0);
- time2.setSeconds(0);
- var time3=new Date()
- time3.setHours(11);
- time3.setMinutes(30);
- time3.setSeconds(0);
- var time4=new Date()
- time4.setHours(12);
- time4.setMinutes(30);
- time4.setSeconds(0);
- var time5=new Date()
- time5.setHours(15);
- time5.setMinutes(30);
- time5.setSeconds(0);
- var time6=new Date()
- time6.setHours(20);
- time6.setMinutes(0);
- time6.setSeconds(0);
- if(time<time2.getTime()&&time>time1||time<time4.getTime()&&time>time3.getTime()||time<time6.getTime()&&time>time5.getTime()){
- this.id=item.id
- this.pricestatus=true
- }else{
- this.shadestatus=true
- }
- },
- commit1(item){
- uni.navigateTo({
- url: `/pageB/contract/look?id=${item.id}&contractNo=${item.contractNo}&customer=${item.customer}&goodsName=${item.goodsName}`
- })
- },
- getList(){
- this.goods.commonId = this.userInfo.id
-
- this.$api.doRequest('get','/purchaseOrder/selectPurchaseOrder',this.goods).then(res => {
- if(res.data.code==200){
- this.lists = res.data.data.records
- }else{
- uni.showToast({
- title: res.data.message,
- icon:'none',
- duration: 2000
- })
- }
- })
- .catch(res => {
- uni.showToast({
- title: res.errmsg,
- icon:'none',
- duration: 2000
- })
- });
- },
-
-
- ChooseImageCar() {
- uni.chooseImage({
- count: 1, //默认9
- sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ['album', 'camera'], //从相册选择
- success: (res) => {
- //上传图片
- //图片路径可自行修改
- uploadImage(res.tempFilePaths[0], 'carNoImg/',
- result => {
- if (this.carNoImg.length != 0) {
- this.carNoImg1 = result
- } else {
- this.carNoImg = result
- }
- uni.hideLoading();
- }
- )
- }
- });
- },
- ViewImage(e) {
- var img = [];
- img = e.currentTarget.dataset.url.split(' ')
- uni.previewImage({
- current: 0,
- urls: img
- });
- },
- // DelImg(e) {
- // uni.showModal({
- // title: '提示',
- // content: '确定要删除该照片吗?',
- // cancelText: '取消',
- // confirmText: '确定',
- // success: res => {
- // if (res.confirm) {
- // if (e.currentTarget.dataset.index == 0) {
- // this.personNoImg = "";
- // } else if (e.currentTarget.dataset.index == 1) {
- // this.personNoImg1 = "";
- // } else if (e.currentTarget.dataset.index == 2) {
- // this.driverNoImg = "";
- // } else if (e.currentTarget.dataset.index == 3) {
- // this.driverNoImg1 = "";
- // } else if (e.currentTarget.dataset.index == 4) {
- // this.carNoImg = "";
- // } else if (e.currentTarget.dataset.index == 5) {
- // this.carNoImg1 = "";
- // }
- // }
- // }
- // })
- // },
-
- commit11() {
- if (this.hasLogin) {
- uni.showModal({
- title: '登录提示',
- content: '您尚未登录,是否立即登录?',
- showCancel: true,
- confirmText: '登录',
- success: (e) => {
- if (e.confirm) {
- uni.navigateTo({
- url: '/pagesB/contract/look'
- })
- }
- },
- fail: () => {},
- complete: () => {}
- })
- }
- else {
- const that = this
- if (this.TabCur == 0) {
- // if (!that.seller) {
- // this.$api.msg('请填写卖方');
- // return;
- // }
- // if (!that.sellerPhone) {
- // this.$api.msg('请填写手机号码');
- // return;
- // }
- // if (!that.exsitCount) {
- // this.$api.msg('请填写库存量');
- // return;
- // }
- // if (!that.minSale) {
- // this.$api.msg('请填写最小成交量');
- // return;
- // }
- // if (!that.goodsName) {
- // this.$api.msg('请填写货名');
- // return;
- // }
- // if (!that.verifyCode) {
- // this.$api.msg('请填写验证码');
- // return;
- // }
- // if (!that.price) {
- // that.$api.msg('请选择价格类型')
- // return
- // }
- // if (!that.unitPrice) {
- // that.$api.msg('请填写协议价格(元/吨)');
- // return
- // }
- // if (!that.origin) {
- // this.$api.msg('请填写产地');
- // return;
- // }
- // if (!that.stock) {
- // this.$api.msg('请填写库存地');
- // return;
- // }
- // if (!that.level) {
- // this.$api.msg('请填写国标等级');
- // return;
- // }
- // that.saleInfo.seller = that.seller
- // that.saleInfo.sellerPhone = that.sellerPhone
- // that.saleInfo.priceType = that.price
- // that.saleInfo.unitPrice = that.unitPrice
- // that.saleInfo.minSale = that.minSale
- // that.saleInfo.exsitCount = that.exsitCount
- // that.saleInfo.origin = that.origin
- // that.saleInfo.stock = that.stock
- // that.saleInfo.verifyCode = that.verifyCode
- // that.saleInfo.goodsName = that.goodsName
- // that.saleInfo.buyer = that.buyer
- // that.saleInfo.buyerPhone = that.buyerPhone
- // that.saleInfo.level = that.level
- } else if (this.TabCur == 1) {
- if (!that.buyer) {
- this.$api.msg('请填写买方');
- return;
- }
- if (!that.buyerPhone) {
- this.$api.msg('请填写手机号码');
- return;
- }
- if (!that.goodsName) {
- this.$api.msg('请填写货名');
- return;
- }
- if (!that.verifyCode) {
- this.$api.msg('请填写验证码');
- return;
- }
- if (!that.price) {
- that.$api.msg('请选择价格类型')
- return
- }
- if (!that.unitPrice) {
- that.$api.msg('请填写协议价格(元/吨)');
- return
- }
- if (!that.origin) {
- this.$api.msg('请填写产地');
- return;
- }
- if (!that.stock) {
- this.$api.msg('请填写库存地');
- return;
- }
- if (!that.level) {
- this.$api.msg('请填写国标等级');
- return;
- }
- that.saleInfo.seller = that.seller
- that.saleInfo.sellerPhone = that.sellerPhone
- that.saleInfo.priceType = that.price
- that.saleInfo.unitPrice = that.unitPrice
- that.saleInfo.minSale = that.minSale
- that.saleInfo.exsitCount = that.exsitCount
- that.saleInfo.origin = that.origin
- that.saleInfo.stock = that.stock
- that.saleInfo.verifyCode = that.verifyCode
- that.saleInfo.goodsName = that.goodsName
- that.saleInfo.buyer = that.buyer
- that.saleInfo.buyerPhone = that.buyerPhone
- that.saleInfo.level = that.level
- } else if (this.TabCur == 2) {
- if (!that.sender) {
- this.$api.msg('请填写发货方');
- return;
- }
- if (!that.senderPhone) {
- this.$api.msg('请填写发货方手机号码');
- return;
- }
- if (!that.receiver) {
- this.$api.msg('请填写收货方');
- return;
- }
- if (!that.receiverPhone) {
- this.$api.msg('请填写收货方手机号码');
- return;
- }
- if (!that.goodsName) {
- this.$api.msg('请填写货名');
- return;
- }
- if (!that.verifyCode) {
- this.$api.msg('请填写验证码');
- return;
- }
- that.tran.sender = that.sender
- that.tran.senderPhone = that.senderPhone
- that.tran.receiver = that.receiver
- that.tran.receiverPhone = that.receiverPhone
- that.tran.verifyCode = that.verifyCode
- that.tran.goodsName = that.goodsName
- that.tran.total = that.total
- that.tran.price = that.price
- that.tran.startPlace = that.startPlace
- that.tran.endPlace = that.endPlace
- } else if (this.TabCur == 3) {
- if (!that.startPlace) {
- this.$api.msg('请填写起始地');
- return;
- }
- if (!that.endPlace) {
- this.$api.msg('请填写目的地');
- return;
- }
- if (!that.driver) {
- this.$api.msg('请填写承运人');
- return;
- }
- if (!that.driverPhone) {
- this.$api.msg('请填写承运人手机号码');
- return;
- }
- if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(that.driverPhone)) {
- that.$api.msg('请输入正确的承运人手机号码');
- return
- }
- if (!that.carNo) {
- this.$api.msg('请填写车牌号');
- return;
- }
- if (!that.verifyCode) {
- this.$api.msg('请填写验证码');
- return;
- }
- if (!that.personNoImg || !that.personNoImg1) {
- that.$api.msg('请上传身份证正、反面照片');
- return
- }
- if (!that.driverNoImg || !that.driverNoImg1) {
- that.$api.msg('请上传驾驶证主、副页照片');
- return
- }
- if (!that.carNoImg || !that.carNoImg1) {
- that.$api.msg('请上传行车证主、副页照片');
- return
- }
- that.tran.driver = that.driver
- that.tran.driverPhone = that.driverPhone
- that.tran.verifyCode = that.verifyCode
- that.tran.price = that.price
- that.tran.startPlace = that.startPlace
- that.tran.endPlace = that.endPlace
- that.tran.carNo = that.carNo
- that.tran.personNoImg = that.personNoImg
- that.tran.personNoImg1 = that.personNoImg1
- that.tran.driverNoImg = that.driverNoImg
- that.tran.driverNoImg1 = that.driverNoImg1
- that.tran.carNoImg = that.carNoImg
- that.tran.carNoImg1 = that.carNoImg1
- }
- // 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
- wx.getSetting({
- // withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
- success(res) {
- if (res.authSetting['scope.subscribeMessage']) {
- uni.openSetting({ // 打开设置页
- success(res) {
- console.log(res.authSetting)
- }
- });
- } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
- uni.requestSubscribeMessage({
- tmplIds: ['8cVkckXi_8zfHeScXRHhjN6cgZFYYCWIMPDTiPWagXY'], //
- success(res) {
- console.log(res)
- if (res['8cVkckXi_8zfHeScXRHhjN6cgZFYYCWIMPDTiPWagXY'] ==
- "accept") { // 字段就是tmplIds模板id
- uni.showLoading({
- title: '正在提交',
- mask: true
- })
- if (that.TabCur == 0) {
- that.$api.request('sale', 'addSale', that.saleInfo,
- failres => {
- uni.hideLoading()
- that.$api.msg(failres.errmsg);
- }).then(res => {
- uni.hideLoading()
- uni.showModal({
- title: '提示',
- content: "发布提交成功,工作人员会尽快联系该号码:" +
- that.sellerPhone,
- showCancel: false,
- confirmText: '确定',
- success: () => {
- uni.navigateBack()
- }
- })
- // that.$api.prePage().refreshList(data, that.manageType);
- })
- } else if (that.TabCur == 1) {
- that.$api.request('sale', 'addBuy', that.saleInfo,
- failres => {
- uni.hideLoading()
- that.$api.msg(failres.errmsg);
- }).then(res => {
- uni.hideLoading()
- uni.showModal({
- title: '提示',
- showCancel: false,
- content: "发布提交成功,工作人员会尽快联系该号码:" +
- that.buyerPhone,
- confirmText: '确定',
- success: () => {
- uni.navigateBack()
- }
- })
- // that.$api.prePage().refreshList(data, that.manageType);
- })
- } else if (that.TabCur == 2) {
- that.$api.request('tran', 'addTran', that.tran,
- failres => {
- uni.hideLoading()
- that.$api.msg(failres.errmsg);
- }).then(res => {
- uni.hideLoading()
- uni.showModal({
- title: '提示',
- showCancel: false,
- content: "发布提交成功,工作人员会尽快联系该号码:" +
- that.senderPhone,
- confirmText: '确定',
- success: () => {
- uni.navigateBack()
- }
- })
- // that.$api.prePage().refreshList(data, that.manageType);
- })
- } else if (that.TabCur == 3) {
- that.$api.request('tran', 'addCarDriver', that.tran,
- failres => {
- uni.hideLoading()
- that.$api.msg(failres.errmsg);
- }).then(res => {
- uni.hideLoading()
- uni.showModal({
- title: '提示',
- showCancel: false,
- content: "发布提交成功,工作人员会尽快联系该号码:" +
- that.driverPhone,
- confirmText: '确定',
- success: () => {
- uni.navigateBack()
- }
- })
- // that.$api.prePage().refreshList(data, that.manageType);
- })
- }
- }
- }
- })
- }
- }
- })
- }
- }
- },
- }
-
-
-
- </script>
- <style scoped>
- .zan-dialog__mask {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- z-index: 10;
- background: rgba(0, 0, 0, 0); /*设置阴影半透明背景如: background: rgba(0, 0, 0, 0.4);*/
- display: none;
- }
-
- .zan-dialog__container {
- position: fixed;
- bottom: 400rpx;
- width: 650rpx; /*弹窗布局宽*/
- height: 350rpx; /*弹窗布局高,与下面弹出距离transform有关*/
- margin-left: 50rpx;
- background: #f8f8f8;
- transform: translateY(300%); /*弹框弹出距离,与弹框布局高度有关,如300%表示弹起距离为3倍弹窗高度 */
- transition: all 0.4s ease;
- z-index: 12;
- border-radius: 20rpx;
- box-shadow: 0px 3px 3px 2px gainsboro; /*弹框的悬浮阴影效果,如不需要可注释该行*/
- }
-
- .zan-dialog--show .zan-dialog__container {
- transform: translateY(0);
- }
-
- .zan-dialog--show .zan-dialog__mask {
- display: block;
- }
- .container {
- padding-bottom: 160rpx;
- }
- .cu-form-group input {
- text-align: right;
- }
- .text-white text {
- background: linear-gradient(45deg, #3DC146, #B2D612);
- padding: 5px 10px;
- border-radius: 38rpx;
- }
- .cu-form-group textarea {
- text-align: right;
- }
- .commit {
- background: linear-gradient(45deg, #DF331C, #DA611A);
- color: #fff;
- }
- .shade{
- position:fixed;
- top:0;
- left:0;
- width:100%;background:rgba(0,0,0,0.5);
- height:100%;
- z-index:999999;
- }
- .shade-content{
- background:#fff;
- position:absolute;
- top:50%;
- left:50%;
- transform: translateX(-50%) translateY(-50%);
- z-index:999999;
- text-align:center;
- }
- .shade-content-item{
- width: 277px;
- text-align:center;
- height:121px;
- padding:35px 10px;
- }
- </style>
|