Commit d8731c9f authored by xiangzj's avatar xiangzj

优化

parent 402ade04
......@@ -5,7 +5,7 @@ import router from './router'
import './permission'
import './assets/styles/reset.css'
import App from './App.vue'
import * as Vconsole from 'vconsole'
// import * as Vconsole from 'vconsole'
import {
Button,
......@@ -22,7 +22,7 @@ import {
Toast
} from 'vant'
new Vconsole()
// new Vconsole()
const app = createApp(App)
app.use(store)
......
const getters = {
userInfo: state => state.userInfo,
token: state => state.token
token: state => state.token,
userId: state => state.userId
}
export default getters
......@@ -41,7 +41,10 @@ const mutations = {
},
SET_TOKEN: (state, token) => {
state.token = token
}
},
SET_USERID(state, userId) {
state.userId= userId
},
}
export default mutations
......@@ -7,7 +7,8 @@ const state = {
clientWidth: '',
clientHeight: '',
userInfo: {},
token: getToken()
token: getToken(),
userId: ''
}
export default state
......@@ -5,6 +5,7 @@
</template>
<script>
import { login } from '@/api/login'
import Cookies from 'js-cookie'
// import { getQueryObject } from '@/utils/index'
export default {
......@@ -34,6 +35,8 @@ export default {
taskToken: this.urlObj.taskToken
}).then(resp => {
const { token, operator } = resp.data
this.$store.commit('SET_USERID', operator.userId)
Cookies.set('HEADER_USERID_KEY', operator.userId)
this.$store.commit('SET_USERINFO', operator)
this.$store.dispatch('setToken', token).then(() => {
console.log('333', this.$route, this.$store, this.$store.getters.token)
......
......@@ -189,18 +189,19 @@
<div class="approval-block">
<span class="title">审批结果</span>
<van-field
:disabled="!flag"
v-model="pickerVal"
is-link
readonly
label=""
placeholder=""
@click="showPicker = true"
@click="handlePicker"
/>
</div>
<div class="remark-block">
<span class="title">审批意见</span>
<textarea
:disabled="isReadonly"
:disabled="!flag"
v-model="conditions.handleOpinion"
class="text"
type="textarea"
......@@ -215,7 +216,8 @@
<div class="bottom">
<!-- <van-button plain type="primary">确认</van-button> -->
<van-button plain :disabled="isReadonly" type="primary" @click="submit('1')">确认</van-button>
<van-button v-if="pickerVal === '同意'" plain :disabled="!flag" type="primary" @click="submit('1')">确认</van-button>
<van-button v-else plain :disabled="!flag" type="primary" @click="submit('2')">退回</van-button>
</div>
<van-popup v-model:show="showPicker" round position="bottom">
......@@ -236,8 +238,9 @@
</div>
</template>
<script>
import Cookies from 'js-cookie'
import { apiWantgoodsFindById } from '@/api/monthPlan.js'
import { queryApprovalHistoryByBizId, advance } from '@/api/flowHander'
import { queryApprovalHistoryByBizId, advance, backToApplyActivity } from '@/api/flowHander'
import { Toast } from 'vant'
import { mapGetters } from 'vuex'
import InvoiceOccupancyDetail from '../invoice-occupancy-detail/InvoiceOccupancyDetail'
......@@ -276,7 +279,8 @@ export default {
subProcUnitId: '',
procUnitHandlerId: '',
groupId: ''
}
},
flag: false
}
},
computed: {
......@@ -305,6 +309,9 @@ export default {
}
},
methods: {
handlePicker() {
this.showPicker = this.flag
},
onConfirm(value, index) {
this.pickerVal = value
this.pickerValIndex = index
......@@ -347,6 +354,9 @@ export default {
this.tablePathData = res.data.Rows
this.stepActive = this.tablePathData.length
this.selectSelfTask(res.data.Rows)
this.flag = res.data.Rows.some(item => {
return item.executorPersonId === Cookies.get('HEADER_USERID_KEY') && item.statusId === 'ready' && item.id === this.conditions.taskId
});
}
})
.catch(() => {})
......@@ -361,8 +371,27 @@ export default {
params.currentHandleId = this.taskNode.procUnitHandlerId
params.currentHandleGroupId = this.taskNode.groupId
params.taskId = this.$route.query.taskId
if(handleResult - 2 === 0){
const toast = Toast.loading({
message: '提交中...',
forbidClick: true
})
try {
const res = await backToApplyActivity(params)
toast.clear()
if (res.status === 1) {
Toast('退回成功')
window.opener = null
window.open('', '_self', '')
window.close()
}
} catch (error) {
toast.clear()
}
return
}
if (this.isShowBase && this.taskNode.subProcUnitId === 'base') {
if (this.form.baseAuditQuantity - 0 <= 0) {
if (this.form.baseAuditQuantity - 0 <= 0 || !Number(this.form.baseAuditQuantity)) {
Toast('请正确填写基地审批量')
return
} else if (this.form.baseAuditQuantity - 0 > params.wantGoodsDetailList[0].wantQuantity - 0) {
......@@ -371,7 +400,7 @@ export default {
}
}
if (this.isShowWarZone && this.taskNode.subProcUnitId === 'warZone') {
if (this.form.warAuditQuantity - 0 <= 0) {
if (this.form.warAuditQuantity - 0 <= 0 || !Number(this.form.warAuditQuantity)) {
Toast('请正确填写战区审批量')
return
} else if (this.form.warAuditQuantity - 0 > this.form.baseAuditQuantity - 0) {
......@@ -380,7 +409,7 @@ export default {
}
}
if (this.isShowWork && !this.form.salecenterAuditQuantity) {
if (this.form.salecenterAuditQuantity - 0 <= 0) {
if (this.form.salecenterAuditQuantity - 0 <= 0 || !Number(this.form.salecenterAuditQuantity)) {
Toast('请正确填写内勤审批量')
return
} else if (this.form.salecenterAuditQuantity - 0 > this.form.warAuditQuantity - 0) {
......
......@@ -17,7 +17,7 @@ module.exports = {
devServer: {
proxy: {
'/huigou': {
target: 'http://10.0.135.139',
target: 'http://10.0.135.61',
// target: 'http://10.2.7.85',
changeOrigin: true,
pathRewrite: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment