123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531 |
- <template>
- <view class="content">
- <u-toast ref="uToast" />
- <u-popup v-model="show" class="popup" @close="close" mode="bottom" border-radius="30" :closeable="true">
- <view class="top">
- <view class="top-center-1">收到</view>
- </view>
- <view class="top-content-2">
- <view>来自</view>
- <view class="top-content-green">{{user.title}}</view>
- <view>的邀请。</view>
- </view>
- <view class="top-content-3">
- 接受邀请后对方将可以查看您的个人粮商信息(姓名、手机号、账户信息和身份证附件等)。
- </view>
- <div class="content-bottom">
- <view v-if="grainMerchantList.length>0" class="title">请选择粮商身份</view>
- <view v-if="grainMerchantList.length>0">
- <view v-for="(item,index) in grainMerchantList" :key="index">
- <view v-if="item.cover!=1" :class="item.check?'item-select':'item'" @click="selectItem(item)">
- <image v-if="item.check" class="img" :src="img1" alt=""></image>
- <view class="name">{{item.customerName}}</view>
- <view class="phone">
- <view class="number">{{item.customerPhone}}</view>
- <view>({{item.authenticationStatus}})</view>
- </view>
- </view>
- </view>
- </view>
- <view class="nolist" v-if="grainMerchantList.length==0">
- <image class="img" :src="img2" alt=""></image>
- <view class="text">您还未认证个人粮商身份</view>
- </view>
- <button v-if="grainMerchantList.length>0" :class="flag?'':'custom-style'"
- @click="submit">{{btnVal}}</button>
- <button v-if="grainMerchantList.length==0" class="custom-style"
- @click="toGrainMerchantCertification()">接受并去认证</button>
- </div>
- </u-popup>
- <u-toast ref="warning" />
- <u-popup v-model="show1" class="popup" @close="close" mode="bottom" border-radius="30" :closeable="true">
- <view class="buns_item">
- <view class="but_css" @click="skip(1)" v-if="getRoles('acquisitionQuality.initial') && status == '已初检'">
- 去初检
- </view>
- <view class="but_css" @click="skip(2)"
- v-if="getRoles('acquisitionQuality.again') && !payStatus && confirm != '1' && (status == '已初检'|| status == '已复检')">去复检</view>
- <view class="but_css" @click="skip(3)"
- v-if="getRoles('acquisitionWeight.mao') && weightStatus != '已称皮重' && (weightStatus == '已质检'|| weightStatus == '已称毛重')">
- 去称毛重</view>
- <view class="but_css" @click="skip(4)"
- v-if="getRoles('acquisitionWeight.weight') && !payStatus && (weightStatus == '已称毛重' || weightStatus == '已称皮重')">
- 去称皮重
- </view>
- <view class="but_css" @click="skip(5)"
- v-if="getRoles('acquisitionQuality.con') && confirm != '1' && status == '已复检'">
- 去确认质检
- </view>
- <view class="but_css" @click="close">返回</view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- data() {
- return {
- img1: require("../../../static/img/select.png"),
- img2: require("../../../static/img/nolist.png"),
- show: false,
- show1: true,
- identityAuthenticationInfo: {},
- grainMerchantList: [],
- selectID: "",
- btnVal: "接受邀请",
- user: {
- title: '',
- companyId: ''
- },
- isAllselect: false,
- flag: true,
- cangid: "", //仓库id
- managementType: 1,
- warehouseName: "", //仓库名
- status: "", //质检状态
- weightStatus: "", //检斤状态
- qualityNo: "",
- confirm: "", //确认初检确认状态
- payStatus:"",//结算状态
- detailData: {},
- userName: "", //仓库负责人
- companyId: "",
- decide: false
- }
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- onLoad(options) {
- let _list = [];
- if(options.data){
- for (var p1 in options) {
- if (options.hasOwnProperty(p1)){
- _list.push(p1);
- }
- }
- }
- //#ifdef APP-PLUS
- this.user.title = options.data.split(',')[2]
- this.user.companyId = options.data.split(',')[1]
- this.compId = options.data
- this.qualityNo = _list[1]
- this.cangid = _list[2]
- //#endif
- },
- onShow() {
- // this.compId = "2710b21efc1e4393930c5dc800010dc4"
- // this.qualityNo = "SGRK202201170060001"
- // this.cangid = "374a8a02ecfe40dc9abdcd902dd564f5"
- console.log("查看",this.qualityNo,this.compId,this.cangid)
- if (this.cangid) { //判断是在哪扫码进入的
- if(this.compId.indexOf(",") != -1){
- this.compId = this.compId.split(",")[1]
- }
- this.show = false
- this.show1 = true
- this.companyId = uni.getStorageSync('pcUserInfo').compId
-
- this.userName = uni.getStorageSync('userInfo').userName.split("-")[1]
- if (this.companyId == this.compId) {
- this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
- id: this.cangid
- }).then(res => {
- let cangList = res.data.data
- let person = cangList.otherPersonCharge.split(",")
- person.push(cangList.personCharge)
- for (let i = 0; i < person.length; i++) {
- if (person[i].indexOf(uni.getStorageSync('userInfo').userName.split("-")[1]) != -1) {
- this.decide = true
- this.getShow()
- return
- }
- }
- if (!this.decide) {
- this.$refs.warning.show({
- title: '当前身份不可操作',
- type: "error",
- icon: false
- })
- }
- }).catch(res => {});
- }else{
- this.$api.msg('当前身份不可操作!')
- }
- } else if(this.user.title && this.user.companyId){//邀请客户
- this.show = true
- this.show1 = false
- this.getList()
- }
- // this.getShow()
- // debugger
- // this.getRoles("acquisitionWeight.mao")
- },
- methods: {
- //查看权限
- getRoles: function(role) {
- // debugger
- let _roles = uni.getStorageSync('rolesList')
- for (let i = 0; i < _roles.length; i++) {
- if (_roles[i] == role) {
- return true
- }
- }
- return false
- },
- getShow() {
- let tmp = {
- compId: this.compId,
- number: this.qualityNo,
- warehouseId: this.cangid
- }
- this.$api.doRequest('get', '/weighingManagement/getQRcode', tmp).then(res => {
- this.detailData = res.data.data
- this.status = this.detailData.qualityInspectionManagement.status
- this.confirm = this.detailData.qualityInspectionManagement.confirm
- this.weightStatus = this.detailData.status
- if(this.detailData.paymentManagement){
- this.payStatus = this.detailData.paymentManagement.approveStatus
- }
- })
- .catch(res => {
- if (res.message) {
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration: 2000
- })
- } else {
- uni.showToast({
- title: "请稍后再试!",
- icon: 'none',
- duration: 2000
- })
- }
- });
- },
- //跳转
- skip(val) {
- if (val == 1) {
- uni.navigateTo({
- url: '/pages/erpbusiness/edit_quality_testing?id=' + this.detailData
- .qualityInspectionManagement.id + '&managementType=' + this
- .managementType + '&cangid=' + this.cangid + '&flag=' + '0'
- })
- } else if (val == 2) {
- uni.navigateTo({
- url: '/pages/erpbusiness/edit_quality_testing?id=' + this.detailData
- .qualityInspectionManagement.id + '&managementType=' + this
- .managementType + '&cangid=' + this.cangid + '&flag=' + '1'
- })
- } else if (val == 3) {
- this.detailData.warehouseId = this.cangid
- uni.navigateTo({
- url: '/pages/erpbusiness/acquisitionInspection/grossWeightDetail?detailData=' +
- JSON.stringify(this.detailData)
- })
- } else if (val == 4) {
- this.detailData.warehouseId = this.cangid
- uni.navigateTo({
- url: '/pages/erpbusiness/acquisitionInspection/tareDetail??detailData=' + JSON
- .stringify(this.detailData)
- })
- } else if (val == 5) {
- uni.navigateTo({
- url: '/pages/erpbusiness/edit_quality_testing?id=' + this.detailData
- .qualityInspectionManagement.id + '&managementType=' + this
- .managementType + '&cangid=' + this.cangid + '&flag=' + '2'
- })
- }
- },
- selectItem(item) {
- if (item.authenticationStatus == "已接受") return
- for (let i = 0; i < this.grainMerchantList.length; i++) {
- if (this.grainMerchantList[i].id == item.id) {
- this.grainMerchantList[i].check = !this.grainMerchantList[i].check
- if (this.grainMerchantList[i].check) {
- this.selectID = this.grainMerchantList[i].id
- }
- }
- }
- },
- //查询粮商身份
- selectGrainMerchantList() {
- //
- },
- //粮商认证
- toGrainMerchantCertification() {
-
- var that = this
- console.log(that.user.companyId)
- // url: `/pageA/product/list?keywords=${key}&TabCur=${TabCur}`
- uni.navigateTo({
- url: `/pageD/identity/companyIdentity?status=1&compId=${that.user.companyId}&ids=${that.user.title}`,
- })
- },
- getList() {
- this.identityAuthenticationInfo.commonId = this.userInfo.id
- this.grainMerchantList = []
- this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
- pageSize: 100,
- currentPage: 1,
- commonId: this.userInfo.id,
- compId: this.user.companyId,
- flag: 3
- }, 'application/json;charset=UTF-8').then(res => {
- for (var i = 0; i < res.data.data.records.length; i++) {
- res.data.data.records[i].basis = "false"
- if (res.data.data.records[i].defaultFlag == 1) {
- res.data.data.records[i].basis = "true"
- }
- }
- var data = res.data.data.records
- for (var i = 0; i < data.length; i++) {
- if (data[i].authenticationStatus == "未通过") {
- continue
- }
- if (data[i].customerTypeFlag == 2) {
- if (data[i].compName && data[i].compName.length > 10) {
- data[i].compName = data[i].compName.substring(0, 10) + "..."
- }
- }
- if (data[i].authenticationStatus == "已接受") {
- data[i].check = true
- this.isAllselect = true
- } else {
- data[i].check = false
- this.isAllselect = false
- this.flag = false
- }
- this.grainMerchantList.push(data[i])
- }
- if (this.flag) {
- this.btnVal = "已接受"
- }
- })
- .catch(res => {
- if (res.message) {
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration: 2000
- })
- } else {
- uni.showToast({
- title: "系统异常,请联系管理员",
- icon: 'none',
- duration: 2000
- })
- }
- });
- },
- submit() {
- if (this.flag) return
- let _isAllCheck = false
- for (let i = 0; i < this.grainMerchantList.length; i++) {
- if (this.grainMerchantList[i].check) {
- _isAllCheck = true
- }
- }
- if (!_isAllCheck) {
- this.$refs.uToast.show({
- title: '至少选择一个身份',
- type: "error",
- icon: false
- })
- }
- this.$api.doRequest('get', '/identityAuthenticationInfo/saveCompanyIdentity', {
- id: this.selectID,
- compId: this.user.companyId,
- }, 'application/json;charset=UTF-8').then(res => {
- console.log(res);
- if (res.data.code == 200) {
- // this.getList()
- uni.navigateBack(-1)
- }
- })
- .catch(res => {
- if (res.message) {
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration: 2000
- })
- } else {
- uni.showToast({
- title: "接受邀请失败,请稍后再试。",
- icon: 'none',
- duration: 2000
- })
- }
- });
- },
- close() {
- uni.navigateBack(-1)
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .content {
- background: white;
- }
- .top {
- background: url(../../../static/img/bg@2x.png);
- background-size: 100% 100%;
- padding: 0 80rpx 0 80rpx;
- text-align: center;
- height: 310rpx;
- }
- .content-bottom {
- padding: 50rpx 50rpx 50rpx 50rpx;
- .title {
- font-size: 32rpx;
- font-weight: 600;
- color: #333333;
- text-align: center;
- margin-bottom: 30rpx;
- }
- .active {}
- .item-select {
- border-radius: 1px;
- border: 1px solid #C5CAD5;
- padding: 15rpx 40rpx;
- background: #F4FAF4;
- border: 1px solid #22C572;
- margin-bottom: 20rpx;
- position: relative;
- .img {
- position: absolute;
- width: 42rpx;
- height: 40rpx;
- top: 0;
- right: 0;
- }
- .name {
- font-size: 32rpx;
- font-weight: 600;
- color: #22C572;
- }
- .phone {
- display: flex;
- align-items: center;
- color: #8E93A3;
- .number {
- margin-right: 20rpx;
- }
- }
- }
- .item {
- border-radius: 1px;
- border: 1px solid #C5CAD5;
- padding: 15rpx 40rpx;
- margin-bottom: 20rpx;
- position: relative;
- .img {
- position: absolute;
- width: 42rpx;
- height: 40rpx;
- top: 0;
- right: 0;
- }
- .name {
- font-size: 32rpx;
- font-weight: 600;
- }
- .phone {
- display: flex;
- align-items: center;
- color: #8E93A3;
- .number {
- margin-right: 20rpx;
- }
- }
- }
- }
- .top-center-1 {
- font-size: 42rpx;
- font-weight: 600;
- color: #333333;
- position: relative;
- top: 88rpx;
- }
- .top-content-2 {
- display: flex;
- justify-content: center;
- align-items: flex-end;
- position: relative;
- top: -50px;
- }
- .top-content-3 {
- position: relative;
- top: -25px;
- padding: 0 81rpx;
- }
- .top-content-green {
- color: #22C572;
- font-size: 32rpx;
- }
- .custom-style {
- background: #22C572;
- border-radius: 46px;
- margin: 50rpx;
- color: white;
- }
- .nolist {
- text-align: center;
- margin: 50rpx 50rpx 100rpx 50rpx;
- .img {
- width: 240rpx;
- height: 240rpx;
- }
- .text {
- margin: 20rpx;
- color: #8E93A3;
- }
- }
- .but_css {
- width: 200rpx;
- height: 80rpx;
- background-color: #22C572;
- margin: 20rpx auto;
- color: #FFFFFF;
- line-height: 80rpx;
- border-radius: 20rpx;
- text-align: center;
- }
- .buns_item{
- margin: 100rpx;
- }
- </style>
|