Commit f7e0a42f authored by chuan.liu's avatar chuan.liu

发货申请数据联调

parent b82b57b1
module.exports = { module.exports = {
root: true, root: true,
env: { env: {
node: true, node: true
}, },
extends: ["plugin:vue/vue3-essential", "eslint:recommended", "@vue/prettier"], extends: ['plugin:vue/vue3-essential', 'eslint:recommended', '@vue/prettier'],
parserOptions: { parserOptions: {
parser: "babel-eslint", parser: 'babel-eslint'
}, },
rules: { rules: {
'vue/max-attributes-per-line': [ 'vue/max-attributes-per-line': [
...@@ -261,5 +261,5 @@ module.exports = { ...@@ -261,5 +261,5 @@ module.exports = {
'no-async-promise-executor': 'off', 'no-async-promise-executor': 'off',
'require-atomic-updates': 'off', 'require-atomic-updates': 'off',
'no-prototype-builtins': 'off' 'no-prototype-builtins': 'off'
}, }
}; }
...@@ -28,4 +28,4 @@ module.exports = { ...@@ -28,4 +28,4 @@ module.exports = {
htmlWhitespaceSensitivity: 'css', htmlWhitespaceSensitivity: 'css',
// 换行符使用 lf // 换行符使用 lf
endOfLine: 'lf' endOfLine: 'lf'
}; }
module.exports = { module.exports = {
presets: ["@vue/cli-plugin-babel/preset"], presets: ['@vue/cli-plugin-babel/preset'],
"plugins": [ plugins: [
[ [
"import", 'import',
{ {
"libraryName": "vant", libraryName: 'vant',
"libraryDirectory": "es", libraryDirectory: 'es',
"style": true style: true
} }
] ]
] ]
}; }
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<meta name="screen-orientation" content="portrait" /> <meta name="screen-orientation" content="portrait" />
<!-- QQ强制竖屏 --> <!-- QQ强制竖屏 -->
<meta name="x5-orientation" content="portrait" /> <meta name="x5-orientation" content="portrait" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" /> <link rel="icon" href="<%= BASE_URL %>wly2.ico" />
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
</head> </head>
<body ontouchstart=""> <body ontouchstart="">
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<script> <script>
export default { export default {
name: 'App' name: 'app'
} }
</script> </script>
<style lang="scss"> <style lang="scss">
......
// 默认url // 默认url
export const BASE_API = function () { export const BASE_API = function() {
return process.env.NODE_ENV === 'production' ? 'crm-app' : 'huigou' return process.env.NODE_ENV === 'production' ? 'crm-app' : 'huigou'
} }
import request from '@/utils/request' import request from '@/utils/request'
import { BASE_API } from '@/api/baseUrl' import { BASE_API } from '@/api/baseUrl'
import { handleFormData } from '@/utils/index' import { handleFormData } from '@/utils/index'
export function handlerFlow(data, key) { export function handlerFlow(data, key) {
if (data.id) { if (data.id) {
return saveData(data) return saveData(data)
} else { } else {
return startProcessInstanceByKey(data, key) return startProcessInstanceByKey(data, key)
} }
} }
/** /**
* 保存业务数据 * 保存业务数据
*/ */
export function saveData(data) { export function saveData(data) {
return request({ return request({
url: BASE_API() + '/workflow/saveBizData', url: BASE_API() + '/workflow/saveBizData',
method: 'post', method: 'post',
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}, },
data: handleFormData(data) data: handleFormData(data)
}) })
} }
/** /**
* 退回 * 退回
*/ */
export function backToApplyActivity(data) { export function backToApplyActivity(data) {
return request({ return request({
url: BASE_API() + '/workflow/backToApplyActivity', url: BASE_API() + '/workflow/backToApplyActivity',
method: 'post', method: 'post',
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}, },
data: handleFormData(data) data: handleFormData(data)
}) })
} }
/** /**
* 任务列表 * 任务列表
*/ */
export function taskExecutionFindByBizId(params) { export function taskExecutionFindByBizId(params) {
return request({ return request({
url: BASE_API() + '/workflow/taskExecution/findByBizId', url: BASE_API() + '/workflow/taskExecution/findByBizId',
method: 'get', method: 'get',
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}, },
params params
}) })
} }
/** /**
* 启动流程 * 启动流程
*/ */
export function startProcessInstanceByKey(data, key) { export function startProcessInstanceByKey(data, key) {
data.processDefinitionKey = key data.processDefinitionKey = key
data.processAction = 'save' data.processAction = 'save'
data.flowKind = 'APPROVAL' data.flowKind = 'APPROVAL'
data.procUnitId = data.id ? 'APPROVE' : 'APPLY' data.procUnitId = data.id ? 'APPROVE' : 'APPLY'
return request({ return request({
url: BASE_API() + '/workflow/startProcessInstanceByKey', url: BASE_API() + '/workflow/startProcessInstanceByKey',
method: 'post', method: 'post',
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}, },
data: handleFormData(data) data: handleFormData(data)
}) })
} }
/** /**
* 提交流程 * 提交流程
*/ */
export function advance(data) { export function advance(data) {
data.procUnitId = 'approve' data.procUnitId = 'approve'
data.processAction = 'advance' data.processAction = 'advance'
return request({ return request({
url: BASE_API() + '/workflow/advance', url: BASE_API() + '/workflow/advance',
method: 'post', method: 'post',
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}, },
data: handleFormData(data) data: handleFormData(data)
}) })
} }
/** /**
* 页面离开 * 页面离开
*/ */
export function editFlowTest(data) { export function editFlowTest(data) {
return request({ return request({
url: BASE_API() + '/flowTest/editFlowTest', url: BASE_API() + '/flowTest/editFlowTest',
method: 'post', method: 'post',
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}, },
data data
}) })
} }
/** /**
* 流程轨迹 * 流程轨迹
*/ */
export function queryApprovalHistoryByBizId(data) { export function queryApprovalHistoryByBizId(data) {
return request({ return request({
url: BASE_API() + '/workflow/queryApprovalHistoryByBizId', url: BASE_API() + '/workflow/queryApprovalHistoryByBizId',
method: 'post', method: 'post',
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}, },
data: handleFormData(data) data: handleFormData(data)
}) })
} }
import router from './router' import router from './router'
import store from './store' import store from './store'
// import { getToken } from '@/utils/auth' // get token from cookie // import { getToken } from '@/utils/auth' // get token from cookie
// import { login } from '@/api/login' // import { login } from '@/api/login'
// 过滤器白名单 // 过滤器白名单
const whiteList = ['/login'] // no redirect whitelist const whiteList = ['/login'] // no redirect whitelist
// const hasToken = getToken() // const hasToken = getToken()
router.beforeEach(async to => { router.beforeEach(async to => {
const hasToken = store.getters.token const hasToken = store.getters.token
console.log('to---', to, hasToken, store) console.log('to---', to, hasToken, store)
if (to.meta.title) { if (to.meta.title) {
document.title = to.meta.title document.title = to.meta.title
} }
if (hasToken) { if (hasToken) {
return true return true
} else { } else {
try { try {
if (whiteList.indexOf(to.path) !== -1) { if (whiteList.indexOf(to.path) !== -1) {
return true return true
} else { } else {
return { path: `/login`, query: { ...to.query } } return { path: `/login`, query: { ...to.query }}
} }
} catch (error) { } catch (error) {
return { path: `/login`, query: { ...to.query } } return { path: `/login`, query: { ...to.query }}
} }
} }
// if (hasToken) { // if (hasToken) {
// if (to.path.indexOf('delivery-plan-approve') !== -1) { // if (to.path.indexOf('delivery-plan-approve') !== -1) {
// return { replace: true, path: '/month-flow', query: { ...to.query } } // return { replace: true, path: '/month-flow', query: { ...to.query } }
// } else { // } else {
// return { replace: true, path: '/month-flow', query: { ...to.query } } // return { replace: true, path: '/month-flow', query: { ...to.query } }
// } // }
// } else { // } else {
// if (to.query?.taskToken) { // if (to.query?.taskToken) {
// login({ ...to.query }) // login({ ...to.query })
// .then(async res => { // .then(async res => {
// if (res.status === 1) { // if (res.status === 1) {
// await store.dispatch('setToken', res.data.token) // await store.dispatch('setToken', res.data.token)
// store.commit('SET_USERINFO', res.data.operator || {}) // store.commit('SET_USERINFO', res.data.operator || {})
// if (to.path.indexOf('delivery-plan-approve') !== -1) { // if (to.path.indexOf('delivery-plan-approve') !== -1) {
// return { path: '/month-flow', query: { ...to.query } } // return { path: '/month-flow', query: { ...to.query } }
// } else { // } else {
// return true // return true
// } // }
// } else { // } else {
// return { path: `/login?redirect=${to.path}`, query: { ...to.query } } // return { path: `/login?redirect=${to.path}`, query: { ...to.query } }
// } // }
// }) // })
// .catch(() => { // .catch(() => {
// return { path: `/login?redirect=${to.path}`, query: { ...to.query } } // return { path: `/login?redirect=${to.path}`, query: { ...to.query } }
// }) // })
// } else { // } else {
// if (whiteList.indexOf(to.path) !== -1) { // if (whiteList.indexOf(to.path) !== -1) {
// if (to.path.indexOf('delivery-plan-approve') !== -1) { // if (to.path.indexOf('delivery-plan-approve') !== -1) {
// return { path: '/month-flow', query: { ...to.query } } // return { path: '/month-flow', query: { ...to.query } }
// } else { // } else {
// return true // return true
// } // }
// } else { // } else {
// if (to.path.indexOf('delivery-plan-approve') !== -1) { // if (to.path.indexOf('delivery-plan-approve') !== -1) {
// return '/month-flow' // return '/month-flow'
// } else { // } else {
// return { path: `/login?redirect=${to.path}`, query: { ...to.query } } // return { path: `/login?redirect=${to.path}`, query: { ...to.query } }
// } // }
// } // }
// } // }
// } // }
}) })
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
// 是否需要前缀 // 是否需要前缀
const HEADER_TOKEN_KEY = 'X-Auth-Token' const HEADER_TOKEN_KEY = 'X-Auth-Token'
/** /**
* 获取token * 获取token
*/ */
const getToken = function () { const getToken = function() {
return Cookies.get(HEADER_TOKEN_KEY) return Cookies.get(HEADER_TOKEN_KEY)
} }
/** /**
* 设置token * 设置token
*/ */
const setToken = function (token) { const setToken = function(token) {
return Cookies.set(HEADER_TOKEN_KEY, token) return Cookies.set(HEADER_TOKEN_KEY, token)
} }
/** /**
* 删除token * 删除token
*/ */
const clearToken = function () { const clearToken = function() {
return Cookies.remove(HEADER_TOKEN_KEY) return Cookies.remove(HEADER_TOKEN_KEY)
} }
export { HEADER_TOKEN_KEY, getToken, setToken, clearToken } export { HEADER_TOKEN_KEY, getToken, setToken, clearToken }
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div class="block" v-for="(item, index) in sourceData" :key="index"> <div class="block" v-for="(item, index) in sourceData" :key="index">
<div class="top-block"> <div class="top-block">
<van-cell title="开票客户" :value="item.customer" /> <van-cell title="开票客户" :value="item.customer" />
<van-cell title="发货计划类型" :value="invoiceCondition.planType" /> <van-cell title="发货计划类型" :value="invoiceCondition.planTypeTextView" />
<van-cell title="发票号" :value="item.invoId" /> <van-cell title="发票号" :value="item.invoId" />
<van-cell title="开票日期" :value="item.invoiceDate" /> <van-cell title="开票日期" :value="item.invoiceDate" />
<van-cell title="开票量" :value="item.useQuantity" /> <van-cell title="开票量" :value="item.useQuantity" />
......
...@@ -132,6 +132,7 @@ export default { ...@@ -132,6 +132,7 @@ export default {
console.log('22asssssss', res) console.log('22asssssss', res)
if (res.status === 1) { if (res.status === 1) {
Toast('提交成功') Toast('提交成功')
window.close()
} }
} }
}, },
......
...@@ -130,6 +130,7 @@ export default { ...@@ -130,6 +130,7 @@ export default {
console.log('22asssssss', res) console.log('22asssssss', res)
if (res.status === 1) { if (res.status === 1) {
Toast('提交成功') Toast('提交成功')
window.close()
} }
} }
}, },
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
<div class="block"> <div class="block">
<div class="top-block"> <div class="top-block">
<van-cell title="发运单号" :value="conditions.wantCode" /> <van-cell title="发运单号" :value="conditions.wantCode" />
<van-cell title="发货计划类型" :value="conditions.planType" /> <van-cell title="发货计划类型" :value="conditions.planTypeTextView" />
<van-cell title="制票类型" :value="conditions.noticeSheetType" /> <van-cell title="制票类型" :value="conditions.noticeSheetTypeTextView" />
<van-cell title="开票客户" :value="conditions.customerName" /> <van-cell title="开票客户" :value="conditions.customerName" />
<van-cell title="订单客户" :value="conditions.billCustomer" /> <van-cell title="订单客户" :value="conditions.billCustomer" />
<van-cell title="渠道类型" :value="conditions.channelsType" /> <van-cell title="渠道类型" :value="conditions.channelsTypeTextView" />
<van-cell title="年度" :value="conditions.quotasYear" /> <van-cell title="年度" :value="conditions.quotasYear" />
</div> </div>
<div <div
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
v-for="(item, index) in conditions.wantGoodsDetailList" v-for="(item, index) in conditions.wantGoodsDetailList"
:key="index" :key="index"
> >
<van-cell title="产品类别" :value="item.brandBq" /> <van-cell title="产品类别" :value="item.brandBqTextView" />
<van-cell title="产品描述" :value="item.productDesc" /> <van-cell title="产品描述" :value="item.productDesc" />
<van-cell title="未发货件数" :value="item.undeliveredQuantity" /> <van-cell title="未发货件数" :value="item.undeliveredQuantity" />
<van-cell title="本月计划剩余数" :value="item.monthLeftQty" /> <van-cell title="本月计划剩余数" :value="item.monthLeftQty" />
...@@ -38,20 +38,22 @@ ...@@ -38,20 +38,22 @@
<div class="block form-block"> <div class="block form-block">
<van-cell-group> <van-cell-group>
<van-field <van-field
v-if="taskNode === 'base'" v-if="isShowBase"
v-model="form.baseAuditQuantity" v-model="form.baseAuditQuantity"
:required="taskNode === 'base'"
label="基地审批量" label="基地审批量"
placeholder="" placeholder=""
/> />
<van-field <van-field
v-else-if="taskNode === 'warZone'" v-if="isShowWarZone"
v-model="form.warAuditQuantity" v-model="form.warAuditQuantity"
label="战区审批量" label="战区审批量"
:required="taskNode === 'warZone'"
placeholder="" placeholder=""
error-message="" error-message=""
/> />
<van-field <van-field
v-else-if="taskNode === 'work'" v-if="isShowWork"
v-model="form.salecenterAuditQuantity" v-model="form.salecenterAuditQuantity"
required required
label="内勤审批量" label="内勤审批量"
...@@ -79,7 +81,7 @@ ...@@ -79,7 +81,7 @@
</div> </div>
<div class="block form-block"> <div class="block form-block">
<van-cell-group> <van-cell-group>
<van-field v-model="conditions.isShunt" label="是否分流" placeholder="" /> <van-field v-model="conditions.isShuntTextView" label="是否分流" placeholder="" />
<van-field <van-field
v-model="conditions.shuntDealer" v-model="conditions.shuntDealer"
label="分流经销商" label="分流经销商"
...@@ -87,7 +89,7 @@ ...@@ -87,7 +89,7 @@
error-message="" error-message=""
/> />
<van-field <van-field
v-model="conditions.shuntChannelsType" v-model="conditions.noticeSheetTypeTextView"
label="分流经渠道" label="分流经渠道"
placeholder="" placeholder=""
error-message="" error-message=""
...@@ -127,7 +129,7 @@ ...@@ -127,7 +129,7 @@
error-message="" error-message=""
/> />
<van-field <van-field
v-model="conditions.selfacceptance" v-model="conditions.selfacceptanceTextView"
label="是否自提" label="是否自提"
placeholder="" placeholder=""
error-message="" error-message=""
...@@ -256,7 +258,16 @@ export default { ...@@ -256,7 +258,16 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters['token'] ...mapGetters['token'],
isShowBase() {
return this.taskNode === 'base' || this.isShowWarZone || this.isShowWork
},
isShowWarZone() {
return this.taskNode === 'warZone' || this.isShowWork
},
isShowWork() {
return this.taskNode === 'work'
}
}, },
created() { created() {
const { id, taskId } = this.$route.query const { id, taskId } = this.$route.query
...@@ -277,6 +288,7 @@ export default { ...@@ -277,6 +288,7 @@ export default {
}, },
checkDetail() { checkDetail() {
this.invoiceCondition.planType = this.conditions.planType this.invoiceCondition.planType = this.conditions.planType
this.invoiceCondition.planTypeTextView = this.conditions.planTypeTextView
this.invoiceOccupancyDetailShow = true this.invoiceOccupancyDetailShow = true
// this.$router.push({ name: 'InvoiceOccupancyDetail' }) // this.$router.push({ name: 'InvoiceOccupancyDetail' })
}, },
...@@ -285,9 +297,19 @@ export default { ...@@ -285,9 +297,19 @@ export default {
}, },
initDetail() { initDetail() {
apiWantgoodsFindById(this.conditions).then(res => { apiWantgoodsFindById(this.conditions).then(res => {
console.log(res.data)
res.data.pyear += '' res.data.pyear += ''
this.conditions = { ...this.conditions, ...res.data } this.conditions = { ...this.conditions, ...res.data }
for (const key in this.conditions) {
if (this.conditions.hasOwnProperty(key)) {
if (key === 'isShunt') {
this.conditions.isShuntTextView = this.FormDictionaryForYesOrNot(this.conditions[key])
} else if (key === 'selfacceptance') {
this.conditions.selfacceptanceTextView = this.FormDictionaryForYesOrNot(
this.conditions[key]
)
}
}
}
}) })
}, },
flowPath() { flowPath() {
...@@ -313,6 +335,7 @@ export default { ...@@ -313,6 +335,7 @@ export default {
console.log('22asssssss', res) console.log('22asssssss', res)
if (res.status === 1) { if (res.status === 1) {
Toast('提交成功') Toast('提交成功')
window.close()
} }
} }
}, },
...@@ -332,6 +355,12 @@ export default { ...@@ -332,6 +355,12 @@ export default {
} }
} }
}, },
FormDictionaryForYesOrNot(val) {
return {
0: '否',
1: '是'
}[val * 1]
},
onClickLeft() {} onClickLeft() {}
} }
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
const path = require('path') const path = require('path')
module.exports = { module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? '/qywx/' : '',
css: { css: {
loaderOptions: { loaderOptions: {
sass: { sass: {
......
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