Compare commits
163 Commits
feature/nu
...
4051b31101
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4051b31101 | ||
|
|
94b1788e8c | ||
|
|
7944a1a8e3 | ||
|
|
17b28025d8 | ||
|
|
0a6b77943f | ||
|
|
a599566b20 | ||
|
|
1a7031342f | ||
|
|
516a8edb5e | ||
|
|
f4e2100882 | ||
|
|
9f6998e042 | ||
|
|
f730850d93 | ||
|
|
0ef83a945f | ||
|
|
cbfd68f50c | ||
|
|
7762eb6d24 | ||
|
|
db1a323921 | ||
|
|
1a61475f57 | ||
|
|
356e6438e0 | ||
|
|
5fe82a68ef | ||
|
|
9b6e02810a | ||
|
|
f0a32ad868 | ||
|
|
ce64bfd54d | ||
|
|
a53d25fae2 | ||
|
|
08d5e0e4fd | ||
|
|
b23f8325f4 | ||
|
|
0adb2b1486 | ||
|
|
38082397a9 | ||
|
|
4d527dc8ec | ||
|
|
d90aca62e4 | ||
|
|
44f11be05c | ||
|
|
7a21ab3804 | ||
|
|
6bb4802f15 | ||
|
|
cfc8f3c8e0 | ||
|
|
3f26b8b6df | ||
|
|
350ca644cf | ||
|
|
99b507657f | ||
|
|
2e93f1465f | ||
|
|
07a4d0637f | ||
|
|
66a721c1eb | ||
|
|
5efd2a1d3f | ||
|
|
d0c447bb41 | ||
|
|
ebc143a052 | ||
|
|
70b77669ab | ||
|
|
7393bcbc6e | ||
|
|
2abdab1b20 | ||
|
|
d1a8800a9b | ||
|
|
ced505b585 | ||
|
|
25010984f9 | ||
|
|
75d5971e42 | ||
|
|
f5085b1cb3 | ||
|
|
baa5c3124a | ||
|
|
d1ae5ff2c7 | ||
|
|
962d2a4068 | ||
|
|
3adbb68466 | ||
|
|
7f086f8b83 | ||
|
|
95689baff9 | ||
|
|
d39650eca5 | ||
|
|
4f44f50db5 | ||
|
|
27a2052241 | ||
|
|
072390dc13 | ||
|
|
385447d3b4 | ||
|
|
532ceeb5e7 | ||
|
|
2275590461 | ||
|
|
d25b082eff | ||
|
|
6feaeb22bf | ||
|
|
dad169496c | ||
|
|
3eef1eeb3c | ||
|
|
f108a61293 | ||
|
|
e1231d408c | ||
|
|
c073c8d0bd | ||
|
|
437ae1425c | ||
|
|
b6dcddac6f | ||
|
|
e283d6a650 | ||
|
|
230f8c3b80 | ||
|
|
382be3d32f | ||
|
|
a7c3b22f87 | ||
|
|
3585cceca8 | ||
|
|
908e65f136 | ||
|
|
7828af24fd | ||
|
|
185630ad2c | ||
|
|
67c4c8032e | ||
|
|
39ce5404c1 | ||
|
|
9f02c2d011 | ||
|
|
9d369e9a0f | ||
|
|
19a9486f48 | ||
|
|
ab9ec446c7 | ||
|
|
0d3d8f23bb | ||
|
|
971742b392 | ||
|
|
63a425cf77 | ||
|
|
e11d504f18 | ||
|
|
0e35945d4a | ||
|
|
0762067bec | ||
|
|
290ecb6823 | ||
|
|
ee15427e88 | ||
|
|
06fa7b636e | ||
|
|
225c0088e1 | ||
|
|
ae83152271 | ||
|
|
b1c0beb8f6 | ||
|
|
4d96417661 | ||
|
|
711db33df3 | ||
|
|
b7c0350134 | ||
|
|
9ff89c19f3 | ||
|
|
4684952973 | ||
|
|
4ead05b251 | ||
|
|
cf62d2f508 | ||
|
|
a894db0144 | ||
|
|
a748a8b337 | ||
|
|
37a6cb3457 | ||
|
|
045449331f | ||
|
|
4c72bd2ac9 | ||
|
|
b3942f5822 | ||
|
|
0b6bc910c4 | ||
|
|
a4233d5f2c | ||
|
|
31c874e1ba | ||
|
|
d40830188d | ||
|
|
e789570a1b | ||
|
|
0de94d76ee | ||
|
|
536f579523 | ||
|
|
c8d75ab72a | ||
|
|
ad9676c040 | ||
|
|
29bd119ff4 | ||
|
|
b07cca9bcf | ||
|
|
1c2364574d | ||
|
|
528082fc6b | ||
|
|
823c327894 | ||
|
|
39f6275e31 | ||
|
|
44d971998a | ||
|
|
6d7769e61a | ||
|
|
afe1df98f3 | ||
|
|
97bd799b6d | ||
|
|
3316b73450 | ||
|
|
eee06c837d | ||
|
|
c4ae782195 | ||
|
|
2b22db2bf3 | ||
|
|
30cf69df04 | ||
|
|
54352ece58 | ||
|
|
daffd10bce | ||
|
|
a22b574614 | ||
|
|
e3c79f232d | ||
|
|
1ae371cb30 | ||
|
|
96d24a8b22 | ||
|
|
34eb7320fa | ||
|
|
9fa56ad890 | ||
|
|
263dd9ea37 | ||
|
|
85de031db2 | ||
|
|
a6f11e56a7 | ||
|
|
15f6dc6499 | ||
|
|
b64b102682 | ||
|
|
576553e962 | ||
|
|
ff5e2d4fe2 | ||
|
|
3f41df22a9 | ||
|
|
043aaf8399 | ||
|
|
a5e0f3a6c5 | ||
|
|
f9123942ca | ||
|
|
b67e30ce25 | ||
|
|
5a2762a7c6 | ||
|
|
c43a8992fd | ||
|
|
705a252618 | ||
|
|
e2e957880b | ||
|
|
104f5d1049 | ||
|
|
b3f11698f2 | ||
|
|
285e242e9e | ||
|
|
00b2dbb4a4 | ||
|
|
0b41291bf1 |
@@ -1,5 +0,0 @@
|
|||||||
VUE_APP_SCOPE=biaopin
|
|
||||||
#VUE_APP_API=https://web.fdfengshou.cn/
|
|
||||||
#VUE_APP_API=http://192.168.1.87:9000/
|
|
||||||
VUE_APP_API=https://www.wyzzb.com
|
|
||||||
#VUE_APP_API=http://test87web.cunwuyun.cn/
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
VUE_APP_SCOPE=fengdu
|
|
||||||
#VUE_APP_API=https://web.fdfengshou.cn/
|
|
||||||
VUE_APP_API=http://192.168.1.87:9000/
|
|
||||||
#VUE_APP_API=http://test87web.cunwuyun.cn/
|
|
||||||
5
.env.xumu
Normal file
5
.env.xumu
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
VUE_APP_SCOPE=xumu
|
||||||
|
VUE_APP_API=http://192.168.1.87:12413
|
||||||
|
VUE_APP_IS_SIMPLE_SERVER=1
|
||||||
|
VUE_APP_PORT=12413
|
||||||
|
VUE_APP_OMS_ID=2cd70a15-a3cf-4b4d-9a22-0f3b3a888b08 # oms定制方案的ID
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -27,3 +27,7 @@ yarn-error.log*
|
|||||||
/project/*/dist
|
/project/*/dist
|
||||||
/ui/package-lock.json
|
/ui/package-lock.json
|
||||||
/examples/modules.json
|
/examples/modules.json
|
||||||
|
/examples/router/apps.js
|
||||||
|
/src/apps/
|
||||||
|
/src/config.json
|
||||||
|
/src/utils/apps.js
|
||||||
|
|||||||
5
.npmrc
5
.npmrc
@@ -1,5 +1,4 @@
|
|||||||
registry=http://192.168.1.87:4873/
|
|
||||||
email=aixianling@sinoecare.com
|
email=aixianling@sinoecare.com
|
||||||
always-auth=true
|
|
||||||
package-lock=false
|
package-lock=false
|
||||||
//192.168.1.87:4873/:_auth="YWRtaW46YWRtaW4xMjM="
|
registry=http://registry.npmmirror.com
|
||||||
|
legacy-peer-deps=true
|
||||||
|
|||||||
99
bin/build.js
Normal file
99
bin/build.js
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
const axios = require('axios')
|
||||||
|
const {fsExtra, copyFiles, findApp, chalkTag, fs} = require("./tools");
|
||||||
|
const compiler = require('vue-template-compiler')
|
||||||
|
const getBuildConfig = id => {
|
||||||
|
axios.post('http://192.168.1.87:12525/node/custom/detail', null, {params: {id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const config = res.data.data
|
||||||
|
fsExtra.outputJson('src/config.json', config.extra)
|
||||||
|
createPages(config)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const getAppInfo = (file, apps) => {
|
||||||
|
if (/[\\\/](App[A-Z][^\\\/]+)\.vue$/g.test(file)) {
|
||||||
|
const name = file.replace(/.+[\\\/](App[^\\\/]+)\.vue$/, '$1'),
|
||||||
|
source = fs.readFileSync(file).toString(),
|
||||||
|
parsed = compiler.parseComponent(source),
|
||||||
|
script = parsed.script?.content || "",
|
||||||
|
label = script.match(/label:[^,]+/)?.[0]?.replace(/.+["']([^"']+).+/, '$1')
|
||||||
|
const paths = file.split(/[\\\/]/)
|
||||||
|
apps.push({
|
||||||
|
id: file.replace(/\.vue$/, '').replace(/[\\\/]/g, '_'),
|
||||||
|
label: label || name,
|
||||||
|
path: `/${file.replace(/\.vue$/, '').replace(/[\\\/]/g, '/')}`,
|
||||||
|
workspace: paths.at(0),
|
||||||
|
esm: file.replace(/[\\\/]/g, '/').substring(4),
|
||||||
|
name
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据配置生成应用路由
|
||||||
|
* @param {Object} config - 配置对象,用于定制化路由生成过程
|
||||||
|
* @returns {Promise} - 返回一个Promise对象,表示路由生成完成
|
||||||
|
*/
|
||||||
|
const createRoutes = (config = {}) => {
|
||||||
|
// 初始化路由数组
|
||||||
|
const routes = []
|
||||||
|
// 获取签到页面的路径,如果未指定,则使用默认路径
|
||||||
|
let signPage = '../views/sign'
|
||||||
|
let {signPage: sign, homePage: home = "console"} = config.extra || {}
|
||||||
|
if (config.extra?.signPage) {
|
||||||
|
signPage = `../apps/custom/${sign}/${sign}`
|
||||||
|
}
|
||||||
|
let homePage = `../views/console`
|
||||||
|
if (config.extra?.homePage) {
|
||||||
|
homePage = `../apps/custom/${home}/${home}`
|
||||||
|
}
|
||||||
|
// 查找并处理所有应用,将它们的信息添加到路由中
|
||||||
|
return findApp("src/apps", app => getAppInfo(app, routes)).then(() => {
|
||||||
|
// 生成并输出apps.js文件,定义所有应用的路由
|
||||||
|
fsExtra.outputFile('src/utils/apps.js', `export default [
|
||||||
|
{path: "/login", name: "登录", component: () => import('${signPage}')},
|
||||||
|
{path: '/dv', name: '数据大屏入口', component: () => import('../views/dvIndex')},
|
||||||
|
{path: '/v', name: 'Home', component: () => import('../views/home'), children: [
|
||||||
|
{path:'/',name:'mainEntry', component:()=>import('../views/mainEntry'),children:[
|
||||||
|
{name: "${home}", path: "${home}", component: () => import('${homePage}')},
|
||||||
|
${routes.filter(e => ![sign, home].includes(e.name)).map(e => {
|
||||||
|
// 解构每个路由的属性,用于生成路由配置
|
||||||
|
const {name, label, esm} = e
|
||||||
|
// 生成单个路由配置的字符串表示
|
||||||
|
return `{name:"${name}",label:"${label}",path:"${name}",component:()=>import("../${esm}")}`
|
||||||
|
}).join(',\n')},
|
||||||
|
{path: '*',name: '404',component: ()=>import('../views/building')},
|
||||||
|
]}
|
||||||
|
]},
|
||||||
|
{path: '/', name: "init"},
|
||||||
|
|
||||||
|
]`)
|
||||||
|
// 扫描完毕,使用chalkTag标记任务完成
|
||||||
|
chalkTag.done("扫描完毕")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const createPages = (config = {}) => {
|
||||||
|
fsExtra.emptyDir("src/apps", err => {
|
||||||
|
if (!err) {
|
||||||
|
const {customPath, appList} = config
|
||||||
|
const stdApps = {}
|
||||||
|
appList.filter(e => !/project/.test(e.id))?.forEach(e => {
|
||||||
|
const paths = e.libPath.split('/').filter(Boolean) || []
|
||||||
|
paths.pop()
|
||||||
|
stdApps[paths.join("/")] = 1
|
||||||
|
})
|
||||||
|
Promise.all([
|
||||||
|
copyFiles("src/apps/core", "packages/core"),
|
||||||
|
copyFiles("src/apps/custom", `project/${customPath}`),
|
||||||
|
...Object.keys(stdApps).map(e => copyFiles(`src/apps/${e.replace(/^packages[\\\/]/, '')}`, e)),
|
||||||
|
]).then(() => createRoutes(config)).then(() => fsExtra.ensureFile("src/apps/actions.js"))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const start = () => {
|
||||||
|
const buildId = process.argv[2] || process.env.VUE_APP_OMS_ID || 'f670cc46-7cf7-4a0f-86ee-3077044c0b17'
|
||||||
|
getBuildConfig(buildId)
|
||||||
|
}
|
||||||
|
start()
|
||||||
33
bin/mods.js
33
bin/mods.js
@@ -1,33 +0,0 @@
|
|||||||
const {chalkTag, findApp, fs, fsExtra} = require("./tools");
|
|
||||||
const compiler = require('vue-template-compiler')
|
|
||||||
const getAppInfo = (file, apps) => {
|
|
||||||
if (/[\\\/](App[A-Z][^\\\/]+)\.vue$/g.test(file)) {
|
|
||||||
const name = file.replace(/.+[\\\/](App[^\\\/]+)\.vue$/, '$1'),
|
|
||||||
source = fs.readFileSync(file).toString(),
|
|
||||||
parsed = compiler.parseComponent(source),
|
|
||||||
script = parsed.script?.content || "",
|
|
||||||
label = script.match(/label:[^,]+/)?.[0]?.replace(/.+["']([^"']+).+/, '$1')
|
|
||||||
const paths = file.split(/[\\\/]/)
|
|
||||||
apps.push({
|
|
||||||
id: file.replace(/\.vue$/, '').replace(/[\\\/]/g, '_'),
|
|
||||||
label: label || name,
|
|
||||||
path: `/${file.replace(/\.vue$/, '').replace(/[\\\/]/g, '/')}`,
|
|
||||||
workspace: paths.at(0),
|
|
||||||
esm: ['.', paths.slice(1)].flat().join("/"),
|
|
||||||
name
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const start = () => {
|
|
||||||
chalkTag.info("开始扫描库工程...")
|
|
||||||
const list = []
|
|
||||||
Promise.all([
|
|
||||||
findApp('packages', app => getAppInfo(app, list)),
|
|
||||||
findApp('project', app => getAppInfo(app, list)),
|
|
||||||
]).then(() => {
|
|
||||||
fsExtra.outputJson('examples/modules.json', {apps: list})
|
|
||||||
chalkTag.done("扫描完毕")
|
|
||||||
})
|
|
||||||
}
|
|
||||||
start()
|
|
||||||
37
bin/scanApps.js
Normal file
37
bin/scanApps.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
const {chalkTag, findApp, fs, fsExtra} = require("./tools");
|
||||||
|
const compiler = require('vue-template-compiler')
|
||||||
|
const getAppInfo = (file, apps) => {
|
||||||
|
if (/[\\\/](App[A-Z][^\\\/]+)\.vue$/g.test(file)) {
|
||||||
|
const name = file.replace(/.+[\\\/](App[^\\\/]+)\.vue$/, '$1'),
|
||||||
|
source = fs.readFileSync(file).toString(),
|
||||||
|
parsed = compiler.parseComponent(source),
|
||||||
|
script = parsed.script?.content || "",
|
||||||
|
label = script.match(/label:[^,]+/)?.[0]?.replace(/.+["']([^"']+).+/, '$1')
|
||||||
|
const paths = file.split(/[\\\/]/)
|
||||||
|
apps.push({
|
||||||
|
id: file.replace(/\.vue$/, '').replace(/[\\\/]/g, '_'),
|
||||||
|
label: label || name,
|
||||||
|
path: `/${file.replace(/\.vue$/, '').replace(/[\\\/]/g, '/')}`,
|
||||||
|
workspace: paths.at(0),
|
||||||
|
esm: file.replace(/[\\\/]/g, '/'),
|
||||||
|
name
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const start = () => {
|
||||||
|
chalkTag.info("开始扫描库工程...")
|
||||||
|
const {VUE_APP_SCOPE, VUE_APP_CORE} = process.env
|
||||||
|
const list = []
|
||||||
|
let scanScope = ['packages', 'project']
|
||||||
|
if (VUE_APP_SCOPE) scanScope = [`project/${VUE_APP_SCOPE}`]
|
||||||
|
if (VUE_APP_CORE) scanScope.push('packages/core')
|
||||||
|
Promise.all(scanScope.map(e => findApp(e, app => getAppInfo(app, list)))).then(() => {
|
||||||
|
fsExtra.outputFile('examples/router/apps.js', `export default [${list.map(e => {
|
||||||
|
const {name, label, path, esm} = e
|
||||||
|
return `{name:"${name}",label:"${label}",path:"${path}",component:()=>import("@${esm}")}`
|
||||||
|
}).join(',\n')}]`)
|
||||||
|
chalkTag.done("扫描完毕")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
start()
|
||||||
@@ -9,13 +9,13 @@
|
|||||||
</template>
|
</template>
|
||||||
</header-nav>
|
</header-nav>
|
||||||
<ai-dv-wrapper class="fill" v-if="dvDev">
|
<ai-dv-wrapper class="fill" v-if="dvDev">
|
||||||
<router-view/>
|
<router-view v-bind="commonAttrs"/>
|
||||||
</ai-dv-wrapper>
|
</ai-dv-wrapper>
|
||||||
<el-row v-else-if="showTools" class="fill mar-t48" type="flex">
|
<el-row v-else-if="showTools" class="fill mar-t48" type="flex">
|
||||||
<slider-nav/>
|
<slider-nav/>
|
||||||
<main-content class="fill"/>
|
<main-content class="fill" :commonAttrs="commonAttrs"/>
|
||||||
</el-row>
|
</el-row>
|
||||||
<router-view class="fill" v-else/>
|
<router-view class="fill" v-else v-bind="commonAttrs"/>
|
||||||
<div v-if="dialog" class="sign-box">
|
<div v-if="dialog" class="sign-box">
|
||||||
<ai-sign style="margin: auto" :instance="$request" :action="{login}"
|
<ai-sign style="margin: auto" :instance="$request" :action="{login}"
|
||||||
visible @login="getToken" :showScanLogin="false"/>
|
visible @login="getToken" :showScanLogin="false"/>
|
||||||
@@ -30,7 +30,7 @@ import MainContent from "./components/mainContent";
|
|||||||
import HeaderNav from "./components/headerNav";
|
import HeaderNav from "./components/headerNav";
|
||||||
import {mapActions, mapMutations, mapState} from "vuex";
|
import {mapActions, mapMutations, mapState} from "vuex";
|
||||||
import Mock from "./components/mock";
|
import Mock from "./components/mock";
|
||||||
import AiDvWrapper from "@dui/dv/layout/AiDvWrapper/AiDvWrapper.vue";
|
import AiDvWrapper from "dui/dv/layout/AiDvWrapper/AiDvWrapper.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'app',
|
name: 'app',
|
||||||
@@ -42,6 +42,13 @@ export default {
|
|||||||
/project\/sass/g.test(location.pathname) && (url += "?corpId=ww596787bb70f08288")
|
/project\/sass/g.test(location.pathname) && (url += "?corpId=ww596787bb70f08288")
|
||||||
return url
|
return url
|
||||||
},
|
},
|
||||||
|
commonAttrs() {
|
||||||
|
return {
|
||||||
|
instance: this.$request,
|
||||||
|
dict: this.$dict,
|
||||||
|
permissions: this.$permissions
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -76,7 +83,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
wx = jWeixin
|
const {jWeixin} = window
|
||||||
|
window.wx = jWeixin
|
||||||
if (this.user.token) this.getUserInfo().finally(() => {
|
if (this.user.token) this.getUserInfo().finally(() => {
|
||||||
if (/^\/project\/xiushan/.test(location.pathname)) {
|
if (/^\/project\/xiushan/.test(location.pathname)) {
|
||||||
this.getFinanceUser()
|
this.getFinanceUser()
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="mainContent">
|
<section class="mainContent">
|
||||||
<ai-nav-tab :routes="apps"/>
|
<ai-nav-tab :routes="$apps"/>
|
||||||
<div class="fill">
|
<div class="fill">
|
||||||
<router-view/>
|
<router-view v-bind="$attrs.commonAttrs"/>
|
||||||
<ai-empty v-if="isHome">欢迎使用村微产品库</ai-empty>
|
<ai-empty v-if="isHome">欢迎使用村微产品库</ai-empty>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -10,13 +10,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AiNavTab from "dui/packages/basic/AiNavTab";
|
import AiNavTab from "dui/packages/basic/AiNavTab";
|
||||||
import {mapState} from "vuex"
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "mainContent",
|
name: "mainContent",
|
||||||
components: {AiNavTab},
|
components: {AiNavTab},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['apps']),
|
|
||||||
isHome: v => v.$route.path == '/',
|
isHome: v => v.$route.path == '/',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user', 'apps']),
|
...mapState(['user']),
|
||||||
navs() {
|
navs() {
|
||||||
let reg = new RegExp(`.*${this.searchApp?.replace(/-/g,'')||''}.*`, 'gi')
|
let reg = new RegExp(`.*${this.searchApp?.replace(/-/g,'')||''}.*`, 'gi')
|
||||||
return (this.apps || []).filter(e => !this.searchApp || reg?.test(e.name) || reg?.test(e.label)).map(e => {
|
return (this.$apps || []).filter(e => !this.searchApp || reg?.test(e.name) || reg?.test(e.label)).map(e => {
|
||||||
if (/\/project\//.test(e.path)) {
|
if (/\/project\//.test(e.path)) {
|
||||||
e.project = process.env.VUE_APP_SCOPE || e.path.replace(/.*project\/([^\/]+)\/.+/, '$1')
|
e.project = process.env.VUE_APP_SCOPE || e.path.replace(/.*project\/([^\/]+)\/.+/, '$1')
|
||||||
} else if (/\/core\//.test(e.path)) {
|
} else if (/\/core\//.test(e.path)) {
|
||||||
@@ -52,9 +52,9 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
menuPath() {
|
menuPath() {
|
||||||
let paths = [], current = this.apps?.find(e => e.name == this.$route.name)
|
let paths = [], current = this.$apps?.find(e => e.name == this.$route.name)
|
||||||
const findParent = name => {
|
const findParent = name => {
|
||||||
let menu = this.apps?.find(e => e.name == name)
|
let menu = this.$apps?.find(e => e.name == name)
|
||||||
if (menu) {
|
if (menu) {
|
||||||
paths.push(menu.name)
|
paths.push(menu.name)
|
||||||
if (!!menu.parentId) findParent(menu.parentId)
|
if (!!menu.parentId) findParent(menu.parentId)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import App from './App.vue';
|
import App from './App.vue';
|
||||||
import ui from 'element-ui';
|
import ui from 'element-ui';
|
||||||
import router from './router/router';
|
import router from './router';
|
||||||
import axios from './router/axios';
|
import axios from './router/axios';
|
||||||
import utils from './utils';
|
import utils from './utils';
|
||||||
import dui from 'dui';
|
import dui from 'dui/packages';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
import dataV from '@jiaminghi/data-view';
|
import dataV from '@jiaminghi/data-view';
|
||||||
import dvui from '@dui/dv'
|
import dvui from 'dui/dv'
|
||||||
|
|
||||||
Vue.use(dataV)
|
Vue.use(dataV)
|
||||||
Vue.use(ui);
|
Vue.use(ui);
|
||||||
@@ -22,6 +22,7 @@ const app = new Vue({
|
|||||||
store,
|
store,
|
||||||
render: h => h(App)
|
render: h => h(App)
|
||||||
});
|
});
|
||||||
|
|
||||||
let theme = null
|
let theme = null
|
||||||
store.dispatch('getSystem').then(res => {
|
store.dispatch('getSystem').then(res => {
|
||||||
theme = JSON.parse(res?.colorScheme || null)
|
theme = JSON.parse(res?.colorScheme || null)
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
import store from "../store";
|
|
||||||
import {waiting} from "../utils";
|
|
||||||
import appEntry from "../views/appEntry";
|
|
||||||
import router from "./router";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
routes: () => store.state.apps,
|
|
||||||
init() {
|
|
||||||
//约束正则式
|
|
||||||
store.commit("cleanApps")
|
|
||||||
// 自动化本工程应用
|
|
||||||
waiting.init({innerHTML: '应用加载中..'})
|
|
||||||
let startTime = new Date().getTime()
|
|
||||||
/**
|
|
||||||
* require.context 的路径变量范式只能为静态字符串
|
|
||||||
*/
|
|
||||||
switch (process.env.VUE_APP_SCOPE) {
|
|
||||||
case 'dv':
|
|
||||||
this.esm = {
|
|
||||||
packages: require.context('../../packages/bigscreen', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy')
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'fengdu':
|
|
||||||
this.esm = {
|
|
||||||
project: require.context('../../project/fengdu', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy')
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'ai':
|
|
||||||
this.esm = {
|
|
||||||
biaopin: require.context('../../project/biaopin/AppCopilotConfig', true, /\.\/App[A-Z][^\/]+\.vue$/, 'lazy'),
|
|
||||||
project: require.context('../../project/ai', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy')
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'oms':
|
|
||||||
this.esm = {
|
|
||||||
project: require.context('../../project/oms', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy')
|
|
||||||
}
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
this.esm = {
|
|
||||||
packages: require.context('../../packages/', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy'),
|
|
||||||
project: require.context('../../project/', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log('模块引用用了%s秒', (new Date().getTime() - startTime) / 1000)
|
|
||||||
startTime = new Date().getTime()
|
|
||||||
this.loadApps().finally(() => {
|
|
||||||
console.log('模块加载用了%s秒', (new Date().getTime() - startTime) / 1000)
|
|
||||||
waiting.close()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
loadMods() {
|
|
||||||
// return Promise.all(mods.apps.map(e => {
|
|
||||||
// Vue.component(e.name, this.esm[e.workspace](e.esm))
|
|
||||||
// const addApp = {...e, component: appEntry}
|
|
||||||
// waiting.setContent(`加载${e.name}...`)
|
|
||||||
// //命名规范入口文件必须以App开头
|
|
||||||
// return store.commit("addApp", addApp)
|
|
||||||
// }))
|
|
||||||
},
|
|
||||||
loadApps() {
|
|
||||||
//新App的自动化格式
|
|
||||||
const promise = (mods, base) => Promise.all(mods.keys().map(path => mods(path).then(file => {
|
|
||||||
if (file.default) {
|
|
||||||
const {name, label} = file.default
|
|
||||||
const addApp = {
|
|
||||||
name: [base, path.replace(/\.\/?(vue)?/g, '')?.split("/")].flat().join("_"),
|
|
||||||
label: label || name,
|
|
||||||
path: `/${base}${path.replace(/\.(\/.+\/App.+)\.vue$/, '$1')}`,
|
|
||||||
component: appEntry,
|
|
||||||
esm: file.default
|
|
||||||
}
|
|
||||||
waiting.setContent(`加载${name}...`)
|
|
||||||
router.addRoute(addApp)
|
|
||||||
//命名规范入口文件必须以App开头
|
|
||||||
return store.commit("addApp", addApp)
|
|
||||||
} else return 0
|
|
||||||
}).catch(err => console.log(err))))
|
|
||||||
return Promise.all(Object.entries(this.esm).map(([root, mods]) => promise(mods, root))).catch(console.error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Message} from 'element-ui'
|
import { Message } from 'element-ui'
|
||||||
import instance from '../../ui/lib/js/request'
|
import instance from 'dui/lib/js/request'
|
||||||
|
|
||||||
let baseURLs = {
|
let baseURLs = {
|
||||||
production: "/",
|
production: "/",
|
||||||
@@ -8,34 +8,10 @@ let baseURLs = {
|
|||||||
instance.defaults.baseURL = baseURLs[process.env.NODE_ENV]
|
instance.defaults.baseURL = baseURLs[process.env.NODE_ENV]
|
||||||
instance.interceptors.request.use(config => {
|
instance.interceptors.request.use(config => {
|
||||||
if (config.url.startsWith("/node")) {
|
if (config.url.startsWith("/node")) {
|
||||||
config.baseURL = "/ns"
|
config.url = "/ns" + config.url
|
||||||
} else if (config.url.startsWith("/sse")) {
|
|
||||||
config.baseURL = "/"
|
|
||||||
} else if (/\/project\/activeAnalysis/.test(location.pathname)) {
|
|
||||||
config.baseURL = "/analysis"
|
|
||||||
} else if (/\/project\/beta/.test(location.pathname)) {
|
|
||||||
config.baseURL = "/wg"
|
|
||||||
} else if (/\/project\/sass/.test(location.pathname)) {
|
|
||||||
config.baseURL = "/saas"
|
|
||||||
} else if (/\/tianfuxing/.test(location.pathname)) {
|
|
||||||
config.baseURL = "/tfx"
|
|
||||||
} else if (/\/qianxinan/.test(location.pathname)) {
|
|
||||||
// config.baseURL = "/qxn"
|
|
||||||
} else if (/\/xiushan/.test(location.pathname)) {
|
|
||||||
config.baseURL = "/xsjr"
|
|
||||||
} else if (/project\/oms/.test(location.pathname)) {
|
|
||||||
config.baseURL = "/omsapi"
|
|
||||||
} else if (/#url-/.test(location.hash)) {
|
|
||||||
config.baseURL = location.hash.replace(/#url-/, '/')
|
|
||||||
}
|
|
||||||
if (["/xsjr", "/tfx", "/omsapi"].includes(config.baseURL)) {
|
|
||||||
config.url = config.url.replace(/(app|auth|admin|api)\//, "api/")
|
|
||||||
}
|
|
||||||
if (['/qxn', '/analysis'].includes(config.baseURL)) {
|
|
||||||
config.url = config.url.replace(/(app|auth|admin)\//, "api/")
|
|
||||||
}
|
}
|
||||||
if (process.env.VUE_APP_IS_SIMPLE_SERVER == 1) {
|
if (process.env.VUE_APP_IS_SIMPLE_SERVER == 1) {
|
||||||
config.url = config.url.replace(/(app|auth|admin)\//, "api/")
|
config.url = config.url.replace(/^\/(app|auth|admin)\//, "/api/")
|
||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
}, error => Message.error(error))
|
}, error => Message.error(error))
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import VueRouter from 'vue-router'
|
import VueRouter from 'vue-router'
|
||||||
import autoRoutes from './autoRoutes'
|
import apps from "./apps";
|
||||||
|
|
||||||
Vue.use(VueRouter)
|
Vue.use(VueRouter)
|
||||||
autoRoutes.init()
|
Vue.prototype.$apps = apps
|
||||||
export default new VueRouter({
|
export default new VueRouter({
|
||||||
mode: 'history',
|
mode: 'history',
|
||||||
hashbang: false,
|
hashbang: false,
|
||||||
routes: autoRoutes.routes(),
|
routes: apps,
|
||||||
scrollBehavior(to) {
|
scrollBehavior(to) {
|
||||||
if (to.hash) {
|
if (to.hash) {
|
||||||
return {
|
return {
|
||||||
@@ -5,22 +5,8 @@ import * as modules from "dui/lib/js/modules"
|
|||||||
import xsActions from "../../project/xiushan/actions"
|
import xsActions from "../../project/xiushan/actions"
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
state: {
|
actions: {...xsActions},
|
||||||
apps: []
|
|
||||||
},
|
|
||||||
mutations: {
|
|
||||||
addApp(state, app) {
|
|
||||||
state.apps.push(app)
|
|
||||||
},
|
|
||||||
cleanApps(state) {
|
|
||||||
state.apps = []
|
|
||||||
},
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
...xsActions
|
|
||||||
},
|
|
||||||
modules,
|
modules,
|
||||||
plugins: [preState()]
|
plugins: [preState()]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
<template>
|
|
||||||
<section class="appEntry">
|
|
||||||
<component v-if="app" :is="app" ref="currentPage" :instance="$request" :dict="$dict" :permissions="$permissions"/>
|
|
||||||
<ai-empty v-else>无法找到应用文件</ai-empty>
|
|
||||||
</section>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
import {mapState} from "vuex";
|
|
||||||
import Vue from "vue";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "appEntry",
|
|
||||||
label: "应用库-应用",
|
|
||||||
computed: {
|
|
||||||
...mapState(['apps']),
|
|
||||||
app() {
|
|
||||||
const app = this.apps.find(e => e.name == this.$route.name)
|
|
||||||
return app.esm ?? ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$vm.$on("mock", v => {
|
|
||||||
if (!!this.$refs.currentPage.$children?.[0]?.form) {
|
|
||||||
this.$refs.currentPage.$children[0].form = v
|
|
||||||
this.$refs.currentPage.$children[0].$forceUpdate()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.appEntry {
|
|
||||||
width: 100%;
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
min-height: 0;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
& > * {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
36
package.json
36
package.json
@@ -1,47 +1,42 @@
|
|||||||
{
|
{
|
||||||
"name": "dvcp-web-apps",
|
"name": "dvcp-web-apps",
|
||||||
"version": "3.0.0",
|
"version": "4.0.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"author": "kubbo",
|
"author": "kubbo",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve examples/main.js",
|
"dev": "vue-cli-service serve examples/main.js",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build",
|
||||||
"dev:ai": "vue-cli-service serve examples/main.js --mode ai",
|
"oms": "vue-cli-service serve examples/main.js --mode oms",
|
||||||
"dev:oms": "vue-cli-service serve examples/main.js --mode oms",
|
"xumu": "vue-cli-service serve examples/main.js --mode xumu",
|
||||||
"dev:biaopin": "vue-cli-service serve examples/main.js --mode biaopin",
|
|
||||||
"dev:dv": "vue-cli-service serve examples/main.js --mode dv",
|
|
||||||
"dev:fengdu": "vue-cli-service serve examples/main.js --mode fengdu",
|
|
||||||
"lib": "npm publish||(npm unpublish -f&&npm publish)",
|
|
||||||
"preui": "npm publish -ws||(npm unpublish -f -ws&&npm publish -ws)",
|
|
||||||
"ui": "npm i dui@latest @dui/dv@latest",
|
|
||||||
"sync": "node bin/appsSync.js",
|
"sync": "node bin/appsSync.js",
|
||||||
"preview": "vue-cli-service serve"
|
"preview": "node bin/build.js && vue-cli-service serve",
|
||||||
|
"predev": "node bin/scanApps.js",
|
||||||
|
"preoms": "dotenv -e .env.oms node bin/scanApps.js",
|
||||||
|
"prexumu": "dotenv -e .env.xumu node bin/scanApps.js",
|
||||||
|
"view:xumu": "vue-cli-service serve --mode xumu",
|
||||||
|
"preview:xumu": "dotenv -e .env.xumu node bin/build.js"
|
||||||
},
|
},
|
||||||
"workspaces": [
|
|
||||||
"ui",
|
|
||||||
"ui/dv"
|
|
||||||
],
|
|
||||||
"files": [
|
|
||||||
"packages",
|
|
||||||
"project"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@amap/amap-jsapi-loader": "^1.0.1",
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
||||||
"@dui/dv": "^1.0.0",
|
"@ckeditor/ckeditor5-vue2": "^3.0.1",
|
||||||
"@jiaminghi/data-view": "^2.10.0",
|
"@jiaminghi/data-view": "^2.10.0",
|
||||||
"@logicflow/core": "^1.2.1",
|
"@logicflow/core": "^1.2.1",
|
||||||
"bin-ace-editor": "^3.2.0",
|
"bin-ace-editor": "^3.2.0",
|
||||||
|
"crypto-js": "^4.2.0",
|
||||||
"dayjs": "^1.8.35",
|
"dayjs": "^1.8.35",
|
||||||
"dui": "^2.0.0",
|
"echarts": "^5.5.1",
|
||||||
"echarts-wordcloud": "^2.0.0",
|
"echarts-wordcloud": "^2.0.0",
|
||||||
"hash.js": "^1.1.7",
|
"hash.js": "^1.1.7",
|
||||||
"html2canvas": "^1.4.1",
|
"html2canvas": "^1.4.1",
|
||||||
|
"jspdf": "^2.5.2",
|
||||||
"mp4box": "^0.4.1",
|
"mp4box": "^0.4.1",
|
||||||
"print-js": "^1.0.63",
|
"print-js": "^1.0.63",
|
||||||
"serialize-javascript": "^6.0.0",
|
"serialize-javascript": "^6.0.0",
|
||||||
"sortablejs": "^1.12.0",
|
"sortablejs": "^1.12.0",
|
||||||
"vue-carousel": "^0.18.0",
|
"vue-carousel": "^0.18.0",
|
||||||
|
"vue-cropper": "^0.6.5",
|
||||||
"vue-draggable-resizable": "^2.3.0",
|
"vue-draggable-resizable": "^2.3.0",
|
||||||
|
"vue-qr": "^4.0.9",
|
||||||
"vue-ruler-tool": "^1.2.4",
|
"vue-ruler-tool": "^1.2.4",
|
||||||
"vue-style-loader": "^4.1.3",
|
"vue-style-loader": "^4.1.3",
|
||||||
"vuedraggable": "^2.24.3"
|
"vuedraggable": "^2.24.3"
|
||||||
@@ -56,6 +51,7 @@
|
|||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"core-js": "^2.6.11",
|
"core-js": "^2.6.11",
|
||||||
|
"dotenv-cli": "^7.4.2",
|
||||||
"element-ui": "^2.15.9",
|
"element-ui": "^2.15.9",
|
||||||
"eslint": "^5.16.0",
|
"eslint": "^5.16.0",
|
||||||
"eslint-plugin-vue": "^5.0.0",
|
"eslint-plugin-vue": "^5.0.0",
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ import {monitorTypes} from "../config";
|
|||||||
import ConfigItem from "./configItem.vue";
|
import ConfigItem from "./configItem.vue";
|
||||||
import DatasourcePicker from "./datasourcePicker.vue";
|
import DatasourcePicker from "./datasourcePicker.vue";
|
||||||
import AiSelect from "dui/packages/basic/AiSelect.vue";
|
import AiSelect from "dui/packages/basic/AiSelect.vue";
|
||||||
import {DvCompData} from "@dui/dv";
|
import {DvCompData} from "dui/dv";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'dataConfig',
|
name: 'dataConfig',
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import ConfigItem from "./configItem";
|
|||||||
import ChartPicker from "./chartPicker";
|
import ChartPicker from "./chartPicker";
|
||||||
import JsonEditor from "./jsonEditor";
|
import JsonEditor from "./jsonEditor";
|
||||||
import {layers, monitorTypes} from "../config";
|
import {layers, monitorTypes} from "../config";
|
||||||
import AiDvSummary from "@dui/dv/layout/AiDvSummary/AiDvSummary";
|
import AiDvSummary from "dui/dv/layout/AiDvSummary/AiDvSummary";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "configExtra",
|
name: "configExtra",
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import 'brace/snippets/json';
|
|||||||
import 'brace/theme/github';
|
import 'brace/theme/github';
|
||||||
import 'brace/theme/monokai';
|
import 'brace/theme/monokai';
|
||||||
import JsonEditor from "./jsonEditor.vue";
|
import JsonEditor from "./jsonEditor.vue";
|
||||||
import {DvCompData} from "@dui/dv";
|
import {DvCompData} from "dui/dv";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "datasourcePicker",
|
name: "datasourcePicker",
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
|
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
|
||||||
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
||||||
<el-button type="text" @click="gag(row.createUserId, row.blacklist)">{{ row.blacklist ? '解除禁言' : '禁言' }}</el-button>
|
<el-button type="text" @click="gag(row.createUserId, row.blacklist)">{{ row.blacklist ? '解除禁言' : '禁言' }}</el-button>
|
||||||
|
<el-button type="text" v-if="row.status<1" @click="admin(row)">审核</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -77,7 +78,7 @@
|
|||||||
},
|
},
|
||||||
total: 0,
|
total: 0,
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
{ prop: 'content', label: '内容', align: 'left' },
|
{ prop: 'content', label: '帖子内容', align: 'left' },
|
||||||
{ prop: 'createUserName', label: '发帖人', align: 'center', width: '120' },
|
{ prop: 'createUserName', label: '发帖人', align: 'center', width: '120' },
|
||||||
{ prop: 'createUserAreaName', label: '所属地区', align: 'center' },
|
{ prop: 'createUserAreaName', label: '所属地区', align: 'center' },
|
||||||
{ prop: 'createTime', label: '创建时间', align: 'center' },
|
{ prop: 'createTime', label: '创建时间', align: 'center' },
|
||||||
@@ -85,6 +86,7 @@
|
|||||||
{ prop: 'appreciateCount', label: '点赞数', align: 'center', width: '120' },
|
{ prop: 'appreciateCount', label: '点赞数', align: 'center', width: '120' },
|
||||||
{ prop: 'sharedCount', label: '分享数', align: 'center', width: '120' },
|
{ prop: 'sharedCount', label: '分享数', align: 'center', width: '120' },
|
||||||
{ prop: 'blacklist', label: '状态', align: 'center', format: v => v ? '禁言' : '正常' },
|
{ prop: 'blacklist', label: '状态', align: 'center', format: v => v ? '禁言' : '正常' },
|
||||||
|
{ prop: 'status', label: '审核状态', align: 'center', width: '120', dict: 'auditStatus' },
|
||||||
{ slot: 'options'},
|
{ slot: 'options'},
|
||||||
],
|
],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
@@ -100,7 +102,9 @@
|
|||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.search.areaId = this.user.info.areaId
|
this.search.areaId = this.user.info.areaId
|
||||||
this.getList()
|
this.dict.load('auditStatus').then(() => {
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -172,6 +176,34 @@
|
|||||||
id: id || ''
|
id: id || ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
admin(row) {
|
||||||
|
console.log(row)
|
||||||
|
this.$confirm('是否审核通过该条帖子?', {
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
confirmButtonText: '通过',
|
||||||
|
closeOnClickModal: true,
|
||||||
|
cancelButtonText: '拒绝'
|
||||||
|
}).then((e) => {
|
||||||
|
this.instance.post(`/app/appneighborhoodassistance/examine?id=${row.id}&pass=1`).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('审核成功!')
|
||||||
|
this.search.current = 1
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch((e) => {
|
||||||
|
if(e == 'cancel') {
|
||||||
|
this.instance.post(`/app/appneighborhoodassistance/examine?id=${row.id}&pass=0`).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('审核成功!')
|
||||||
|
this.search.current = 1
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,151 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="AppDictionary">
|
<section class="AppDictionary">
|
||||||
<ai-list v-if="!showDetail">
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
<ai-title slot="title" title="数据字典" isShowBottomBorder/>
|
|
||||||
<template #content>
|
|
||||||
<ai-search-bar>
|
|
||||||
<template #left>
|
|
||||||
<el-button type="primary" size="small" icon="iconfont iconAdd" @click="addDict"
|
|
||||||
v-if="$permissions('admin_sysdictionary_add')">添加
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
<template #right>
|
|
||||||
<el-input size="small" v-model="search.condition" placeholder="数据项" clearable
|
|
||||||
@change="page.current=1,getDicts()" prefix-icon="iconfont iconSearch"/>
|
|
||||||
<el-button type="primary" size="small" icon="iconfont iconSearch"
|
|
||||||
@click="page.current=1,getDicts()">查询
|
|
||||||
</el-button>
|
|
||||||
<el-button size="small" icon="el-icon-refresh-right" @click="resetSearch">重置</el-button>
|
|
||||||
</template>
|
|
||||||
</ai-search-bar>
|
|
||||||
<el-table size="mini" :data="dictList" header-cell-class-name="table-header" tooltip-effect="light"
|
|
||||||
row-class-name="table-row" cell-class-name="table-cell" @expand-change="getDictInfo">
|
|
||||||
<el-table-column type="expand">
|
|
||||||
<el-row slot-scope="{row}" type="flex" align="middle" style="flex-wrap: wrap">
|
|
||||||
<el-tag v-for="(op,i) in row.detail||[]" :key="i" style="margin: 4px">{{ op.dictValue }}|{{ op.dictName }}
|
|
||||||
{{ op.dictColor ? '| ' + op.dictColor : '' }}
|
|
||||||
</el-tag>
|
|
||||||
</el-row>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="数据项" prop="code"/>
|
|
||||||
<el-table-column align="center" label="数据项名称" prop="name"/>
|
|
||||||
<el-table-column align="center" label="操作">
|
|
||||||
<div slot-scope="{row}">
|
|
||||||
<el-button type="text" @click="openDetail(row.id)" v-text="'编辑'"
|
|
||||||
v-if="$permissions('admin_sysdictionary_edit')"/>
|
|
||||||
<el-button type="text" @click="handleDelete(row.id)" v-text="'删除'"
|
|
||||||
v-if="$permissions('admin_sysdictionary_del')"/>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<div slot="empty" class="no-data"></div>
|
|
||||||
</el-table>
|
|
||||||
<div class="pagination">
|
|
||||||
<el-pagination background :current-page.sync="page.current" :total="page.total"
|
|
||||||
layout="total,prev, pager, next,sizes, jumper"
|
|
||||||
@size-change="handleSizeChange"
|
|
||||||
:page-size="page.size"
|
|
||||||
:page-sizes="[10, 20, 50, 100,200]"
|
|
||||||
@current-change="getDicts"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</ai-list>
|
|
||||||
<dict-detail v-else :instance="instance" :permissions="permissions"/>
|
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import DictDetail from "./dictDetail";
|
import DictDetail from "./dictDetail";
|
||||||
|
import DictList from "@project/xumu/AppDictionary/dictList.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AppDictionary",
|
name: "AppDictionary",
|
||||||
components: {DictDetail},
|
|
||||||
label: "数据字典",
|
label: "数据字典",
|
||||||
props: {
|
props: {
|
||||||
instance: Function,
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
permissions: Function
|
permissions: Function
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
showDetail() {
|
currentPage() {
|
||||||
return this.$route.hash == "#add"
|
let {hash} = this.$route
|
||||||
|
return hash == "#add" ? DictDetail : DictList
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
page: {
|
|
||||||
current: 1,
|
|
||||||
total: 0,
|
|
||||||
size: 10
|
|
||||||
},
|
|
||||||
search: {
|
|
||||||
condition: ""
|
|
||||||
},
|
|
||||||
dictList: [],
|
|
||||||
id: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
resetSearch() {
|
|
||||||
this.page.current = 1;
|
|
||||||
this.search.condition = '';
|
|
||||||
this.getDicts();
|
|
||||||
},
|
|
||||||
getDicts() {
|
|
||||||
this.instance.post("/admin/dictionary/queryDictList", null, {
|
|
||||||
params: {
|
|
||||||
...this.page,
|
|
||||||
name: this.search.condition
|
|
||||||
}
|
|
||||||
}).then(res => {
|
|
||||||
this.dictList = res.data.records.map(e => {
|
|
||||||
return {...e, detail: []}
|
|
||||||
})
|
|
||||||
this.page.total = res.data.total
|
|
||||||
})
|
|
||||||
},
|
|
||||||
addDict() {
|
|
||||||
this.$router.push({hash: "#add"})
|
|
||||||
},
|
|
||||||
handleDelete(id) {
|
|
||||||
this.$confirm("确定要删除该数据项吗?", {
|
|
||||||
type: "error"
|
|
||||||
}).then(() => {
|
|
||||||
this.instance.post("/admin/dictionary/deleteDict", null, {
|
|
||||||
params: {id}
|
|
||||||
}).then(res => {
|
|
||||||
if (res?.code == 0) {
|
|
||||||
this.getDicts();
|
|
||||||
this.$message.success("删除成功!")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}).catch(() => 0)
|
|
||||||
},
|
|
||||||
openDetail(id) {
|
|
||||||
this.$router.push({query: {id}, hash: "#add"})
|
|
||||||
},
|
|
||||||
handleSizeChange(val) {
|
|
||||||
this.page.size = val;
|
|
||||||
this.getDicts();
|
|
||||||
},
|
|
||||||
getDictInfo(row) {
|
|
||||||
if (row.detail.length) {
|
|
||||||
row.detail = []
|
|
||||||
} else {
|
|
||||||
this.getDict(row.id).then(res => {
|
|
||||||
if (res && res.data) {
|
|
||||||
row.detail = res.data.dictionaryDetails || []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getDict(dictionaryId) {
|
|
||||||
return this.instance.post("/admin/dictionary/queryDictDetail", null, {
|
|
||||||
params: {dictionaryId}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getDicts()
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
142
packages/core/AppDictionary/dictList.vue
Normal file
142
packages/core/AppDictionary/dictList.vue
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
<script>
|
||||||
|
const columns = [
|
||||||
|
{slot: "expand"},
|
||||||
|
{label: "数据项", prop: "code"},
|
||||||
|
{label: "数据项名称", prop: "name"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "dictList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
page: {
|
||||||
|
current: 1,
|
||||||
|
total: 0,
|
||||||
|
size: 10
|
||||||
|
},
|
||||||
|
search: {
|
||||||
|
condition: ""
|
||||||
|
},
|
||||||
|
dictList: [],
|
||||||
|
id: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
resetSearch() {
|
||||||
|
this.page.current = 1;
|
||||||
|
this.search.condition = '';
|
||||||
|
this.getDicts();
|
||||||
|
},
|
||||||
|
getDicts() {
|
||||||
|
this.instance.post("/admin/dictionary/queryDictList", null, {
|
||||||
|
params: {
|
||||||
|
...this.page,
|
||||||
|
name: this.search.condition
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
this.dictList = res.data.records.map(e => {
|
||||||
|
return {...e, detail: []}
|
||||||
|
})
|
||||||
|
this.page.total = res.data.total
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addDict() {
|
||||||
|
this.$router.push({hash: "#add"})
|
||||||
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
this.$confirm("确定要删除该数据项吗?", {
|
||||||
|
type: "error"
|
||||||
|
}).then(() => {
|
||||||
|
this.instance.post("/admin/dictionary/deleteDict", null, {
|
||||||
|
params: {id}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.getDicts();
|
||||||
|
this.$message.success("删除成功!")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => 0)
|
||||||
|
},
|
||||||
|
openDetail(id) {
|
||||||
|
this.$router.push({query: {id}, hash: "#add"})
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.page.size = val;
|
||||||
|
this.getDicts();
|
||||||
|
},
|
||||||
|
getDictInfo(row) {
|
||||||
|
if (row.detail.length) {
|
||||||
|
row.detail = []
|
||||||
|
} else {
|
||||||
|
this.getDict(row.id).then(res => {
|
||||||
|
if (res && res.data) {
|
||||||
|
row.detail = res.data.dictionaryDetails || []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDict(dictionaryId) {
|
||||||
|
return this.instance.post("/admin/dictionary/queryDictDetail", null, {
|
||||||
|
params: {dictionaryId}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDicts()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<section class="dictList">
|
||||||
|
<ai-list>
|
||||||
|
<ai-title slot="title" title="数据字典" isShowBottomBorder/>
|
||||||
|
<template #content>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" size="small" icon="iconfont iconAdd" @click="addDict"
|
||||||
|
v-if="$permissions('admin_sysdictionary_add')">添加
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<el-input size="small" v-model="search.condition" placeholder="数据项" clearable
|
||||||
|
@change="page.current=1,getDicts()" prefix-icon="iconfont iconSearch"/>
|
||||||
|
<el-button type="primary" size="small" icon="iconfont iconSearch"
|
||||||
|
@click="page.current=1,getDicts()">查询
|
||||||
|
</el-button>
|
||||||
|
<el-button size="small" icon="el-icon-refresh-right" @click="resetSearch">重置</el-button>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="dictList" :colConfigs="columns" :dict="dict" @getList="getDicts"
|
||||||
|
:total="page.total" :current.sync="page.current" :size.sync="page.size" :page-sizes="[10, 20, 50, 100,200]"
|
||||||
|
@expand-change="getDictInfo">
|
||||||
|
<el-table-column slot="expand" type="expand">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="flex" style="gap:4px">
|
||||||
|
<el-tag v-for="(op,i) in row.detail||[]" :key="i">{{ [op.dictValue, op.dictName, op.dictColor].filter(Boolean).join("|") }}</el-tag>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="openDetail(row.id)" v-if="$permissions('admin_sysdictionary_edit')">编辑</el-button>
|
||||||
|
<el-button type="text" @click="handleDelete(row.id)" v-if="$permissions('admin_sysdictionary_del')">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</template>
|
||||||
|
</ai-list>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.dictList {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<div v-if="node.isLeaf" class="opBtn del" v-text="`删除`" @click="handleDelete(data)"/>
|
<div v-if="node.isLeaf" class="opBtn del" v-text="`删除`" @click="handleDelete(data)"/>
|
||||||
<div v-if="permissions('guide_page_config')&&data.component&&data.type==1" class="opBtn" v-text="`引导页`"
|
<div v-if="permissions('guide_page_config')&&data.component&&data.type==1" class="opBtn" v-text="`引导页`"
|
||||||
@click="$router.push({hash:'#intro',query:{id:data.id}})"/>
|
@click="$router.push({hash:'#intro',query:{id:data.id}})"/>
|
||||||
<div v-if="data.type<2" class="opBtn" v-text="`添加下级`" @click="addMenu(data)"/>
|
<div v-if="!data.component" class="opBtn" v-text="`添加下级`" @click="addMenu(data)"/>
|
||||||
<div class="opBtn" v-text="`编辑`" @click="handleEdit(data)"/>
|
<div class="opBtn" v-text="`编辑`" @click="handleEdit(data)"/>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -54,29 +54,16 @@
|
|||||||
<el-form-item label="菜单名称" prop="name">
|
<el-form-item label="菜单名称" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="请输入" clearable/>
|
<el-input v-model="form.name" placeholder="请输入" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="菜单类型" prop="type">
|
<el-form-item label="菜单图标" prop="style">
|
||||||
<ai-select v-model="form.type" clearable :selectList="dict.getDict('menuType')"/>
|
<el-input v-model="form.style" placeholder="请输入" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<template v-if="form.type==0">
|
<el-form-item label="菜单应用" prop="component">
|
||||||
<el-form-item label="菜单图标" prop="style">
|
<el-input v-model="form.component" placeholder="请输入" clearable/>
|
||||||
<el-input v-model="form.style" placeholder="请输入" clearable/>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="路径(path)" prop="path">
|
||||||
</template>
|
<el-input v-model="form.path" placeholder="请输入" clearable/>
|
||||||
<template v-if="form.type==1">
|
</el-form-item>
|
||||||
<el-form-item label="菜单图标" prop="style">
|
<template v-if="form.component">
|
||||||
<el-input v-model="form.style" placeholder="请输入" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="路由名" prop="route">
|
|
||||||
<span v-text="form.route||'提交保存后会自动生成'"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="菜单应用" prop="component">
|
|
||||||
<el-input v-model="form.component" placeholder="请输入" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="路径(path)" prop="path">
|
|
||||||
<el-input v-model="form.path" placeholder="请输入" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
|
||||||
<template v-if="form.type==2">
|
|
||||||
<el-form-item label="权限码" prop="permission">
|
<el-form-item label="权限码" prop="permission">
|
||||||
<el-input v-model="form.permission" placeholder="请输入" clearable/>
|
<el-input v-model="form.permission" placeholder="请输入" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -84,7 +71,7 @@
|
|||||||
<el-form-item label="显示菜单" prop="status">
|
<el-form-item label="显示菜单" prop="status">
|
||||||
<ai-select v-model="form.status" clearable :selectList="dict.getDict('yesOrNo')"/>
|
<ai-select v-model="form.status" clearable :selectList="dict.getDict('yesOrNo')"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="form.type<2" label="排序" prop="showIndex">
|
<el-form-item label="排序" prop="showIndex">
|
||||||
<el-input v-model="form.showIndex" placeholder="请输入" clearable/>
|
<el-input v-model="form.showIndex" placeholder="请输入" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|||||||
64
project/biaopin/AppFormReview/AppFormReview.vue
Normal file
64
project/biaopin/AppFormReview/AppFormReview.vue
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<template>
|
||||||
|
<div class="AppFormReview">
|
||||||
|
<keep-alive :include="['List']">
|
||||||
|
<component ref="component" :is="component" :permissions="permissions " @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
|
||||||
|
</keep-alive>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import List from './components/List'
|
||||||
|
import Detail from './components/Detail'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AppFormReview',
|
||||||
|
label: '网格动态',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
component: 'List',
|
||||||
|
params: {},
|
||||||
|
include: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
List,
|
||||||
|
Detail
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
onChange (data) {
|
||||||
|
if (data.type === 'Detail') {
|
||||||
|
this.component = 'Detail'
|
||||||
|
this.params = data.params
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.type === 'List') {
|
||||||
|
this.component = 'List'
|
||||||
|
this.params = data.params
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (data.isRefresh) {
|
||||||
|
this.$refs.component.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.AppFormReview {
|
||||||
|
height: 100%;
|
||||||
|
background: #F3F6F9;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
154
project/biaopin/AppFormReview/components/Detail.vue
Normal file
154
project/biaopin/AppFormReview/components/Detail.vue
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
<template>
|
||||||
|
<ai-detail class="AppDynamicDetail">
|
||||||
|
<template slot="title">
|
||||||
|
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||||
|
<template #rightBtn>
|
||||||
|
<div class="title-btns">
|
||||||
|
<el-button type="primary" icon="iconfont iconRegister" @click="isShowExamine = true" v-if="info.status == 0">审核</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</ai-title>
|
||||||
|
</template>
|
||||||
|
<template slot="content">
|
||||||
|
<ai-card title="基本信息">
|
||||||
|
<template #content>
|
||||||
|
<ai-wrapper label-width="120px">
|
||||||
|
<ai-info-item label="内容" isLine :value="info.content"></ai-info-item>
|
||||||
|
<ai-info-item label="所属网格" isLine :value="info.girdName"></ai-info-item>
|
||||||
|
<ai-info-item label="类型" >{{dict.getLabel("wyGirdNewsType", info.type)}}</ai-info-item>
|
||||||
|
<ai-info-item label="地址" >{{info.address}}</ai-info-item>
|
||||||
|
<ai-info-item label="网格员姓名" :value="info.name"></ai-info-item>
|
||||||
|
<ai-info-item label="状态" >{{dict.getLabel("auditStatus", info.status)}}</ai-info-item>
|
||||||
|
<ai-info-item label="发布时间" :value="info.createTime"></ai-info-item>
|
||||||
|
<ai-info-item label="图片" isLine>
|
||||||
|
<div class="files">
|
||||||
|
<div class="file-item" v-for="(item, index) in info.files" :key="index">
|
||||||
|
<img :src="item.url" v-viewer="{movable: true}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ai-info-item>
|
||||||
|
</ai-wrapper>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="审核信息" v-if="info.status != 0">
|
||||||
|
<template #content>
|
||||||
|
<ai-wrapper label-width="120px">
|
||||||
|
<ai-info-item label="审批意见" isLine :value="info.examineOpinion"></ai-info-item>
|
||||||
|
<ai-info-item label="审批人" :value="info.examineUserName"></ai-info-item>
|
||||||
|
<ai-info-item label="审批时间" :value="info.examineTime"></ai-info-item>
|
||||||
|
</ai-wrapper>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
<ai-dialog
|
||||||
|
:visible.sync="isShowExamine"
|
||||||
|
width="800px"
|
||||||
|
title="审核"
|
||||||
|
@closed="isShowExamine=false"
|
||||||
|
@onConfirm="handleEvent">
|
||||||
|
<el-form class="ai-form" label-width="120px" :model="form" ref="form">
|
||||||
|
<el-form-item label="是否通过" prop="status" style="width: 100%;" :rules="[{ required: true, message: '请选择是否通过' }]">
|
||||||
|
<el-radio-group v-model="form.status">
|
||||||
|
<el-radio label="1">是</el-radio>
|
||||||
|
<el-radio label="0">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审批意见" prop="opinion" style="width: 100%;" >
|
||||||
|
<el-input type="textarea" :rows="5" :maxlength="500" v-model="form.opinion" clearable placeholder="请输入审批意见" show-word-limit></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="图片" prop="files" style="width: 100%;">
|
||||||
|
<ai-uploader
|
||||||
|
:instance="instance"
|
||||||
|
isShowTip
|
||||||
|
v-model="form.files"
|
||||||
|
:limit="9">
|
||||||
|
</ai-uploader>
|
||||||
|
</el-form-item> -->
|
||||||
|
</el-form>
|
||||||
|
</ai-dialog>
|
||||||
|
</template>
|
||||||
|
</ai-detail>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'Detail',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
params: Object,
|
||||||
|
moduleId: String
|
||||||
|
},
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
info: {},
|
||||||
|
id: '',
|
||||||
|
isShowExamine: false,
|
||||||
|
form: {status: '', opinion: ''}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created () {
|
||||||
|
this.dict.load('wyGirdNewsType', 'auditStatus').then(() => {
|
||||||
|
this.getDetail()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getDetail () {
|
||||||
|
this.instance.post(`/app/appgirdnews/queryDetailById?id=${this.params.id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.info = res.data
|
||||||
|
this
|
||||||
|
this.info = {
|
||||||
|
...res.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
handleEvent() {
|
||||||
|
this.$refs.form.validate(v => {
|
||||||
|
if (v) {
|
||||||
|
this.instance.post(`/app/appgirdnews/examine?id=${this.params.id}&pass=${this.form.status}&opinion=${this.form.opinion}`).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.isShowExamine = false
|
||||||
|
this.$message.success('审核成功!')
|
||||||
|
this.cancel(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel (isRefresh) {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'List',
|
||||||
|
isRefresh: !!isRefresh
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppDynamicDetail {
|
||||||
|
.files {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
.file-item {
|
||||||
|
width: 150px;
|
||||||
|
height: 150px;
|
||||||
|
margin: 0 20px 20px 0;
|
||||||
|
|
||||||
|
img, video {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
194
project/biaopin/AppFormReview/components/List.vue
Normal file
194
project/biaopin/AppFormReview/components/List.vue
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
<template>
|
||||||
|
<ai-list class="notice">
|
||||||
|
<ai-title slot="title" title="网格动态" isShowBottomBorder></ai-title>
|
||||||
|
<template slot="content">
|
||||||
|
<ai-search-bar class="search-bar">
|
||||||
|
<template #left>
|
||||||
|
<ai-select
|
||||||
|
v-model="search.type"
|
||||||
|
@change="(search.current = 1), getList()"
|
||||||
|
placeholder="请选择类型"
|
||||||
|
:selectList="dict.getDict('wyGirdNewsType')">
|
||||||
|
</ai-select>
|
||||||
|
<ai-picker
|
||||||
|
:instance="instance"
|
||||||
|
:multiple="false"
|
||||||
|
dialogTitle="选择网格"
|
||||||
|
:ops="{ label: 'girdName' }"
|
||||||
|
pageTitle="网格"
|
||||||
|
action="/app/appgirdinfo/girdList"
|
||||||
|
@pick="onGridChange">
|
||||||
|
<div class="userSelcet">
|
||||||
|
<span style="color: #606266;" v-if="search.girdId">{{ search.girdName }}</span>
|
||||||
|
<span v-else>请选择网格</span>
|
||||||
|
<i class="el-icon-arrow-up" v-if="!search.girdId"></i>
|
||||||
|
<i class="el-icon-circle-close" v-if="search.girdId" @click.stop="search.girdId = '', search.girdName = '', search.current = 1, getList()"></i>
|
||||||
|
</div>
|
||||||
|
</ai-picker>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<el-input
|
||||||
|
v-model="search.content"
|
||||||
|
class="search-input"
|
||||||
|
size="small"
|
||||||
|
v-throttle="() => {search.current = 1, getList()}"
|
||||||
|
placeholder="内容"
|
||||||
|
clearable
|
||||||
|
@clear="search.current = 1, search.content = '', getList()"
|
||||||
|
suffix-icon="iconfont iconSearch">
|
||||||
|
</el-input>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table
|
||||||
|
:tableData="tableData"
|
||||||
|
:col-configs="colConfigs"
|
||||||
|
:total="total"
|
||||||
|
style="margin-top: 6px;"
|
||||||
|
:current.sync="search.current"
|
||||||
|
:size.sync="search.size"
|
||||||
|
@getList="getList">
|
||||||
|
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</template>
|
||||||
|
</ai-list>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
export default {
|
||||||
|
name: 'List',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
search: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
content: '',
|
||||||
|
areaId: '',
|
||||||
|
girdId: '',
|
||||||
|
girdName: ''
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
colConfigs: [
|
||||||
|
{ prop: 'content', label: '内容', align: 'left', width: '200px' },
|
||||||
|
{ prop: 'girdName', label: '所属网格', align: 'center' },
|
||||||
|
{ prop: 'type', align: 'center', label: '类型', dict:"wyGirdNewsType"},
|
||||||
|
{ prop: 'address', label: '地址', align: 'center' },
|
||||||
|
{ prop: 'name', label: '网格员姓名', align: 'center' },
|
||||||
|
{ prop: 'status', align: 'center', label: '状态', dict:"auditStatus"},
|
||||||
|
{ prop: 'createTime', label: '发布时间', align: 'center' }
|
||||||
|
],
|
||||||
|
tableData: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
|
||||||
|
hideLevel () {
|
||||||
|
return this.user.info.areaList.length || 0
|
||||||
|
},
|
||||||
|
|
||||||
|
params () {
|
||||||
|
return {
|
||||||
|
...this.search
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.dict.load('wyGirdNewsType', 'auditStatus').then(() => {
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getList () {
|
||||||
|
this.instance.post(`/app/appgirdnews/list`, null, {
|
||||||
|
params: {
|
||||||
|
...this.search
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.tableData = res.data.records
|
||||||
|
this.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onGridChange (e) {
|
||||||
|
if (e.length) {
|
||||||
|
this.search.girdId = e[0].id
|
||||||
|
this.search.girdName = e[0].girdName
|
||||||
|
this.search.current = 1
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
toDetail(id) {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'Detail',
|
||||||
|
params: {
|
||||||
|
id: id || ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.userSelcet {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 215px;
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid #d0d4dc;
|
||||||
|
overflow: hidden;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: $placeholderColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 30px;
|
||||||
|
height: 100%;
|
||||||
|
line-height: 32px;
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: center;
|
||||||
|
color: #d0d4dc;
|
||||||
|
transform: rotateZ(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon-circle-close:hover {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
flex: 1;
|
||||||
|
padding: 0 15px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: $placeholderColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -17,8 +17,9 @@
|
|||||||
<el-table-column slot="scoringCycle" label="周期范围" align="center">
|
<el-table-column slot="scoringCycle" label="周期范围" align="center">
|
||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
<span v-if="row.parentRuleName == '工单处理'">-</span>
|
<span v-if="row.parentRuleName == '工单处理'">-</span>
|
||||||
<span v-else>{{row.numberLimit.length ? $dict.getLabel("integralRuleScoringCycle", row.scoringCycle)
|
<span v-if="row.parentRuleName != '工单处理' && row.numberLimit">{{row.numberLimit.length ? $dict.getLabel("integralRuleScoringCycle", row.scoringCycle)
|
||||||
: $dict.getLabel("integralRuleScoringCycle", row.scoringCycle) + row.numberLimit + "次"}}</span>
|
: $dict.getLabel("integralRuleScoringCycle", row.scoringCycle) + row.numberLimit + "次"}}</span>
|
||||||
|
<span v-if="row.parentRuleName != '工单处理' && !row.numberLimit">{{$dict.getLabel("integralRuleScoringCycle", row.scoringCycle) + "不限次"}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column slot="integral" label="分值" align="center">
|
<el-table-column slot="integral" label="分值" align="center">
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
<el-input v-model="form.title" placeholder="请输入" show-word-limit maxlength="64"></el-input>
|
<el-input v-model="form.title" placeholder="请输入" show-word-limit maxlength="64"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="名额" prop="quota" style="width: 100%">
|
||||||
|
<el-input-number v-model="form.quota" :min="1" :max="1000" label="请输入"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="活动说明" style="width: 100%">
|
<el-form-item label="活动说明" style="width: 100%">
|
||||||
<el-input type="textarea" :rows="5" v-model="form.detail" placeholder="请输入" show-word-limit maxlength="500"></el-input>
|
<el-input type="textarea" :rows="5" v-model="form.detail" placeholder="请输入" show-word-limit maxlength="500"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -124,6 +128,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
title: '',
|
title: '',
|
||||||
|
quota: 1,
|
||||||
detail: '',
|
detail: '',
|
||||||
lng: '',
|
lng: '',
|
||||||
lat: '',
|
lat: '',
|
||||||
@@ -144,6 +149,7 @@ export default {
|
|||||||
},
|
},
|
||||||
formRules: {
|
formRules: {
|
||||||
title: [{required: true, message: "请输入活动名称", trigger: "blur"}],
|
title: [{required: true, message: "请输入活动名称", trigger: "blur"}],
|
||||||
|
quota: [{required: true, message: "请输入名额", trigger: "blur"}],
|
||||||
location: [{required: true, validator: validLocation, trigger: "blur"}],
|
location: [{required: true, validator: validLocation, trigger: "blur"}],
|
||||||
clockRange: [{required: true, message: "请输入打卡范围", trigger: "blur"}],
|
clockRange: [{required: true, message: "请输入打卡范围", trigger: "blur"}],
|
||||||
intoTime: [{required: true, message: "请选择进场打卡时间", trigger: "blur"}],
|
intoTime: [{required: true, message: "请选择进场打卡时间", trigger: "blur"}],
|
||||||
@@ -185,17 +191,17 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
'form.intoTime': {
|
'form.intoTime': {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if(val) {
|
if (Array.isArray(val) && val.length >= 2) {
|
||||||
this.form.intoBegintime = val[0]
|
this.form.intoBegintime = val[0];
|
||||||
this.form.intoEndtime = val[1]
|
this.form.intoEndtime = val[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'form.exitTime': {
|
'form.exitTime': {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if(val) {
|
if (Array.isArray(val) && val.length >= 2) {
|
||||||
this.form.exitBegintime = val[0]
|
this.form.exitBegintime = val[0];
|
||||||
this.form.exitEndtime = val[1]
|
this.form.exitEndtime = val[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<template #content>
|
<template #content>
|
||||||
<ai-wrapper>
|
<ai-wrapper>
|
||||||
<ai-info-item label="活动名称" :value="info.title"></ai-info-item>
|
<ai-info-item label="活动名称" :value="info.title"></ai-info-item>
|
||||||
|
<ai-info-item label="名额" :value="info.quota"></ai-info-item>
|
||||||
<ai-info-item label="创建人" :value="info.createUserName"></ai-info-item>
|
<ai-info-item label="创建人" :value="info.createUserName"></ai-info-item>
|
||||||
<ai-info-item label="活动说明" isLine :value="info.detail"></ai-info-item>
|
<ai-info-item label="活动说明" isLine :value="info.detail"></ai-info-item>
|
||||||
<ai-info-item label="活动图片" isLine>
|
<ai-info-item label="活动图片" isLine>
|
||||||
|
|||||||
@@ -7,29 +7,26 @@
|
|||||||
<el-tab-pane label="方案设置">
|
<el-tab-pane label="方案设置">
|
||||||
<el-form ref="AddForm" :model="form" size="small" label-width="120px" :rules="rules">
|
<el-form ref="AddForm" :model="form" size="small" label-width="120px" :rules="rules">
|
||||||
<ai-card title="基本信息">
|
<ai-card title="基本信息">
|
||||||
<template #content>
|
<div class="grid">
|
||||||
<el-form-item label="项目/系统名称" prop="name">
|
<el-form-item label="项目/系统名称" prop="name" class="row">
|
||||||
<el-input v-model="form.name" placeholder="请输入" clearable/>
|
<ai-input v-model="form.name"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-row type="flex">
|
<el-form-item label="系统类型" prop="type">
|
||||||
<div class="fill">
|
<ai-select v-model="form.type" dict="systemType" @change="form.apps = []"/>
|
||||||
<el-form-item label="系统类型" prop="type">
|
</el-form-item>
|
||||||
<ai-select v-model="form.type" :selectList="dict.getDict('systemType')" @change="form.apps = [],handleSysTypeChange(form.type)"/>
|
<el-form-item label="库项目根路径" prop="customPath">
|
||||||
</el-form-item>
|
<ai-input v-model="form.customPath"/>
|
||||||
<el-form-item label="更新项目路径" prop="dist">
|
</el-form-item>
|
||||||
<el-input v-model="form.dist" placeholder="常填写nginx路径,下载包从这里取" clearable/>
|
<el-form-item label="更新项目路径" prop="dist">
|
||||||
</el-form-item>
|
<ai-input v-model="form.dist" placeholder="常填写nginx路径,下载包从这里取"/>
|
||||||
</div>
|
</el-form-item>
|
||||||
<div class="fill mar-l16">
|
<el-form-item label="版本号" prop="version">
|
||||||
<el-form-item label="库项目根路径" prop="customPath">
|
<ai-input v-model="form.version"/>
|
||||||
<el-input v-model="form.customPath" placeholder="请输入" clearable/>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="微信机器人" prop="webhook">
|
||||||
<el-form-item label="版本号" prop="version">
|
<ai-input v-model="form.webhook"/>
|
||||||
<el-input v-model="form.version" placeholder="请输入" clearable/>
|
</el-form-item>
|
||||||
</el-form-item>
|
</div>
|
||||||
</div>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
</ai-card>
|
</ai-card>
|
||||||
<ai-card title="主库应用">
|
<ai-card title="主库应用">
|
||||||
<template #content>
|
<template #content>
|
||||||
@@ -38,179 +35,15 @@
|
|||||||
<ai-empty v-else>请先选择系统类型</ai-empty>
|
<ai-empty v-else>请先选择系统类型</ai-empty>
|
||||||
</template>
|
</template>
|
||||||
</ai-card>
|
</ai-card>
|
||||||
<ai-card title="扩展设置">
|
<component class="extraConfig" title="扩展设置" :is="extraConfig" v-model="form.extra" :appList="appList"/>
|
||||||
<template #right>
|
|
||||||
<template v-if="form.type=='web'">
|
|
||||||
<ai-dialog-btn text="设置系统信息" dialogTitle="系统信息">
|
|
||||||
<el-form size="small" label-width="140px">
|
|
||||||
<el-form-item label="系统标题">
|
|
||||||
<el-input v-model="form.sysInfo.fullTitle" placeholder="请输入..." clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="favicon">
|
|
||||||
<el-input v-model="form.sysInfo.favicon" placeholder="请输入..." clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="logo">
|
|
||||||
<el-row type="flex">
|
|
||||||
<el-input v-model="form.sysInfo.logo" placeholder="请输入..." clearable/>
|
|
||||||
<el-input class="mar-l10" v-model="form.sysInfo.logoText" placeholder="logo文字">
|
|
||||||
<template #prepend>logo文字</template>
|
|
||||||
</el-input>
|
|
||||||
</el-row>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="登录页">
|
|
||||||
<el-row type="flex" class="mar-b10">
|
|
||||||
<el-input v-model="form.sysInfo.loginLogo" placeholder="登录页左上角logo,带/代表图片" clearable>
|
|
||||||
<template #prepend>左页首logo</template>
|
|
||||||
</el-input>
|
|
||||||
<el-input class="mar-l10" v-model="form.sysInfo.loginLogoText" placeholder="logo文字" clearable>
|
|
||||||
<template #prepend>logo文字</template>
|
|
||||||
</el-input>
|
|
||||||
</el-row>
|
|
||||||
<el-row type="flex">
|
|
||||||
<el-input v-model="form.sysInfo.name" placeholder="左上角标题" clearable>
|
|
||||||
<template #prepend>左上角标题</template>
|
|
||||||
</el-input>
|
|
||||||
<el-input class="mar-l10" v-model="form.sysInfo.title" placeholder="左上角副标题" clearable>
|
|
||||||
<template #prepend>左上角副标题</template>
|
|
||||||
</el-input>
|
|
||||||
</el-row>
|
|
||||||
<el-input class="mar-t10" type="textarea" rows="5" v-model="form.sysInfo.desc" placeholder="副标题" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-row type="flex">
|
|
||||||
<div class="fill">
|
|
||||||
<el-form-item label="版权所有">
|
|
||||||
<el-input v-model="form.sysInfo.recordDesc" placeholder="请输入..." clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备案号">
|
|
||||||
<el-input v-model="form.sysInfo.recordNo" placeholder="请输入..." clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
<div class="fill">
|
|
||||||
<el-form-item label="框架版本">
|
|
||||||
<!--edition :版本,标准版:standard、上架版:saas 简易版(不带扫码):simple -->
|
|
||||||
<el-input v-model="form.sysInfo.edition" placeholder="请输入..." clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备案跳转链接">
|
|
||||||
<el-input v-model="form.sysInfo.recordURL" placeholder="请输入..." clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
</el-row>
|
|
||||||
<el-form-item label="可信证书">
|
|
||||||
<el-input type="textarea" v-model="form.sysInfo.ssl" placeholder="请输入可信证书的html代码" clearable rows="5"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</ai-dialog-btn>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
<template #content>
|
|
||||||
<template v-if="form.type=='mp'">
|
|
||||||
<el-form-item label="小程序AppId">
|
|
||||||
<el-input v-model="form.appId" clearable placeholder="小程序appId"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="半屏小程序">
|
|
||||||
<el-input v-model="form.embeddedAppIdList" clearable placeholder="如果有多个,请用英文','分割"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="接口是否单服务">
|
|
||||||
<el-checkbox v-model="form.isSingleService"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="引导页">
|
|
||||||
<el-input v-model="form.guide" placeholder="带'/'会被认为是输入的页面路径" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<ai-title title="底部导航栏">
|
|
||||||
<el-button type="text" slot="rightBtn" icon="iconfont iconAdd" @click="tabBar.list.push({})">添加</el-button>
|
|
||||||
</ai-title>
|
|
||||||
<ai-table :tableData="tabBar.list" :colConfigs="colConfigs" tableSize="mini" :isShowPagination="false" border ref="TabBar">
|
|
||||||
<el-table-column slot="options" label="操作" width="260" align="center">
|
|
||||||
<template slot-scope="{row,$index}">
|
|
||||||
<el-row type="flex" class="tabBarOptions">
|
|
||||||
<ai-dialog-btn text="更换" dialogTitle="选择应用">
|
|
||||||
<ai-lib-table :meta="appList" v-model="row.id" @select="v=>handleTabbarChange(row,v)" :isShowPagination="false" v-bind="$props"
|
|
||||||
:border="false"/>
|
|
||||||
</ai-dialog-btn>
|
|
||||||
<ai-dialog-btn text="编辑" dialogTitle="编辑导航栏" width="600px">
|
|
||||||
<el-form-item label="名称">
|
|
||||||
<el-input v-model="row.text" placeholder="请输入" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="默认图标">
|
|
||||||
<el-input v-model="row.iconPath" placeholder="请输入" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="选中图标">
|
|
||||||
<el-input v-model="row.selectedIconPath" placeholder="请输入" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
</ai-dialog-btn>
|
|
||||||
<el-button type="text" @click="handleTabbarDelete($index)">删除</el-button>
|
|
||||||
<el-button type="text" @click="handleTabbarPosition($index,-1)" v-if="$index>0">上移</el-button>
|
|
||||||
<el-button type="text" @click="handleTabbarPosition($index,1)" v-if="$index<tabBar.list.length-1">下移</el-button>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</ai-table>
|
|
||||||
</template>
|
|
||||||
<template v-else-if="form.type=='wxwork'">
|
|
||||||
<el-row type="flex">
|
|
||||||
<div class="fill">
|
|
||||||
<el-form-item label="接口是否单服务">
|
|
||||||
<el-checkbox v-model="form.isSingleService"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否启用水印">
|
|
||||||
<el-checkbox v-model="form.waterMarker"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="自定义登录">
|
|
||||||
<el-checkbox v-model="form.customLogin"/>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
<div class="fill">
|
|
||||||
<el-form-item label="域名根目录(baseURL)">
|
|
||||||
<el-input v-model="form.base" clearable placeholder="域名根目录"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="默认首页">
|
|
||||||
<el-input v-model="form.homePage" clearable placeholder="填写应用的文件名"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="开启百度流量">
|
|
||||||
<el-checkbox v-model="form.hmt"/>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
<template v-else-if="form.type=='web'">
|
|
||||||
<el-form-item label="头部导航工具栏">
|
|
||||||
<el-checkbox v-model="form.downloadCenter">下载中心</el-checkbox>
|
|
||||||
<el-checkbox v-model="form.dv">数据大屏</el-checkbox>
|
|
||||||
<el-checkbox v-model="form.showTool">显示/隐藏导航栏</el-checkbox>
|
|
||||||
<el-checkbox v-model="form.helpDoc">帮助文档</el-checkbox>
|
|
||||||
<el-checkbox v-model="form.customerService">智能客服</el-checkbox>
|
|
||||||
<el-checkbox v-model="form.appQRCode">手机APP</el-checkbox>
|
|
||||||
</el-form-item>
|
|
||||||
<el-row type="flex">
|
|
||||||
<div class="fill">
|
|
||||||
<el-form-item label="接口是否单服务">
|
|
||||||
<el-checkbox v-model="form.isSingleService"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="默认首页">
|
|
||||||
<el-input v-model="form.homePage" clearable placeholder="填写应用的文件名"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否加载AI助手">
|
|
||||||
<el-checkbox v-model="form.copilot"/>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
<div class="fill">
|
|
||||||
<el-form-item label="域名根目录">
|
|
||||||
<el-input v-model="form.base" clearable placeholder="填写域名根目录(baseURL)"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="开启百度流量">
|
|
||||||
<el-checkbox v-model="form.hmt"/>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</ai-card>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="方案应用" lazy>
|
<el-tab-pane label="方案应用" lazy>
|
||||||
<ai-lib-table :meta="appList" customData :isShowPagination="false" v-bind="$props" disabled :colConfigs="appListConfigs">
|
<ai-lib-table :meta="appList" customData :isShowPagination="false" v-bind="$props" disabled
|
||||||
|
:colConfigs="appListConfigs">
|
||||||
<template slot="options" slot-scope="{row}">
|
<template slot="options" slot-scope="{row}">
|
||||||
<ai-dialog-btn text="编辑" :customFooter="false" dialogTitle="应用配置" width="500px" @onConfirm="handleAppEdit(row)">
|
<ai-dialog-btn text="编辑" :customFooter="false" dialogTitle="应用配置" width="500px"
|
||||||
|
@onConfirm="handleAppEdit(row)">
|
||||||
<el-form size="small" label-width="80px">
|
<el-form size="small" label-width="80px">
|
||||||
<el-form-item label="应用名称">
|
<el-form-item label="应用名称">
|
||||||
<el-input v-model="row.label" clearable placeholder="请输入应用名称"/>
|
<el-input v-model="row.label" clearable placeholder="请输入应用名称"/>
|
||||||
@@ -233,6 +66,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapActions} from "vuex"
|
import {mapActions} from "vuex"
|
||||||
import AiLibTable from "./AiLibTable";
|
import AiLibTable from "./AiLibTable";
|
||||||
|
import webConfig from "./config/webConfig.vue";
|
||||||
|
import wxcpConfig from "./config/wxcpConfig.vue";
|
||||||
|
import wxmpConfig from "./config/wxmpConfig.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "add",
|
name: "add",
|
||||||
@@ -256,41 +92,26 @@ export default {
|
|||||||
return e
|
return e
|
||||||
}).filter(e => e.project != "core") || []
|
}).filter(e => e.project != "core") || []
|
||||||
},
|
},
|
||||||
|
extraConfig: v => ({
|
||||||
|
web: webConfig,
|
||||||
|
wxwork: wxcpConfig,
|
||||||
|
mp: wxmpConfig
|
||||||
|
}[v.form.type])
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {apps: [], type: null, sysInfo: {}, customPath: ""},
|
form: {apps: [], type: null, customPath: "", extra: {sysInfo: {}}},
|
||||||
rules: {
|
rules: {
|
||||||
name: {required: true, message: "请输入"},
|
name: {required: true, message: "请输入"},
|
||||||
type: {required: true, message: "请选择"},
|
type: {required: true, message: "请选择"},
|
||||||
// customPath: {required: true, message: "请输入"},
|
// customPath: {required: true, message: "请输入"},
|
||||||
},
|
},
|
||||||
colConfigs: [
|
|
||||||
{prop: 'text', label: "名称", width: 120},
|
|
||||||
{prop: 'pagePath', label: "应用路径"},
|
|
||||||
{prop: 'iconPath', label: "默认图标"},
|
|
||||||
{prop: 'selectedIconPath', label: "选中图标"},
|
|
||||||
],
|
|
||||||
appListConfigs: [
|
appListConfigs: [
|
||||||
{prop: 'label', label: "应用名称", render: (h, {row}) => h(row.tabbar ? 'b' : 'p', row.label + ` ${row.tabbar ? '(底部导航栏)' : ''}`)},
|
{prop: 'label', label: "应用名称", render: (h, {row}) => h(row.tabbar ? 'b' : 'p', row.label + ` ${row.tabbar ? '(底部导航栏)' : ''}`)},
|
||||||
{prop: 'project', label: "项目/框架"},
|
{prop: 'project', label: "项目/框架"},
|
||||||
{prop: 'category', label: "分类", dict: "appsCategory"},
|
{prop: 'category', label: "分类", dict: "appsCategory"},
|
||||||
{prop: 'name', label: "模块名"}
|
{prop: 'name', label: "模块名"}
|
||||||
],
|
],
|
||||||
tabBar: {
|
|
||||||
color: "#666666",
|
|
||||||
selectedColor: "#197DF0",
|
|
||||||
backgroundColor: "#ffffff",
|
|
||||||
list: [
|
|
||||||
{pagePath: "pages/AppHome/AppHome", text: "首页", iconPath: "static/TabBar/home.png", selectedIconPath: "static/TabBar/home_selected.png"},
|
|
||||||
{pagePath: "pages/AppModules/AppModules", text: "应用", iconPath: "static/TabBar/service.png", selectedIconPath: "static/TabBar/service_selected.png"},
|
|
||||||
{
|
|
||||||
pagePath: "pages/AppEnteringVillage/AppEnteringVillage", text: "进村",
|
|
||||||
iconPath: "static/TabBar/custom.png", selectedIconPath: "static/TabBar/custom_selected.png"
|
|
||||||
},
|
|
||||||
{pagePath: "pages/AppMine/AppMine", text: "我的", iconPath: "static/TabBar/me.png", selectedIconPath: "static/TabBar/me_selected.png"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -302,7 +123,6 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
this.form = {...this.form, ...res.data}
|
this.form = {...this.form, ...res.data}
|
||||||
this.handleSysTypeChange(this.form.type, this.form.extra)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -313,37 +133,9 @@ export default {
|
|||||||
submit() {
|
submit() {
|
||||||
this.$refs.AddForm.validate(v => {
|
this.$refs.AddForm.validate(v => {
|
||||||
if (v) {
|
if (v) {
|
||||||
const {
|
if (this.form.type == 'web') {
|
||||||
tabBar,
|
this.form.extra.sysInfo.desc = JSON.parse(this.form.extra.sysInfo.desc || null)
|
||||||
form: {
|
this.form.extra.sysInfo.ssl = this.form.extra.sysInfo.ssl?.replace(/"/g, "'")
|
||||||
type,
|
|
||||||
appId,
|
|
||||||
embeddedAppIdList,
|
|
||||||
isSingleService,
|
|
||||||
homePage,
|
|
||||||
hmt,
|
|
||||||
dv,
|
|
||||||
downloadCenter,
|
|
||||||
showTool,
|
|
||||||
helpDoc,
|
|
||||||
customerService,
|
|
||||||
sysInfo,
|
|
||||||
appQRCode,
|
|
||||||
customLogin,
|
|
||||||
base,
|
|
||||||
guide,
|
|
||||||
copilot
|
|
||||||
}
|
|
||||||
} = this
|
|
||||||
if (type == 'mp') {
|
|
||||||
this.form.extra = {tabBar, appId, embeddedAppIdList, isSingleService, guide}
|
|
||||||
} else if (type == 'web') {
|
|
||||||
const {desc} = sysInfo
|
|
||||||
sysInfo.desc = JSON.parse(desc || null)
|
|
||||||
sysInfo.ssl = sysInfo.ssl?.replace(/"/g, "'")
|
|
||||||
this.form.extra = {isSingleService, homePage, hmt, dv, downloadCenter, showTool, helpDoc, customerService, sysInfo, appQRCode, base, copilot}
|
|
||||||
} else if (type == 'wxwork') {
|
|
||||||
this.form.extra = {isSingleService, homePage, hmt, customLogin, base}
|
|
||||||
}
|
}
|
||||||
this.instance.post("/node/custom/addOrUpdate", this.form).then(res => {
|
this.instance.post("/node/custom/addOrUpdate", this.form).then(res => {
|
||||||
if (res?.code == 0) {
|
if (res?.code == 0) {
|
||||||
@@ -354,34 +146,11 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleSysTypeChange(v, data = {}) {
|
|
||||||
let values = this.$copy(data)
|
|
||||||
if (v == 'mp') {
|
|
||||||
if (values?.tabBar) {
|
|
||||||
this.tabBar = values.tabBar || this.tabBar
|
|
||||||
delete values.tabBar
|
|
||||||
}
|
|
||||||
} else if (v == 'web') {
|
|
||||||
if (values?.sysInfo?.desc) values.sysInfo.desc = JSON.stringify(values.sysInfo.desc)
|
|
||||||
}
|
|
||||||
Object.keys(values).map(e => this.$set(this.form, e, values[e]))
|
|
||||||
},
|
|
||||||
handleTabbarChange(row, {name, label}) {
|
|
||||||
row.text = label
|
|
||||||
row.pagePath = `pages/${name}/${name}`
|
|
||||||
},
|
|
||||||
handleTabbarDelete(i) {
|
|
||||||
this.tabBar.list?.splice(i, 1)
|
|
||||||
},
|
|
||||||
handleAppEdit(row) {
|
handleAppEdit(row) {
|
||||||
const i = this.form.appList.findIndex(e => e.id == row.id)
|
const i = this.form.appList.findIndex(e => e.id == row.id)
|
||||||
this.form.appList.splice(i, 1, row)
|
this.form.appList.splice(i, 1, row)
|
||||||
},
|
},
|
||||||
handleTabbarPosition(i, offset) {
|
|
||||||
const row = this.tabBar.list[i]
|
|
||||||
this.tabBar.list.splice(i, 1, this.tabBar.list[i + offset])
|
|
||||||
this.tabBar.list.splice(i + offset, 1, row)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
@@ -404,5 +173,16 @@ export default {
|
|||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.extraConfig) {
|
||||||
|
.ai-card__body {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
|
||||||
|
.row {
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
116
project/oms/apps/develop/AppDeployCustom/config/webConfig.vue
Normal file
116
project/oms/apps/develop/AppDeployCustom/config/webConfig.vue
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "webConfig",
|
||||||
|
model: {
|
||||||
|
prop: "form",
|
||||||
|
event: "input"
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
form: { default: () => ({ sysInfo: {} }) },
|
||||||
|
title: String
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
form: {
|
||||||
|
handler(v) {
|
||||||
|
this.$emit("input", v)
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-card :title="title" class="webConfig">
|
||||||
|
<template #right>
|
||||||
|
<ai-dialog-btn text="设置系统信息" dialogTitle="系统信息">
|
||||||
|
<el-form size="small" label-width="140px">
|
||||||
|
<el-form-item label="系统标题">
|
||||||
|
<el-input v-model="form.sysInfo.fullTitle" placeholder="请输入..." clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="favicon">
|
||||||
|
<el-input v-model="form.sysInfo.favicon" placeholder="请输入..." clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="logo">
|
||||||
|
<el-row type="flex">
|
||||||
|
<el-input v-model="form.sysInfo.logo" placeholder="请输入..." clearable />
|
||||||
|
<el-input class="mar-l10" v-model="form.sysInfo.logoText" placeholder="logo文字">
|
||||||
|
<template #prepend>logo文字</template>
|
||||||
|
</el-input>
|
||||||
|
</el-row>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="登录页">
|
||||||
|
<el-row type="flex" class="mar-b10">
|
||||||
|
<el-input v-model="form.sysInfo.loginLogo" placeholder="登录页左上角logo,带/代表图片" clearable>
|
||||||
|
<template #prepend>左页首logo</template>
|
||||||
|
</el-input>
|
||||||
|
<el-input class="mar-l10" v-model="form.sysInfo.loginLogoText" placeholder="logo文字" clearable>
|
||||||
|
<template #prepend>logo文字</template>
|
||||||
|
</el-input>
|
||||||
|
</el-row>
|
||||||
|
<el-row type="flex">
|
||||||
|
<el-input v-model="form.sysInfo.name" placeholder="左上角标题" clearable>
|
||||||
|
<template #prepend>左上角标题</template>
|
||||||
|
</el-input>
|
||||||
|
<el-input class="mar-l10" v-model="form.sysInfo.title" placeholder="左上角副标题" clearable>
|
||||||
|
<template #prepend>左上角副标题</template>
|
||||||
|
</el-input>
|
||||||
|
</el-row>
|
||||||
|
<el-input class="mar-t10" type="textarea" rows="5" v-model="form.sysInfo.desc" placeholder="副标题"
|
||||||
|
clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-row type="flex">
|
||||||
|
<div class="fill">
|
||||||
|
<el-form-item label="版权所有">
|
||||||
|
<el-input v-model="form.sysInfo.recordDesc" placeholder="请输入..." clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备案号">
|
||||||
|
<el-input v-model="form.sysInfo.recordNo" placeholder="请输入..." clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
<div class="fill">
|
||||||
|
<el-form-item label="框架版本">
|
||||||
|
<!--edition :版本,标准版:standard、上架版:saas 简易版(不带扫码):simple -->
|
||||||
|
<el-input v-model="form.sysInfo.edition" placeholder="请输入..." clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备案跳转链接">
|
||||||
|
<el-input v-model="form.sysInfo.recordURL" placeholder="请输入..." clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="可信证书">
|
||||||
|
<el-input type="textarea" v-model="form.sysInfo.ssl" placeholder="请输入可信证书的html代码" clearable rows="5" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ai-dialog-btn>
|
||||||
|
</template>
|
||||||
|
<template #content>
|
||||||
|
<el-form-item label="头部导航工具栏" class="row">
|
||||||
|
<el-checkbox v-model="form.downloadCenter">下载中心</el-checkbox>
|
||||||
|
<el-checkbox v-model="form.dv">数据大屏</el-checkbox>
|
||||||
|
<el-checkbox v-model="form.showTool">显示/隐藏导航栏</el-checkbox>
|
||||||
|
<el-checkbox v-model="form.helpDoc">帮助文档</el-checkbox>
|
||||||
|
<el-checkbox v-model="form.customerService">智能客服</el-checkbox>
|
||||||
|
<el-checkbox v-model="form.appQRCode">手机APP</el-checkbox>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="接口是否单服务">
|
||||||
|
<el-checkbox v-model="form.isSingleService" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="域名根目录">
|
||||||
|
<el-input v-model="form.base" clearable placeholder="填写域名根目录(baseURL)" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="默认首页">
|
||||||
|
<el-input v-model="form.homePage" clearable placeholder="填写应用的文件名" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="登录页">
|
||||||
|
<el-input v-model="form.signPage" clearable placeholder="填写应用的文件名" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开启百度流量">
|
||||||
|
<el-checkbox v-model="form.hmt" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否加载AI助手">
|
||||||
|
<el-checkbox v-model="form.copilot" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "wxcpConfig",
|
||||||
|
model: {
|
||||||
|
prop: "form",
|
||||||
|
event: "input"
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
form: Object,
|
||||||
|
title: String
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
form: {
|
||||||
|
handler() {
|
||||||
|
this.$emit("input", this.form)
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-card :title="title" class="wxcpConfig">
|
||||||
|
<template #content>
|
||||||
|
<el-form-item label="默认首页">
|
||||||
|
<el-input v-model="form.homePage" clearable placeholder="填写应用的文件名"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="域名根目录(baseURL)">
|
||||||
|
<el-input v-model="form.base" clearable placeholder="域名根目录"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否启用水印">
|
||||||
|
<el-checkbox v-model="form.waterMarker"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="接口是否单服务">
|
||||||
|
<el-checkbox v-model="form.isSingleService"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="自定义登录">
|
||||||
|
<el-checkbox v-model="form.customLogin"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开启百度流量">
|
||||||
|
<el-checkbox v-model="form.hmt"/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.wxcpConfig {
|
||||||
|
}
|
||||||
|
</style>
|
||||||
126
project/oms/apps/develop/AppDeployCustom/config/wxmpConfig.vue
Normal file
126
project/oms/apps/develop/AppDeployCustom/config/wxmpConfig.vue
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
<script>
|
||||||
|
import AiLibTable from "../AiLibTable.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "wxmpConfig",
|
||||||
|
components: {AiLibTable},
|
||||||
|
model: {
|
||||||
|
prop: "form",
|
||||||
|
event: "input"
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
form: Object,
|
||||||
|
title: String,
|
||||||
|
appList: {default: () => []}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
form: {
|
||||||
|
handler(v) {
|
||||||
|
this.$emit("input", v)
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
|
tabBar: {
|
||||||
|
deep: true, handler(v) {
|
||||||
|
this.$emit("input", {...this.form, tabBar: {...v, list: v.list.filter(e => !!e.pagePath) || []}})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
colConfigs: [
|
||||||
|
{prop: 'text', label: "名称", width: 120},
|
||||||
|
{prop: 'pagePath', label: "应用路径"},
|
||||||
|
{prop: 'iconPath', label: "默认图标"},
|
||||||
|
{prop: 'selectedIconPath', label: "选中图标"},
|
||||||
|
],
|
||||||
|
tabBar: {
|
||||||
|
color: "#666666",
|
||||||
|
selectedColor: "#197DF0",
|
||||||
|
backgroundColor: "#ffffff",
|
||||||
|
list: [
|
||||||
|
{pagePath: "pages/AppHome/AppHome", text: "首页", iconPath: "static/TabBar/home.png", selectedIconPath: "static/TabBar/home_selected.png"},
|
||||||
|
{pagePath: "pages/AppModules/AppModules", text: "应用", iconPath: "static/TabBar/service.png", selectedIconPath: "static/TabBar/service_selected.png"},
|
||||||
|
{
|
||||||
|
pagePath: "pages/AppEnteringVillage/AppEnteringVillage", text: "进村",
|
||||||
|
iconPath: "static/TabBar/custom.png", selectedIconPath: "static/TabBar/custom_selected.png"
|
||||||
|
},
|
||||||
|
{pagePath: "pages/AppMine/AppMine", text: "我的", iconPath: "static/TabBar/me.png", selectedIconPath: "static/TabBar/me_selected.png"}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleTabbarChange(row, {name, label}) {
|
||||||
|
row.text = label
|
||||||
|
row.pagePath = `pages/${name}/${name}`
|
||||||
|
},
|
||||||
|
handleTabbarDelete(i) {
|
||||||
|
this.tabBar.list?.splice(i, 1)
|
||||||
|
},
|
||||||
|
handleTabbarPosition(i, offset) {
|
||||||
|
const row = this.tabBar.list[i]
|
||||||
|
this.tabBar.list.splice(i, 1, this.tabBar.list[i + offset])
|
||||||
|
this.tabBar.list.splice(i + offset, 1, row)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.form.tabBar?.list?.length > 0) {
|
||||||
|
this.tabBar = this.form.tabBar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-card :title="title" class="wxmpConfig">
|
||||||
|
<template #content>
|
||||||
|
<el-form-item label="小程序AppId">
|
||||||
|
<el-input v-model="form.appId" clearable placeholder="小程序appId"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="半屏小程序">
|
||||||
|
<el-input v-model="form.embeddedAppIdList" clearable placeholder="如果有多个,请用英文','分割"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="接口是否单服务">
|
||||||
|
<el-checkbox v-model="form.isSingleService"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="引导页">
|
||||||
|
<el-input v-model="form.guide" placeholder="带'/'会被认为是输入的页面路径" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
<ai-title class="row" title="底部导航栏">
|
||||||
|
<el-button type="text" slot="rightBtn" icon="iconfont iconAdd" @click="tabBar.list.push({})">添加</el-button>
|
||||||
|
</ai-title>
|
||||||
|
<ai-table class="row" :tableData="tabBar.list" :colConfigs="colConfigs" tableSize="mini" :isShowPagination="false" border ref="TabBar">
|
||||||
|
<el-table-column slot="options" label="操作" width="260" align="center">
|
||||||
|
<template slot-scope="{row,$index}">
|
||||||
|
<el-row type="flex" class="tabBarOptions">
|
||||||
|
<ai-dialog-btn text="更换" dialogTitle="选择应用">
|
||||||
|
<ai-lib-table :meta="appList" v-model="row.id" @select="v=>handleTabbarChange(row,v)" :isShowPagination="false" v-bind="$props"
|
||||||
|
:border="false"/>
|
||||||
|
</ai-dialog-btn>
|
||||||
|
<ai-dialog-btn text="编辑" dialogTitle="编辑导航栏" width="600px">
|
||||||
|
<el-form-item label="名称">
|
||||||
|
<el-input v-model="row.text" placeholder="请输入" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="默认图标">
|
||||||
|
<el-input v-model="row.iconPath" placeholder="请输入" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="选中图标">
|
||||||
|
<el-input v-model="row.selectedIconPath" placeholder="请输入" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
</ai-dialog-btn>
|
||||||
|
<el-button type="text" @click="handleTabbarDelete($index)">删除</el-button>
|
||||||
|
<el-button type="text" @click="handleTabbarPosition($index,-1)" v-if="$index>0">上移</el-button>
|
||||||
|
<el-button type="text" @click="handleTabbarPosition($index,1)" v-if="$index<tabBar.list.length-1">下移</el-button>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.wxmpConfig {
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -11,6 +11,12 @@
|
|||||||
<el-form-item style="width: 100%" label="店铺名称" prop="title" :rules="[{required: true, message: '请输入店铺名称', trigger: 'blur'}]">
|
<el-form-item style="width: 100%" label="店铺名称" prop="title" :rules="[{required: true, message: '请输入店铺名称', trigger: 'blur'}]">
|
||||||
<el-input type="input" size="small" v-model="form.title" clearable placeholder="请输入店铺名称" :maxlength="50" show-word-limit></el-input>
|
<el-input type="input" size="small" v-model="form.title" clearable placeholder="请输入店铺名称" :maxlength="50" show-word-limit></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item style="width: 50%" label="店家" prop="shopkeeper">
|
||||||
|
<el-input type="input" size="small" v-model="form.shopkeeper" clearable placeholder="请输入店家名字" :maxlength="10" show-word-limit></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="width: 50%" label="联系电话" prop="phone" :rules="[{required: true, message: '请输入联系电话', trigger: 'blur'}]">
|
||||||
|
<el-input type="number" size="small" v-model="form.phone" clearable placeholder="请输入联系电话" :maxlength="11" show-word-limit></el-input>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item style="width: 100%" label="店铺类型" prop="type" :rules="[{required: true, message: '请选择店铺类型', trigger: 'change'}]">
|
<el-form-item style="width: 100%" label="店铺类型" prop="type" :rules="[{required: true, message: '请选择店铺类型', trigger: 'change'}]">
|
||||||
<ai-select
|
<ai-select
|
||||||
v-model="form.type"
|
v-model="form.type"
|
||||||
@@ -227,6 +233,8 @@
|
|||||||
isShow: false,
|
isShow: false,
|
||||||
form: {
|
form: {
|
||||||
title: '',
|
title: '',
|
||||||
|
shopkeeper: '',
|
||||||
|
phone: '',
|
||||||
type: '',
|
type: '',
|
||||||
serviceType: '0',
|
serviceType: '0',
|
||||||
visibleNames: '',
|
visibleNames: '',
|
||||||
|
|||||||
128
project/xumu/AppAccountConfigManage/AppAccountConfigManage.vue
Normal file
128
project/xumu/AppAccountConfigManage/AppAccountConfigManage.vue
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppAccountConfigManage",
|
||||||
|
label: "配置管理",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns: [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "账号", prop: "userName"},
|
||||||
|
{label: "姓名", prop: "name"},
|
||||||
|
{label: "角色", prop: "roleName"},
|
||||||
|
{label: "所属端", prop: "type", dict: "roleType", width: 120, align: 'center'},
|
||||||
|
{label: "状态", prop: "configStatus", dict: "configStatus", width: 120, align: 'center'},
|
||||||
|
],
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {name: ""},
|
||||||
|
dialog: false,
|
||||||
|
userId: "",
|
||||||
|
treeData: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user'])
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/user/config/page", null, {
|
||||||
|
params: {...this.page, ...this.search}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getTreeData() {
|
||||||
|
const {userId} = this
|
||||||
|
this.instance.post("/api/siteUser/querySiteByUserId", null, {params: {userId}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.treeData = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(node) {
|
||||||
|
this.$confirm("是否要删除该节点?").then(() => {
|
||||||
|
this.instance.post("/api/siteUser/del", null, {params: {ids: node.id}}).then(res => {
|
||||||
|
if (res?.code == '0' && res?.data != 1) {
|
||||||
|
this.$message.success("删除成功!")
|
||||||
|
this.getTreeData()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
createNode(data) {
|
||||||
|
this.$prompt("请输入名称").then(({value}) => {
|
||||||
|
const {userId} = this
|
||||||
|
this.instance.post("/api/siteUser/add", null, {params: {name: value, parentId: data.id, userId}}).then(res => {
|
||||||
|
if (res?.code == '0' && res?.data != 1) {
|
||||||
|
this.$message.success("新增成功!")
|
||||||
|
this.getTreeData()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("roleType", "configStatus")
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="AppAccountConfigManage" :title="$options.label">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #right>
|
||||||
|
<el-input size="small" placeholder="搜索账号" v-model="search.name" clearable
|
||||||
|
@change="page.pageNum=1, getTableData()" @getList="getTableData"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="dialog=true,userId=row.id">配置</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
<ai-dialog v-model="dialog" title="场地配置" width="50vw" @close="userId='',getTableData()"
|
||||||
|
@open="getTreeData" customFooter>
|
||||||
|
<el-button class="mar-b8" type="primary" @click="createNode(treeData)">新增根节点</el-button>
|
||||||
|
<el-tree :data="treeData" :props="{label:'name'}" default-expand-all>
|
||||||
|
<template slot-scope="{node,data}">
|
||||||
|
<div class="flex" style="width: 100%">
|
||||||
|
<span class="fill" v-text="node.label"/>
|
||||||
|
<el-button size="mini" type="text" @click="createNode(data)">增加子节点</el-button>
|
||||||
|
<el-button size="mini" type="text" @click="handleDelete(data)" v-if="$isEmpty(data.children)" class="del">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
<el-button slot="footer" @click="dialog=false,getTableData()">关闭</el-button>
|
||||||
|
</ai-dialog>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppAccountConfigManage {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.el-button .del {
|
||||||
|
color: #f46;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
263
project/xumu/AppAccountManage/AppAccountManage.vue
Normal file
263
project/xumu/AppAccountManage/AppAccountManage.vue
Normal file
@@ -0,0 +1,263 @@
|
|||||||
|
<template>
|
||||||
|
<section class="AppAccountManage">
|
||||||
|
<ai-page title="账号管理">
|
||||||
|
<ai-area-tree :root-id="rootArea" slot="left" v-model="search.areaId" range="3" @input="page.pageNum=1,getTableData()"/>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" icon="iconfont iconAdd" @click="dialog = true">添加</el-button>
|
||||||
|
<!-- <el-button type="primary" :disabled="!ids.toString()" @click="batchAllot">功能分配</el-button>-->
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<el-input size="small" placeholder="搜索姓名、手机号" v-model="search.condition" clearable
|
||||||
|
@change="page.pageNum=1, getTableData()"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize"
|
||||||
|
@getList="getTableData" :col-configs="colConfigs" :dict="dict" @selection-change="v => ids = v.map(e => e.id)">
|
||||||
|
<el-table-column slot="name" label="姓名" width="180px">
|
||||||
|
<el-row type="flex" align="middle" slot-scope="{row}">
|
||||||
|
<el-image class="avatar" :src="row.avatar" :preview-src-list="[row.avatar]">
|
||||||
|
<el-image slot="error" src="https://cdn.cunwuyun.cn/dvcp/h5/defaultAvatar.png" alt=""/>
|
||||||
|
</el-image>
|
||||||
|
<div>{{ row.name }}</div>
|
||||||
|
</el-row>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column slot="options" align="center" label="操作" fixed="right" width="220px">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="changeEnable(row)">{{ row.status == 1 ? '禁用' : '启用' }}</el-button>
|
||||||
|
<el-button type="text" @click="appAllot(row)">编辑</el-button>
|
||||||
|
<el-button type="text" @click="resetPassword(row.id)">重置密码</el-button>
|
||||||
|
<el-button type="text" @click="handleDelete(row)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
<!--添加账号、功能分配-->
|
||||||
|
<ai-dialog :title="dialogTitle" :visible.sync="dialog" width="60vw" @open="initDialogData"
|
||||||
|
@onConfirm="updateAccount" @closed="dialogForm = {}">
|
||||||
|
<el-form ref="updateAccountForm" :model="dialogForm" :rules="rules" size="small" label-width="120px" class="grid">
|
||||||
|
<el-form-item required label="行政区划" prop="areaId">
|
||||||
|
<ai-area-get v-model.trim="dialogForm.areaId" placeholder="请选择" :instance="instance"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item required label="账号" prop="userName">
|
||||||
|
<el-input v-model.trim="dialogForm.userName" placeholder="请输入..." clearable :maxLength="15"/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item required label="账号密码" prop="password" v-if="!isEdit" :rules="[{ required: true, message: '请输入密码' }]">-->
|
||||||
|
<!-- <el-input v-model.trim="dialogForm.password" placeholder="请输入密码" clearable :minlength="6"/>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<el-form-item required label="角色" prop="roleId">
|
||||||
|
<el-select placeholder="请选择角色" :value="dialogForm.roleId" filterable v-model="dialogForm.roleId" clearable>
|
||||||
|
<el-option v-for="(op, i) in accountRoles" :key="i" :label="op.name" :value="op.id"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item required label="姓名" prop="name">
|
||||||
|
<el-input v-model.trim="dialogForm.name" placeholder="请输入..." clearable :maxLength="15"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="手机号码" prop="phone">
|
||||||
|
<el-input v-model.trim="dialogForm.phone" placeholder="请输入..." clearable :maxLength="11"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="身份证号" prop="idCard" :rules="[{required:true,message:'请输入身份证号'}]">
|
||||||
|
<ai-input v-model.trim="dialogForm.idCard" :maxLength="18"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ai-dialog>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {mapState} from "vuex";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppAccountManage",
|
||||||
|
label: "账号管理",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
cascaderProps() {
|
||||||
|
return {
|
||||||
|
value: 'id',
|
||||||
|
checkStrictly: true,
|
||||||
|
emitPath: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isEdit() {
|
||||||
|
return !!this.dialogForm.id
|
||||||
|
},
|
||||||
|
dialogTitle() {
|
||||||
|
return this.isEdit ? '编辑账号' : '添加账号'
|
||||||
|
},
|
||||||
|
colConfigs() {
|
||||||
|
return [
|
||||||
|
// {type: 'selection', align: 'center'},
|
||||||
|
{label: "账号", prop: "userName"},
|
||||||
|
{label: "姓名", slot: "name"},
|
||||||
|
{label: "联系方式", prop: "phone", align: 'center'},
|
||||||
|
{label: "角色", prop: "roleName", align: 'center'},
|
||||||
|
{label: "状态", prop: "status", align: 'center', dict: "enable"},
|
||||||
|
{label: "认证状态", prop: "authStatus", align: 'center', dict: "authStatus"},
|
||||||
|
{label: "配置状态", prop: "configStatus", align: 'center', dict: "configStatus"},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
rules() {
|
||||||
|
return {
|
||||||
|
userName: [{required: true, message: "请输入账号"}],
|
||||||
|
name: [{required: true, message: "请输入姓名"}],
|
||||||
|
password: [{required: true, message: '请输入密码'}],
|
||||||
|
areaId: [{required: true, message: "请选择行政区划"}],
|
||||||
|
roleId: [{required: true, message: "请选择角色"}],
|
||||||
|
// phone: [{required: true, message: "请输入手机号码"}]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rootArea: v => v.user.info.areaId
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
accountRoles: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
dialog: false,
|
||||||
|
dialogForm: {},
|
||||||
|
tableData: [],
|
||||||
|
search: {condition: ""},
|
||||||
|
ids: [],
|
||||||
|
form: {
|
||||||
|
appids: [],
|
||||||
|
userId: ''
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/admin/user/page", null, {
|
||||||
|
params: {...this.page, ...this.search}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onConfirm() {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.instance.post(`/api/sysuserwxmp/addOrUpdate`, {
|
||||||
|
...this.form
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.getTableData()
|
||||||
|
this.$message.success('提交成功!')
|
||||||
|
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
initDialogData() {
|
||||||
|
//用于优化初始化数据
|
||||||
|
this.getAccountRoles()
|
||||||
|
},
|
||||||
|
getAccountRoles() {
|
||||||
|
this.accountRoles.length == 0 && this.instance.post("/admin/role/list-all").then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.accountRoles = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
batchAllot() {
|
||||||
|
this.dialog = true
|
||||||
|
this.dialogForm = {areaId: this.user.info.areaId, ids: this.ids}
|
||||||
|
},
|
||||||
|
appAllot(row) {
|
||||||
|
this.dialog = true
|
||||||
|
this.dialogForm = JSON.parse(JSON.stringify({
|
||||||
|
...row,
|
||||||
|
areaId: row.areaId || this.user.info.areaId
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
// 修改
|
||||||
|
updateAccount() {
|
||||||
|
this.$refs.updateAccountForm.validate(v => {
|
||||||
|
if (v) {
|
||||||
|
this.instance.post("/admin/user/addOrEdit", this.dialogForm).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.dialog = false;
|
||||||
|
this.$message.success("提交成功")
|
||||||
|
this.getTableData();
|
||||||
|
} else {
|
||||||
|
this.$message.error(res?.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(row) {
|
||||||
|
const {id: ids, authStatus, configStatus} = row
|
||||||
|
let text = "是否要删除该账号?"
|
||||||
|
if (authStatus == 1) {
|
||||||
|
text = configStatus == 1 ? "该账户已经认证,是否确认删除该账户?" : "该账户已经认证及配置,是否确认删除该账户?"
|
||||||
|
}
|
||||||
|
this.$confirm(text).then(() => {
|
||||||
|
this.instance.post("/admin/user/del", null, {
|
||||||
|
params: {ids}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.getTableData();
|
||||||
|
this.$message.success("删除成功!");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => 0)
|
||||||
|
},
|
||||||
|
changeEnable(row) {
|
||||||
|
const {status, id} = row
|
||||||
|
this.$confirm(`是否要${status == 1 ? '禁用' : '启用'}该账号?`).then(() => {
|
||||||
|
this.instance.post("/api/user/update-status", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$message.success(`${status == 1 ? '禁用' : '启用'}成功!`)
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
resetPassword(id) {
|
||||||
|
this.$confirm("是否要重置密码?").then(() => {
|
||||||
|
this.instance.post("/api/user/resetPwd", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$message.success("重置成功!")
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("enable", "authStatus", "configStatus")
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.AppAccountManage {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
:deep(.avatar) {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-form) {
|
||||||
|
|
||||||
|
.el-cascader,
|
||||||
|
.el-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
43
project/xumu/AppAuthManage/AppAuthManage.vue
Normal file
43
project/xumu/AppAuthManage/AppAuthManage.vue
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<script>
|
||||||
|
import authAdd from "./authAdd.vue";
|
||||||
|
import authList from "./authList.vue";
|
||||||
|
export default {
|
||||||
|
name: "AppAuthManage",
|
||||||
|
label: "认证审核",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return hash == "#add" ? authAdd : authList
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
certificates:[
|
||||||
|
{label: "身份证(正面)", prop: "frontCard"},
|
||||||
|
{label: "身份证(反面)", prop: "reverseCard"},
|
||||||
|
{label: "营业执照", prop: "businessPic", permit: ["breed"]},
|
||||||
|
{label: "畜禽经营许可证", prop: "breedPic", permit: ["breed"]},
|
||||||
|
{label: "动物防疫条件许可证", prop: "prevention", permit: ["breed"]},
|
||||||
|
{label: "组织机构证明", prop: "orgPic", permit: ["bank", "insurance"]},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppAuthManage">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppAuthManage {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
85
project/xumu/AppAuthManage/authAdd.vue
Normal file
85
project/xumu/AppAuthManage/authAdd.vue
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "authAdd",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isAuditing: v => v.detail.auditStatus == 1
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
this.instance.post("/api/user/auth/page", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.data?.records) {
|
||||||
|
const detail = res.data.records[0] || {}
|
||||||
|
let {picture = "{}"} = detail
|
||||||
|
picture = JSON.parse(picture)
|
||||||
|
this.detail = {...detail, ...picture}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getNeedCerts(type) {
|
||||||
|
return this.$parent.certificates.filter(e => !e.permit || e.permit.includes(type))
|
||||||
|
},
|
||||||
|
handleAudit(auditStatus) {
|
||||||
|
const auditLabels = {
|
||||||
|
2: "同意通过", 3: "驳回"
|
||||||
|
}
|
||||||
|
this.$confirm(`是否要${auditLabels[auditStatus]}认证?`).then(() => {
|
||||||
|
this.instance.post("/api/user/audit", null, {params:{
|
||||||
|
id: this.detail.id, auditStatus
|
||||||
|
}}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$confirm("是否要返回列表?","提交成功").then(() => this.back())
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus")
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page title="认证材料" class="authAdd" showBack content-string="detail">
|
||||||
|
<el-form size="small" label-position="top" :model="detail" ref="detail">
|
||||||
|
<ai-card title="认证材料">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item v-for="(op,i) in getNeedCerts(detail.type)" :key="i" v-bind="op" :rules="{required:true,message:`请上传${op.label}`,trigger:'change'}">
|
||||||
|
<el-image :src="detail[op.prop]" :preview-src-list="[detail[op.prop]]"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="备注说明">
|
||||||
|
<div v-text="detail.remark"/>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isAuditing">
|
||||||
|
<el-button type="primary" @click="handleAudit(2)">同意</el-button>
|
||||||
|
<el-button type="danger" @click="handleAudit(3)">拒绝</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button @click="back">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.authAdd {
|
||||||
|
}
|
||||||
|
</style>
|
||||||
135
project/xumu/AppAuthManage/authList.vue
Normal file
135
project/xumu/AppAuthManage/authList.vue
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
<script>
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "账号", prop: "userName"},
|
||||||
|
{label: "姓名", prop: "name"},
|
||||||
|
{label: "角色", prop: "roleName"},
|
||||||
|
{label: "所属端", prop: "type", dict: "roleType", width: 120, align: 'center'},
|
||||||
|
{label: "状态", prop: "authStatus", dict: "authStatus", width: 120, align: 'center'},
|
||||||
|
{label: "审核状态", prop: "auditStatus", dict: "auditStatus", width: 120, align: 'center'},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "authList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {name: ""},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/user/auth/page", null, {
|
||||||
|
params: {...this.page, ...this.search}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records.map(e => ({...e, permit: `${e.authStatus}` + e.auditStatus}))
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getNeedCerts(type) {
|
||||||
|
return this.$parent.certificates.filter(e => !e.permit || e.permit.includes(type))
|
||||||
|
},
|
||||||
|
handleConfirm() {
|
||||||
|
this.$refs.form.validate().then(() => {
|
||||||
|
const {id, remark} = this.form, picture = {}
|
||||||
|
this.$parent.certificates.forEach(e => {
|
||||||
|
picture[e.prop] = this.form[e.prop]
|
||||||
|
})
|
||||||
|
this.instance.post("/api/user/savePicture", null, {
|
||||||
|
params: {
|
||||||
|
id, remark, picture: JSON.stringify(picture)
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == '0' && res?.data != 1) {
|
||||||
|
this.dialog = false
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleUploadPics(row = {}) {
|
||||||
|
let {id, type, remark, picture = "{}"} = row
|
||||||
|
picture = JSON.parse(picture)
|
||||||
|
this.form = {id, type, remark, ...picture}
|
||||||
|
this.dialog = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("roleType", "authStatus", "auditStatus")
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="authList" title="认证审核">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-select v-model="search.authStatus" dict="authStatus" placeholder="状态"/>
|
||||||
|
<ai-select v-model="search.auditStatus" dict="auditStatus" placeholder="审核状态"/>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<el-input size="small" placeholder="搜索账号" v-model="search.name" clearable
|
||||||
|
@change="page.pageNum=1, getTableData()" @getList="getTableData"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" v-if="'12'.includes(row.permit)"
|
||||||
|
@click="$router.push({query:{id:row.id},hash:'#add'})">查看
|
||||||
|
</el-button>
|
||||||
|
<el-button class="deleteBtn" type="text" v-if="'11'.includes(row.permit)"
|
||||||
|
@click="$router.push({query:{id:row.id},hash:'#add'})">审核
|
||||||
|
</el-button>
|
||||||
|
<el-button type="text" v-if="'00|13'.includes(row.permit)"
|
||||||
|
@click="handleUploadPics(row)">认证材料
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
<ai-dialog v-model="dialog" title="认证材料" width="60%" @close="form={}" @confirm="handleConfirm">
|
||||||
|
<el-form class="grid c-3" :model="form" ref="form" label-width="160px">
|
||||||
|
<el-form-item v-for="(op,i) in getNeedCerts(form.type)" :key="i" v-bind="op" :rules="{required:true,message:`请上传${op.label}`,trigger:'change'}">
|
||||||
|
<ai-uploader v-model="form[op.prop]" valueIsUrl :limit="1" :instance="instance"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="row" label="备注说明" prop="remark">
|
||||||
|
<el-input type="textarea" :rows="2" v-model="form.remark" placeholder="备注说明具体情况"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ai-dialog>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.authList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppBreedArchive/AppBreedArchive.vue
Normal file
35
project/xumu/AppBreedArchive/AppBreedArchive.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppBreedArchive",
|
||||||
|
label: "电子档案",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return hash == "#add" ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("archiveStatus", "category", "variety", "insuranceType", "deathReason", "dataSources", "yesOrNo")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppBreedArchive">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppBreedArchive {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
182
project/xumu/AppBreedArchive/add.vue
Normal file
182
project/xumu/AppBreedArchive/add.vue
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = {
|
||||||
|
weightList: [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "重量", prop: "weight"},
|
||||||
|
{label: "称重时间", prop: "createTime"},
|
||||||
|
{label: "数据来源", prop: "source", dict: "dataSources"},
|
||||||
|
{label: "是否变更过", prop: "isUpdate", dict: "yesOrNo"},
|
||||||
|
],
|
||||||
|
immunityList: [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "疫苗名称", prop: "vaccineName"},
|
||||||
|
{label: "用药方式", prop: "method"},
|
||||||
|
{label: "药量(ml)", prop: "dosage"},
|
||||||
|
{label: "生产厂家", prop: "factory"},
|
||||||
|
{label: "厂家批号", prop: "batchNumber"},
|
||||||
|
{label: "免疫时间", prop: "immunityTime"},
|
||||||
|
{label: "登记时间", prop: "createTime"},
|
||||||
|
{label: "防疫员", prop: "userName"},
|
||||||
|
],
|
||||||
|
treatmentList: [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "药品名称", prop: "drugName"},
|
||||||
|
{label: "药量(ml)", prop: "dosage"},
|
||||||
|
{label: "生产厂家", prop: "factory"},
|
||||||
|
{label: "厂家批号", prop: "batchNumber"},
|
||||||
|
{label: "疾病名称", prop: "diseaseName"},
|
||||||
|
{label: "症状", prop: "symptom"},
|
||||||
|
{label: "兽医", prop: "userName"},
|
||||||
|
{label: "治疗时间", prop: "immunityTime"},
|
||||||
|
{label: "登记时间", prop: "createTime"},
|
||||||
|
],
|
||||||
|
outList: [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "养殖场", prop: "userName", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "类别", prop: "category", dict: "category", width: 120},
|
||||||
|
{label: "品种", prop: "variety", dict: "variety", width: 120},
|
||||||
|
{label: "日龄(天)", prop: "age", width: 80},
|
||||||
|
{label: "淘汰时间", prop: "outTime"},
|
||||||
|
{label: "淘汰原因", prop: "reason"}
|
||||||
|
],
|
||||||
|
deathList: [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "养殖场", prop: "userName", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "类别", prop: "category", dict: "category", width: 120},
|
||||||
|
{label: "品种", prop: "variety", dict: "variety", width: 120},
|
||||||
|
{label: "日龄(天)", prop: "age", width: 80},
|
||||||
|
{label: "死亡时间", prop: "deathTime"},
|
||||||
|
{label: "死亡原因", prop: "reason", dict: "deathReason", width: 80},
|
||||||
|
{label: "登记时间", prop: "createTime"},
|
||||||
|
{label: "操作人", prop: "userName", width: 100},
|
||||||
|
],
|
||||||
|
insuranceList: [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "保险类型", prop: "insuranceType", dict: "insuranceType"},
|
||||||
|
{label: "保单编号", prop: "orderNo"},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
const forms = {
|
||||||
|
device: [
|
||||||
|
{label: "当前温度", prop: "temperature"},
|
||||||
|
{label: "温度状态", prop: "temperatureStatus", dict: "temperatureStatus"},
|
||||||
|
{label: "运动状态", prop: "sportsSituation", dict: "sportsSituation"},
|
||||||
|
{label: "在栏状态", prop: "status", dict: "archiveStatus"},
|
||||||
|
],
|
||||||
|
loan: [
|
||||||
|
{label: "贷款合同编号", prop: "contractNo"},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
const navs = [
|
||||||
|
{label: "体重记录", value: "weightList"},
|
||||||
|
{label: "免疫记录", value: "immunityList"},
|
||||||
|
{label: "治疗记录", value: "treatmentList"},
|
||||||
|
{label: "淘汰记录", value: "outList"},
|
||||||
|
{label: "死亡记录", value: "deathList"},
|
||||||
|
{label: "设备检测", value: "device"},
|
||||||
|
{label: "贷款信息", value: "loan"},
|
||||||
|
{label: "保险信息", value: "insuranceList"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "baAdd",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []},
|
||||||
|
active: "weightList",
|
||||||
|
columns, navs, forms
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
isAdd: v => !v.$route.query.id,
|
||||||
|
isEdit: v => v.$route.query.edit == 1,
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/report/getInfo", null, {params: {biochipEarNumber: id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
Object.keys(columns).forEach(key => {
|
||||||
|
detail[key] = detail[key] || []
|
||||||
|
})
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "category", "variety")
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="baAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid c-3">
|
||||||
|
<el-form-item label="养殖户" prop="userName" class="row">
|
||||||
|
<b v-text="detail.userName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖场" prop="farmId">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId">
|
||||||
|
<b v-text="detail.houseName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId">
|
||||||
|
<b v-text="detail.penName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生物芯片耳标号" prop="penId">
|
||||||
|
<b v-text="detail.biochipEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电子耳标号" prop="penId">
|
||||||
|
<b v-text="detail.electronicEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="原厂耳标号" prop="penId">
|
||||||
|
<b v-text="detail.originalEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<el-tabs type="border-card" v-model="active">
|
||||||
|
<el-tab-pane v-for="(nav,i) in navs" :key="i" :label="nav.label" :name="nav.value" lazy>
|
||||||
|
<template v-if="active==nav.value">
|
||||||
|
<ai-table v-if="columns[nav.value]" :colConfigs="columns[nav.value]" :table-data="detail[nav.value]" :isShowPagination="!1"/>
|
||||||
|
<el-form v-if="forms[nav.value]" size="small" class="grid" label-width="120px">
|
||||||
|
<el-form-item v-for="(item,i) in forms[nav.value]" :key="i" :label="item.label" :prop="item.prop">
|
||||||
|
<b v-text="dict.getLabel(item.dict||'yesOrNo',detail[item.prop])"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.baAdd {
|
||||||
|
}
|
||||||
|
</style>
|
||||||
110
project/xumu/AppBreedArchive/list.vue
Normal file
110
project/xumu/AppBreedArchive/list.vue
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "养殖户", prop: "userName", width: 100},
|
||||||
|
{label: "养殖场", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`, minWidth: 200},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "电子耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "原厂耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "入栏日期", prop: "createTime", width: 160},
|
||||||
|
{label: "饲养时长(天)", prop: "days", width: 100, align: 'right', headerAlign: 'center'},
|
||||||
|
{label: "最新体重(公斤)", prop: "weight", width: 120, align: 'right', headerAlign: 'center'},
|
||||||
|
// {label: "当前体温", prop: "temperatureStatus", dict: 'temperatureStatus'},
|
||||||
|
// {label: "运动情况", prop: "sportsSituation", dict: "sportsSituation"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "baList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/report/getArchivePage", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="baList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-select placeholder="全部养殖户" v-model="search.userId" :instance="instance" :action="`/api/report/getOrgList`" :prop="{label:'name'}" readonly/>
|
||||||
|
<ai-select placeholder="全部养殖场" v-model="search.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${search.userId||''}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖舍" v-model="search.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.farmId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖栏" v-model="search.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.houseId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber"/>
|
||||||
|
<ai-input placeholder="电子耳标号" v-model="search.electronicEarNumber"/>
|
||||||
|
<ai-input placeholder="原厂耳标号" v-model="search.originalEarNumber"/>
|
||||||
|
<ai-select placeholder="全部状态" v-model="search.status" dict="archiveStatus"/>
|
||||||
|
<ai-select placeholder="全部类别" v-model="search.category" dict="category"/>
|
||||||
|
<ai-select placeholder="全部品种" v-model="search.variety" dict="variety"/>
|
||||||
|
<ai-search label="入栏日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-download :instance="instance" url="/api/report/exportArchive" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.baList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppClaimApply/AppClaimApply.vue
Normal file
35
project/xumu/AppClaimApply/AppClaimApply.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppClaimApply",
|
||||||
|
label: "理赔申请",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return ["#claim", "#add"].includes(hash) ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "insureType", "insureStatus", "category", "variety")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppClaimApply">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppClaimApply {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
145
project/xumu/AppClaimApply/add.vue
Normal file
145
project/xumu/AppClaimApply/add.vue
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue";
|
||||||
|
|
||||||
|
const records = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "报案号", prop: "reportNo"},
|
||||||
|
{label: "审批状态", prop: "auditStatus", dict: "auditStatus"},
|
||||||
|
{label: "审批时间", prop: "auditTime"},
|
||||||
|
{label: "审批人", prop: "auditName"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "claimAdd",
|
||||||
|
components: {AiEartagPicker},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []},
|
||||||
|
records
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.isClaim ? `新增${appName}` : `${appName}详情`
|
||||||
|
},
|
||||||
|
isClaim: v => v.$route.hash == "#claim",
|
||||||
|
formImages: v => [
|
||||||
|
{label: "勘察报告书", prop: "surveyPicture", rules: {required: v.isClaim, message: '请上传 勘察报告书'}},
|
||||||
|
{label: "无害化回执单", prop: "receiptPicture", rules: {required: v.isClaim, message: '请上传 无害化回执单'}},
|
||||||
|
],
|
||||||
|
columns: v => [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "身长测量照片", prop: "heightPicture", upload: {instance: v.instance, readonly: !v.isClaim, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "电子耳标照片", prop: "earNumberPicture", upload: {instance: v.instance, readonly: !v.isClaim, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "防疫耳标照片", prop: "preventionPicture", upload: {instance: v.instance, readonly: !v.isClaim, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "无害化处理照片", prop: "harmlessPicture", upload: {instance: v.instance, readonly: !v.isClaim, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "报案号", prop: "reportNo", hide: v.isClaim},
|
||||||
|
].filter(e => !e.hide),
|
||||||
|
selectedEartags: v => v.detail.list?.length || 0,
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/insurance/claim/apply/getInfo", null, {params: {orderNo: id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/insurance/claim/apply/add", {...this.detail}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="claimAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="养殖场" prop="farmId">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="承保公司" prop="companyId">
|
||||||
|
<b v-text="detail.companyName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="投保类型">
|
||||||
|
<ai-input :value="dict.getLabel('insureType',detail.insureType)" :edit="!1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保险产品" prop="productType">
|
||||||
|
<b v-text="detail.productType"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系人">
|
||||||
|
<ai-input v-model="detail.contacts" :edit="!1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系电话">
|
||||||
|
<ai-input v-model="detail.phone" :edit="!1"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="投保对象">
|
||||||
|
<template #right v-if="isClaim">
|
||||||
|
<ai-eartag-picker @select="v=>detail.detailList=v" :instance="instance"
|
||||||
|
:action="`/api/insurance/claim/apply/getClaimEarNumberList?orderNo=${detail.orderNo}`">
|
||||||
|
<el-button type="text">选择</el-button>
|
||||||
|
</ai-eartag-picker>
|
||||||
|
</template>
|
||||||
|
<ai-highlight class="mar-b8 font-14" :content="`投保标的共${detail.insureNumber||0}只,已理赔标的共 @v 只`" color="red" :value="selectedEartags"/>
|
||||||
|
<ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1" hideOptions/>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="理赔材料" v-if="isClaim">
|
||||||
|
<div class="font-12 mar-b8">只能上传JPG/PNG文件,且不超过2M,一次最多5张</div>
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-model="detail[img.prop]" :instance="instance" value-is-url :limit="5"/>
|
||||||
|
</el-form-item>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="理赔记录" v-else>
|
||||||
|
<ai-table :tableData="detail.list" :colConfigs="records" :isShowPagination="!1" hideOptions/>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isClaim">
|
||||||
|
<el-button type="primary" @click="submit(1)">提交</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.claimAdd {
|
||||||
|
:deep(.el-form--label-top) {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
123
project/xumu/AppClaimApply/list.vue
Normal file
123
project/xumu/AppClaimApply/list.vue
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "投保单号", prop: "orderNo"},
|
||||||
|
{label: "所属养殖户", prop: "applyName"},
|
||||||
|
{label: "所属养殖场", prop: "farmName"},
|
||||||
|
{label: "投保数量(头)", prop: "insureNumber", width: 120},
|
||||||
|
{label: "投保状态", prop: "status", width: 160, dict: "insureStatus"},
|
||||||
|
{label: "投保类型", prop: "insureType", dict: "insureType"},
|
||||||
|
{label: "投保时间", prop: "createTime"},
|
||||||
|
{label: "可理赔数量", prop: "unpaidClaimNumber", width: 120},
|
||||||
|
{label: "说明", prop: "remarks"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "claimList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/insurance/claim/apply/page", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records.map(e => ({...e, permit: e.remarks == "可申请理赔"}))
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="claimList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-input placeholder="投保订单号" v-model="search.orderNo"/>
|
||||||
|
<ai-select placeholder="全部投保类型" v-model="search.insureType" dict="insureType"/>
|
||||||
|
<ai-search label="投保日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="养殖户" v-model="search.applyName"/>
|
||||||
|
<ai-input placeholder="养殖场" v-model="search.farmName"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-download :instance="instance" url="/api/insurance/claim/apply/export" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<template v-if="row.permit">
|
||||||
|
<el-button type="text" @click="dialog=true,$set(form,'id',row.orderNo)">理赔</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.orderNo}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
<ai-dialog v-model="dialog" title="理赔须知" @closed="form={}">
|
||||||
|
<el-form size="small" label-position="top" :mode="form" ref="form">
|
||||||
|
<el-form-item label="如遇一下情况进行赔付:">
|
||||||
|
1、自然灾害:如暴雨、洪水、台风、冰雹、雷击、暴风雪等导致的肉牛死亡或伤残;<br/>
|
||||||
|
2、疾病与疫病:包括但不限于口蹄疫、布鲁氏菌病、炭疽、牛结核病等对肉牛生命安全造成威胁的疾病;<br/>
|
||||||
|
3、意外事故:如火灾、爆炸、触电、盗窃、走失等;<br/>
|
||||||
|
4、强制扑杀:由于政府政策或疫情控制需要,对肉牛进行的强制扑杀。
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="flex center">
|
||||||
|
<el-checkbox v-model="form.agree">本人阅读并知晓理赔须知,承认上传资料的真实性</el-checkbox>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #foot>
|
||||||
|
<el-button @click="$router.push({hash:'#claim',query:{id:form.id}})" type="primary" :disabled="!form.agree">符合要求,立即申请</el-button>
|
||||||
|
<el-button @click="dialog=false">取消</el-button>
|
||||||
|
</template>
|
||||||
|
</ai-dialog>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.claimList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppClaimAudit/AppClaimAudit.vue
Normal file
35
project/xumu/AppClaimAudit/AppClaimAudit.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppClaimAudit",
|
||||||
|
label: "理赔审核",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return ["#audit", "#add"].includes(hash) ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "insureType", "insureStatus", "category", "variety")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppClaimAudit">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppClaimAudit {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
160
project/xumu/AppClaimAudit/add.vue
Normal file
160
project/xumu/AppClaimAudit/add.vue
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue";
|
||||||
|
import AiSelect from "dui/packages/basic/AiSelect.vue";
|
||||||
|
|
||||||
|
const records = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "报案号", prop: "reportNo"},
|
||||||
|
{label: "审批状态", prop: "auditStatus", dict: "auditStatus"},
|
||||||
|
{label: "审批时间", prop: "auditTime"},
|
||||||
|
{label: "审批人", prop: "auditName"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "claimAdd",
|
||||||
|
components: {AiSelect, AiEartagPicker},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []},
|
||||||
|
records
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.isAudit ? `${appName}审批` : `${appName}详情`
|
||||||
|
},
|
||||||
|
isAudit: v => v.$route.hash == "#audit",
|
||||||
|
formImages: v => [
|
||||||
|
{label: "勘察报告书", prop: "surveyPicture"},
|
||||||
|
{label: "无害化回执单", prop: "receiptPicture"},
|
||||||
|
],
|
||||||
|
columns: v => [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "身长测量照片", prop: "heightPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "电子耳标照片", prop: "earNumberPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "防疫耳标照片", prop: "preventionPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "无害化处理照片", prop: "harmlessPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
].filter(e => !e.hide),
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/insurance/claim/apply/getAuditInfo", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/insurance/claim/apply/audit", {...this.detail}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="claimAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="养殖场" prop="farmId">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="承保公司" prop="companyId">
|
||||||
|
<b v-text="detail.companyName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="投保类型">
|
||||||
|
<ai-input :value="dict.getLabel('insureType',detail.insureType)" :edit="!1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保险产品" prop="productType">
|
||||||
|
<b v-text="detail.productType"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系人">
|
||||||
|
<ai-input v-model="detail.contacts" :edit="!1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系电话">
|
||||||
|
<ai-input v-model="detail.phone" :edit="!1"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="投保对象">
|
||||||
|
<ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1" hideOptions/>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="理赔材料">
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-model="detail[img.prop]" value-is-url readonly/>
|
||||||
|
</el-form-item>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="审核信息">
|
||||||
|
<div class="grid">
|
||||||
|
<template v-if="isAudit">
|
||||||
|
<el-form-item label="审批状态" prop="auditStatus" :rules="{required:true,message:'请选择审批状态'}">
|
||||||
|
<ai-select v-model="detail.auditStatus" dict="auditStatus"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="理赔资料" class="sc-3">
|
||||||
|
<ai-uploader v-model="detail.picture" value-is-url :instance="instance" :limit="1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="报案号" prop="reportNo" :rules="{required:true,message:'请输入 报案号'}">
|
||||||
|
<ai-input v-model="detail.reportNo"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="说明">
|
||||||
|
<ai-input type="textarea" :rows="3" v-model="detail.remarks"/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-form-item label="审核状态">{{ dict.getLabel('auditStatus', detail.auditStatus) }}</el-form-item>
|
||||||
|
<el-form-item label="理赔资料" class="sc-3">
|
||||||
|
<el-image :src="detail.picture" :preview-src-list="[detail.picture]"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审核时间">{{ detail.auditTime }}</el-form-item>
|
||||||
|
<el-form-item label="审核人">{{ detail.auditName }}</el-form-item>
|
||||||
|
<el-form-item label="说明">{{ detail.remarks }}</el-form-item>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isAudit">
|
||||||
|
<el-button type="primary" @click="submit">提交</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.claimAdd {
|
||||||
|
:deep(.el-form--label-top) {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
107
project/xumu/AppClaimAudit/list.vue
Normal file
107
project/xumu/AppClaimAudit/list.vue
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "报案号", prop: "reportNo"},
|
||||||
|
{label: "投保单号", prop: "orderNo"},
|
||||||
|
{label: "所属养殖户", prop: "applyName"},
|
||||||
|
{label: "投保类型", prop: "insureType", dict: "insureType"},
|
||||||
|
{label: "理赔数量", prop: "claimNumber"},
|
||||||
|
{label: "审批状态", prop: "auditStatus", dict: "auditStatus"},
|
||||||
|
{label: "审批时间", prop: "auditTime"},
|
||||||
|
{label: "审批人", prop: "auditName"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "claimList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/insurance/claim/apply/getAuditPage", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records.map(e => ({...e, permit: `${e.status}` + e.auditStatus}))
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="claimList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-input placeholder="投保订单号" v-model="search.orderNo"/>
|
||||||
|
<ai-select placeholder="全部投保类型" v-model="search.insureType" dict="insureType"/>
|
||||||
|
<ai-select placeholder="全部审批状态" v-model="search.auditStatus" dict="auditStatus"/>
|
||||||
|
<ai-select placeholder="全部投保状态" v-model="search.status" dict="insureStatus"/>
|
||||||
|
<ai-search label="投保日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="养殖户" v-model="search.applyName"/>
|
||||||
|
<ai-input placeholder="养殖场" v-model="search.farmName"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-download :instance="instance" url="/api/insurance/claim/apply/exportAudit" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<template v-if="['1'].includes(row.auditStatus)">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#audit',query:{id:row.id}})">审核</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.id}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.claimList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppDeathAudit/AppDeathAudit.vue
Normal file
35
project/xumu/AppDeathAudit/AppDeathAudit.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppDeathAudit",
|
||||||
|
label: "死亡审核",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return ["#audit", "#add"].includes(hash) ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "deathReason", "category", "variety")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppDeathAudit">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppDeathAudit {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
153
project/xumu/AppDeathAudit/add.vue
Normal file
153
project/xumu/AppDeathAudit/add.vue
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "deathAdd",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.isAudit ? `${appName}审批` : `${appName}详情`
|
||||||
|
},
|
||||||
|
isAudit: v => v.$route.hash == "#audit",
|
||||||
|
formImages: v => [
|
||||||
|
{label: "身长测量照片", prop: "heightPic"},
|
||||||
|
{label: "生物芯片照片", prop: "biochipPic"},
|
||||||
|
{label: "防疫耳标照片", prop: "preventionPic"},
|
||||||
|
{label: "其他说明照片", prop: "otherPic"},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/breed/death/page", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.data?.records) {
|
||||||
|
const detail = res.data.records[0] || {}
|
||||||
|
if (detail.picture) {
|
||||||
|
Object.entries(JSON.parse(detail.picture)).forEach(([key, value]) => {
|
||||||
|
detail[key] = value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/breed/death/audit", {...this.detail}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="deathAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid c-4">
|
||||||
|
<el-form-item label="生物芯片耳标号" class="row">
|
||||||
|
<b v-text="detail.biochipEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖场" prop="farmId">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId">
|
||||||
|
<b v-text="detail.houseName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId">
|
||||||
|
<b v-text="detail.penName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电子耳标号" prop="electronicEarNumber">
|
||||||
|
<b v-text="detail.electronicEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="原厂耳标号" prop="category">
|
||||||
|
<b v-text="detail.originalEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别" prop="category">
|
||||||
|
<b v-text="detail.category"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品种" prop="variety">
|
||||||
|
<b v-text="detail.variety"/>
|
||||||
|
</el-form-item>
|
||||||
|
<div class="row flex">
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-model="detail[img.prop]" value-is-url readonly/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="死亡信息">
|
||||||
|
<el-form-item label="死亡原因">
|
||||||
|
<b v-text="dict.getLabel('deathReason',detail.reason)"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="死亡日期">
|
||||||
|
<b v-text="detail.deathTime"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<b v-text="detail.remark"/>
|
||||||
|
</el-form-item>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="审核信息">
|
||||||
|
<div class="grid">
|
||||||
|
<template v-if="isAudit">
|
||||||
|
<el-form-item label="审批状态" prop="auditStatus" :rules="{required:true,message:'请选择审批状态'}">
|
||||||
|
<ai-select v-model="detail.auditStatus" dict="auditStatus"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="意见">
|
||||||
|
<ai-input type="textarea" :rows="3" v-model="detail.remark"/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-form-item label="审核状态">{{ dict.getLabel('auditStatus', detail.auditStatus) }}</el-form-item>
|
||||||
|
<el-form-item label="审核时间">{{ detail.auditTime }}</el-form-item>
|
||||||
|
<el-form-item label="审核人">{{ detail.auditName }}</el-form-item>
|
||||||
|
<el-form-item label="意见">{{ detail.remarks }}</el-form-item>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isAudit">
|
||||||
|
<el-button type="primary" @click="submit">提交</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.deathAdd {
|
||||||
|
:deep(.el-form--label-top) {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
112
project/xumu/AppDeathAudit/list.vue
Normal file
112
project/xumu/AppDeathAudit/list.vue
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "养殖场", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "类别", prop: "category", dict: "category", width: 120},
|
||||||
|
{label: "品种", prop: "variety", dict: "variety", width: 120},
|
||||||
|
{label: "日龄(天)", prop: "age", width: 80},
|
||||||
|
{label: "死亡时间", prop: "deathTime"},
|
||||||
|
{label: "死亡原因", prop: "reason", dict: "deathReason", width: 80},
|
||||||
|
{label: "登记时间", prop: "createTime"},
|
||||||
|
{label: "操作人", prop: "userName", width: 100},
|
||||||
|
{label: "审核状态", prop: "auditStatus", dict: "auditStatus", width: 80},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "deathList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/breed/death/getAuditPage", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records.map(e => ({...e, permit: `${e.status}` + e.auditStatus}))
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="deathList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-select placeholder="全部养殖场" v-model="search.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖舍" v-model="search.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.farmId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖栏" v-model="search.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.houseId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部审核状态" v-model="search.auditStatus" dict="auditStatus"/>
|
||||||
|
<ai-search label="死亡日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.deathBeginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.deathEndDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-search label="登记日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="原场耳标号" v-model="search.originalEarNumber"/>
|
||||||
|
<ai-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber"/>
|
||||||
|
<ai-input placeholder="电子耳标号" v-model="search.electronicEarNumber"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-download :instance="instance" url="/api/breed/death/export" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<template v-if="['1'].includes(row.auditStatus)">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#audit',query:{id:row.id}})">审核</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.id}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.deathList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppDeathManage/AppDeathManage.vue
Normal file
35
project/xumu/AppDeathManage/AppDeathManage.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppDeathManage",
|
||||||
|
label: "死亡登记",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let { hash } = this.$route
|
||||||
|
return hash == "#add" ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("yesOrNo", "category", "variety", "deathReason", "auditStatus")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppDeathManage">
|
||||||
|
<component :is="currentPage" v-bind="$props" />
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppDeathManage {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
167
project/xumu/AppDeathManage/add.vue
Normal file
167
project/xumu/AppDeathManage/add.vue
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagRemote from "@project/xumu/components/AiEartagRemote.vue";
|
||||||
|
|
||||||
|
const formImages = [
|
||||||
|
{label: "身长测量照片", prop: "heightPic",},
|
||||||
|
{label: "生物芯片照片", prop: "biochipPic",},
|
||||||
|
{label: "防疫耳标照片", prop: "preventionPic",},
|
||||||
|
{label: "其他说明照片", prop: "otherPic",},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "deathAdd",
|
||||||
|
components: {AiEartagRemote},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formImages,
|
||||||
|
detail: {},
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
isAdd: v => !v.$route.query.id,
|
||||||
|
isEdit: v => v.$route.query.edit == 1,
|
||||||
|
isAuthing: v => v.detail.auditStatus == 1,
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail(id) {
|
||||||
|
return id && this.instance.post("/api/breed/death/page", {biochipEarNumber: id}).then(res => {
|
||||||
|
if (res?.data?.records) {
|
||||||
|
const detail = res.data.records[0] || {}
|
||||||
|
if (detail.picture) {
|
||||||
|
Object.entries(JSON.parse(detail.picture)).forEach(([key, value]) => {
|
||||||
|
detail[key] = value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
const {biochipEarNumber, id, deathTime, heightPic, biochipPic, preventionPic, otherPic, reason, remarks} = this.detail
|
||||||
|
this.instance.post("/api/breed/death/addOrEdit", {
|
||||||
|
biochipEarNumber, id, deathTime, picture: JSON.stringify({heightPic, biochipPic, preventionPic, otherPic}), reason, remarks
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0 && res?.data != 1) {
|
||||||
|
this.$confirm("是否返回列表页?", "提交成功").then(() => this.back()).catch(() => this.getDetail(biochipEarNumber))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAudit() {
|
||||||
|
this.$refs.form.validate().then(() => {
|
||||||
|
const {id} = this.detail
|
||||||
|
this.instance.post("/api/breed/death/audit", null, {params: {id, ...this.form}}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$message.success("操作成功")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handlerAutocomplete(value) {
|
||||||
|
'biochipEarNumber|farmId|houseId|penId|electronicEarNumber|originalEarNumber|category|variety'.split("|").forEach(prop => this.$set(this.detail, prop, value[prop]))
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail(this.$route.query.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="deathAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid c-4">
|
||||||
|
<ai-eartag-remote :instance="instance" @enter="handlerAutocomplete" class="row"/>
|
||||||
|
<el-form-item label="生物芯片耳标号">
|
||||||
|
<b v-text="detail.biochipEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖场" prop="farmId">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId">
|
||||||
|
<b v-text="detail.houseName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId">
|
||||||
|
<b v-text="detail.penName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电子耳标号" prop="electronicEarNumber">
|
||||||
|
<b v-text="detail.electronicEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="原厂耳标号" prop="originalEarNumber">
|
||||||
|
<b v-text="detail.originalEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别" prop="category">
|
||||||
|
<b v-text="detail.category"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品种" prop="variety">
|
||||||
|
<b v-text="detail.variety"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="上传照片">
|
||||||
|
<div class="grid c-4">
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-if="isAdd||isEdit" v-model="detail[img.prop]" :instance="instance" :limit="1" value-is-url/>
|
||||||
|
<el-image :src="detail[img.prop]" :preview-src-list="[detail[img.prop]]" v-else/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="死亡录入">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="死亡日期" prop="deathTime" :rules="[{required:isAdd||isEdit,message:'请选择死亡日期'}]">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-if="isAdd||isEdit" v-model="detail.deathTime"/>
|
||||||
|
<b v-else v-text="detail.deathTime"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="死亡原因" prop="reason" :rules="[{required:isAdd||isEdit,message:'请选择死亡原因'}]">
|
||||||
|
<ai-select v-if="isAdd||isEdit" v-model="detail.reason" dict="deathReason"/>
|
||||||
|
<b v-else v-text="dict.getLabel('deathReason',detail.reason)"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark" class="row">
|
||||||
|
<ai-input type="textarea" :row="3" v-model="detail.remark" :edit="isAdd||isEdit"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="审批信息" v-if="isAuthing">
|
||||||
|
<el-form :model="form" size="small" ref="form" label-width="120px">
|
||||||
|
<el-form-item label="是否同意" prop="auditStatus" :rules="[{required:true,message:'请选择是否同意'}]">
|
||||||
|
<ai-select v-model="form.auditStatus" :select-list="[{dictValue: 2, dictName: '同意'}, {dictValue: 3, dictName: '不同意'}]"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审批意见" prop="auditReason">
|
||||||
|
<el-input type="textarea" :row="3" v-model="form.auditReason" clearable placeholder="请输入"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button type="primary" @click="submit" v-if="isAdd||isEdit">提交</el-button>
|
||||||
|
<el-button type="primary" @click="handleAudit" v-if="isAuthing">提交</el-button>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.deathAdd {
|
||||||
|
.el-date-editor {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
142
project/xumu/AppDeathManage/list.vue
Normal file
142
project/xumu/AppDeathManage/list.vue
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "养殖场",format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "类别", prop: "category", dict: "category", width: 120},
|
||||||
|
{label: "品种", prop: "variety", dict: "variety", width: 120},
|
||||||
|
{label: "日龄(天)", prop: "age", width: 80},
|
||||||
|
{label: "死亡时间", prop: "deathTime"},
|
||||||
|
{label: "死亡原因", prop: "reason", dict: "deathReason", width: 80},
|
||||||
|
{label: "登记时间", prop: "createTime"},
|
||||||
|
{label: "操作人", prop: "userName", width: 100},
|
||||||
|
{label: "审核状态", prop: "auditStatus", dict: "auditStatus", width: 80},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "deathList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/breed/death/page", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
this.$confirm("确定删除该条数据?").then(() => {
|
||||||
|
this.instance.post("/api/breed/weight/del", null, {
|
||||||
|
params: {id}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAuditAgain(id) {
|
||||||
|
this.$confirm("是否要再次提交审批?").then(() => {
|
||||||
|
this.instance.post("/api/breed/death/audit", null, {
|
||||||
|
params: {id, auditStatus: 1}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功")
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="deathList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-select placeholder="全部养殖场" v-model="search.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖舍" v-model="search.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.farmId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖栏" v-model="search.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.houseId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部审核状态" v-model="search.auditStatus" dict="auditStatus"/>
|
||||||
|
<ai-search label="死亡日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.deathBeginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.deathEndDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-search label="登记日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="原场耳标号" v-model="search.originalEarNumber"/>
|
||||||
|
<ai-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber"/>
|
||||||
|
<ai-input placeholder="电子耳标号" v-model="search.electronicEarNumber"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">新增</el-button>
|
||||||
|
<ai-download :instance="instance" url="/api/breed/death/export" :params="{...search,...page}" :fileName="`死亡导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
|
||||||
|
<el-button v-if="row.auditStatus==1" type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber}})">查看</el-button>
|
||||||
|
<template v-else>
|
||||||
|
<el-button v-if="row.auditStatus==2" type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber}})">查看</el-button>
|
||||||
|
<el-button v-if="row.auditStatus==2" type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber,edit:1}})">编辑</el-button>
|
||||||
|
<el-button v-if="row.auditStatus==3" type="text" @click="handleAuditAgain(row.id)">再次提交</el-button>
|
||||||
|
<el-button type="text" @click="handleDelete(row.id)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.deathList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
32
project/xumu/AppDictionary/AppDictionary.vue
Normal file
32
project/xumu/AppDictionary/AppDictionary.vue
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<template>
|
||||||
|
<section class="AppDictionary">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import DictDetail from "./dictDetail";
|
||||||
|
import DictList from "@project/xumu/AppDictionary/dictList.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppDictionary",
|
||||||
|
label: "数据字典",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return hash == "#add" ? DictDetail : DictList
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.AppDictionary {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
202
project/xumu/AppDictionary/dictDetail.vue
Normal file
202
project/xumu/AppDictionary/dictDetail.vue
Normal file
@@ -0,0 +1,202 @@
|
|||||||
|
<template>
|
||||||
|
<section class="dictDetail">
|
||||||
|
<ai-detail>
|
||||||
|
<ai-title slot="title" title="字典信息" isShowBottomBorder isShowBack @onBackClick="$router.push({})"/>
|
||||||
|
<template #content>
|
||||||
|
<ai-card title="基本信息">
|
||||||
|
<template #content>
|
||||||
|
<el-form ref="dictDetailForm" :model="form" :rules="rules" size="small" label-width="110px">
|
||||||
|
<el-form-item required label="数据项:" prop="code">
|
||||||
|
<el-input v-model="form.code" style="width: 259px;" clearable
|
||||||
|
placeholder="请输入..."/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item required label="数据项名称:" prop="name">
|
||||||
|
<el-input v-model="form.name" style="width: 259px;" clearable
|
||||||
|
placeholder="请输入..."/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="数据值" v-if="$route.query.id">
|
||||||
|
<template #right>
|
||||||
|
<el-button type="text" icon="iconfont iconAdd"
|
||||||
|
@click="form.dictionaryDetails.push({name:'',value:'',editable:true})"> 添加
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
<template #content>
|
||||||
|
<el-table border :data="form.dictionaryDetails" header-cell-class-name="table-header"
|
||||||
|
cell-class-name="table-cell">
|
||||||
|
<el-table-column align="center" label="值">
|
||||||
|
<div slot-scope="{row}">
|
||||||
|
<el-input size="small" v-if="row.editable" v-model="row.value" clearable/>
|
||||||
|
<span v-else>{{ row.dictValue }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="描述">
|
||||||
|
<div slot-scope="{row}">
|
||||||
|
<el-input size="small" v-if="row.editable" v-model="row.name" clearable/>
|
||||||
|
<span v-else>{{ row.dictName }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="颜色">
|
||||||
|
<div slot-scope="{row}">
|
||||||
|
<el-color-picker v-if="row.editable" v-model="row.dictColor" size="medium"></el-color-picker>
|
||||||
|
<span v-else>{{ row.dictColor || '未设置' }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="操作" width="109px">
|
||||||
|
<div slot-scope="{row,$index}">
|
||||||
|
<section v-if="row.editable">
|
||||||
|
<el-button style="color: #2EA222" type="text" icon="iconfont iconCorrect"
|
||||||
|
@click="addDict(row)"/>
|
||||||
|
<el-button style="color: #f46" type="text" icon="iconfont iconClean"
|
||||||
|
@click="cancelEdit(row,$index)"/>
|
||||||
|
</section>
|
||||||
|
<section v-else>
|
||||||
|
<el-button class="dict-detail-operation" type="text" icon="iconfont iconEdit"
|
||||||
|
@click="editDetail(row)"/>
|
||||||
|
<el-button class="dict-detail-operation" type="text" icon="iconfont iconDelete"
|
||||||
|
@click="delDictValue(row.id)"/>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="$router.push({})">返回</el-button>
|
||||||
|
<el-button type="primary" @click="modifyDict">保存</el-button>
|
||||||
|
</template>
|
||||||
|
</ai-detail>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "dictDetail",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
rules() {
|
||||||
|
return {
|
||||||
|
code: [
|
||||||
|
{required: true, message: "请填写数据项"}
|
||||||
|
],
|
||||||
|
name: [
|
||||||
|
{required: true, message: "请填写数据项名称"}
|
||||||
|
],
|
||||||
|
// dictionaryDetails: [
|
||||||
|
// {
|
||||||
|
// validator: (r, v, cb) => {
|
||||||
|
// if (v.every(item => item.dictName && item.dictValue)) {
|
||||||
|
// cb()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
code: "",
|
||||||
|
name: "",
|
||||||
|
dictionaryDetails: []
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.$route.query.id) this.getDict()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getDict() {
|
||||||
|
this.instance.post("/admin/dictionary/queryDictDetail", null, {
|
||||||
|
params: {dictionaryId: this.$route.query.id}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
res.data.dictionaryDetails = res.data.dictionaryDetails.map(d => {
|
||||||
|
return {
|
||||||
|
...d,
|
||||||
|
editable: false,
|
||||||
|
name: "",
|
||||||
|
value: ""
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.form = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
delDictValue(id) {
|
||||||
|
this.$confirm("是否要删除该字典值", {
|
||||||
|
type: 'error'
|
||||||
|
}).then(() => {
|
||||||
|
this.instance.post("/admin/dictionary/deletevalue", null, {
|
||||||
|
params: {id}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$message.success("删除成功!")
|
||||||
|
this.getDict()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => 0)
|
||||||
|
},
|
||||||
|
editDetail(row) {
|
||||||
|
row.editable = true
|
||||||
|
row.name = row.dictName
|
||||||
|
row.value = row.dictValue
|
||||||
|
},
|
||||||
|
addDict(row) {
|
||||||
|
row.dictValue = row.value
|
||||||
|
row.dictName = row.name
|
||||||
|
row.dictionaryId = this.form.id
|
||||||
|
this.instance.post("/admin/dictionary/updateDetail", row).then(res => {
|
||||||
|
row.editable = false
|
||||||
|
row = res.data.data
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cancelEdit(row, index) {
|
||||||
|
if (row.id) {
|
||||||
|
row.editable = false
|
||||||
|
} else {
|
||||||
|
this.form.dictionaryDetails.splice(index, 1)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
modifyDict() {
|
||||||
|
this.$refs.dictDetailForm.validate(v => {
|
||||||
|
if (v) {
|
||||||
|
this.instance.post("/admin/dictionary/updateDict", this.form).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.$router.push({})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.dictDetail {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
:deep( .el-table__row ){
|
||||||
|
|
||||||
|
.el-input__inner {
|
||||||
|
padding: 0 30px;
|
||||||
|
border: none;
|
||||||
|
text-align: center;
|
||||||
|
background: #ddd;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
142
project/xumu/AppDictionary/dictList.vue
Normal file
142
project/xumu/AppDictionary/dictList.vue
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
<script>
|
||||||
|
const columns = [
|
||||||
|
{slot: "expand"},
|
||||||
|
{label: "数据项", prop: "code"},
|
||||||
|
{label: "数据项名称", prop: "name"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "dictList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
page: {
|
||||||
|
current: 1,
|
||||||
|
total: 0,
|
||||||
|
size: 10
|
||||||
|
},
|
||||||
|
search: {
|
||||||
|
condition: ""
|
||||||
|
},
|
||||||
|
dictList: [],
|
||||||
|
id: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
resetSearch() {
|
||||||
|
this.page.current = 1;
|
||||||
|
this.search.condition = '';
|
||||||
|
this.getDicts();
|
||||||
|
},
|
||||||
|
getDicts() {
|
||||||
|
this.instance.post("/admin/dictionary/queryDictList", null, {
|
||||||
|
params: {
|
||||||
|
...this.page,
|
||||||
|
name: this.search.condition
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
this.dictList = res.data.records.map(e => {
|
||||||
|
return {...e, detail: []}
|
||||||
|
})
|
||||||
|
this.page.total = res.data.total
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addDict() {
|
||||||
|
this.$router.push({hash: "#add"})
|
||||||
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
this.$confirm("确定要删除该数据项吗?", {
|
||||||
|
type: "error"
|
||||||
|
}).then(() => {
|
||||||
|
this.instance.post("/admin/dictionary/deleteDict", null, {
|
||||||
|
params: {id}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.getDicts();
|
||||||
|
this.$message.success("删除成功!")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => 0)
|
||||||
|
},
|
||||||
|
openDetail(id) {
|
||||||
|
this.$router.push({query: {id}, hash: "#add"})
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.page.size = val;
|
||||||
|
this.getDicts();
|
||||||
|
},
|
||||||
|
getDictInfo(row) {
|
||||||
|
if (row.detail.length) {
|
||||||
|
row.detail = []
|
||||||
|
} else {
|
||||||
|
this.getDict(row.id).then(res => {
|
||||||
|
if (res && res.data) {
|
||||||
|
row.detail = res.data.dictionaryDetails || []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDict(dictionaryId) {
|
||||||
|
return this.instance.post("/admin/dictionary/queryDictDetail", null, {
|
||||||
|
params: {dictionaryId}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDicts()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<section class="dictList">
|
||||||
|
<ai-list>
|
||||||
|
<ai-title slot="title" title="数据字典" isShowBottomBorder/>
|
||||||
|
<template #content>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" size="small" icon="iconfont iconAdd" @click="addDict"
|
||||||
|
v-if="$permissions('admin_sysdictionary_add')">添加
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<el-input size="small" v-model="search.condition" placeholder="数据项" clearable
|
||||||
|
@change="page.current=1,getDicts()" prefix-icon="iconfont iconSearch"/>
|
||||||
|
<el-button type="primary" size="small" icon="iconfont iconSearch"
|
||||||
|
@click="page.current=1,getDicts()">查询
|
||||||
|
</el-button>
|
||||||
|
<el-button size="small" icon="el-icon-refresh-right" @click="resetSearch">重置</el-button>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="dictList" :colConfigs="columns" :dict="dict" @getList="getDicts"
|
||||||
|
:total="page.total" :current.sync="page.current" :size.sync="page.size" :page-sizes="[10, 20, 50, 100,200]"
|
||||||
|
@expand-change="getDictInfo">
|
||||||
|
<el-table-column slot="expand" type="expand">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="flex" style="gap:4px">
|
||||||
|
<el-tag v-for="(op,i) in row.detail||[]" :key="i">{{ [op.dictValue, op.dictName, op.dictColor].filter(Boolean).join("|") }}</el-tag>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="openDetail(row.id)" v-if="$permissions('admin_sysdictionary_edit')">编辑</el-button>
|
||||||
|
<el-button type="text" @click="handleDelete(row.id)" v-if="$permissions('admin_sysdictionary_del')">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</template>
|
||||||
|
</ai-list>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.dictList {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
36
project/xumu/AppEarTag/AppEarTag.vue
Normal file
36
project/xumu/AppEarTag/AppEarTag.vue
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./etAdd.vue";
|
||||||
|
import list from "./etList.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppEarTag",
|
||||||
|
label: "耳标登记",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return hash == "#add" ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppEarTag">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppEarTag {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
165
project/xumu/AppEarTag/etAdd.vue
Normal file
165
project/xumu/AppEarTag/etAdd.vue
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "etAdd",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
isAdd: v => !v.$route.query.id,
|
||||||
|
isEdit: v => v.$route.query.edit == 1,
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
|
||||||
|
},
|
||||||
|
columns: v => [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber", edit: 1},
|
||||||
|
{label: "电子耳标号", prop: "electronicEarNumber", edit: 1},
|
||||||
|
{label: "原厂耳标号", prop: "originalEarNumber", edit: 1},
|
||||||
|
{label: "戴耳标照片", prop: "picture", upload: {valueIsUrl: !0, instance: v.instance, limit: 1}},
|
||||||
|
{label: "品种", prop: "variety", select: {dict: "variety"}},
|
||||||
|
{label: "类别", prop: "category", select: {dict: "category"}},
|
||||||
|
{label: "日龄/天", prop: "age", num: 1},
|
||||||
|
{label: "体重/公斤", prop: "weight", num: 1},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/breed/earTag/page", {id}).then(res => {
|
||||||
|
if (res?.data?.records) {
|
||||||
|
const detail = res.data.records[0] || {}
|
||||||
|
return this.detail = {detailList: [], ...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(index) {
|
||||||
|
this.$confirm("确定删除该条数据?").then(() => {
|
||||||
|
this.detail.detailList.splice(index, 1)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
if (this.isEdit) {
|
||||||
|
const {biochipEarNumber, electronicEarNumber, originalEarNumber, picture, variety, category, age, weight} = this.detail
|
||||||
|
this.detail.detailList = [{biochipEarNumber, electronicEarNumber, originalEarNumber, picture, variety, category, age, weight}]
|
||||||
|
}
|
||||||
|
this.instance.post("/api/breed/earTag/addOrEdit", this.detail).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$confirm("是否要返回列表?", "提交成功").then(() => this.back())
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "category", "variety")
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="etAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid c-3">
|
||||||
|
<template v-if="isAdd">
|
||||||
|
<el-form-item label="养殖场" prop="farmId" :rules="{required:isAdd,message:'请选择养殖场'}">
|
||||||
|
<ai-select v-model="detail.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId" :rules="{required:isAdd,message:'请选择养殖舍'}">
|
||||||
|
<ai-select v-model="detail.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${detail.farmId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId" :rules="{required:isAdd,message:'请选择养殖栏'}">
|
||||||
|
<ai-select v-model="detail.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${detail.houseId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-form-item label="养殖场" prop="farmId">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId">
|
||||||
|
<b v-text="detail.houseName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId">
|
||||||
|
<b v-text="detail.penName"/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="耳标录入">
|
||||||
|
<template v-if="isAdd">
|
||||||
|
<el-button type="text" slot="right" @click="detail.detailList.push({})">新增</el-button>
|
||||||
|
<ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row,$index}">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" class="deleteBtn" @click="handleDelete($index)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</template>
|
||||||
|
<div class="grid" v-else>
|
||||||
|
<el-form-item label="生物芯片耳标号">
|
||||||
|
<el-input v-if="isEdit" v-model="detail.biochipEarNumber" placeholder="请输入" clearable/>
|
||||||
|
<b v-else v-text="detail.biochipEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电子耳标号" prop="electronicEarNumber">
|
||||||
|
<el-input v-if="isEdit" v-model="detail.electronicEarNumber" placeholder="请输入" clearable/>
|
||||||
|
<b v-else v-text="detail.electronicEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="原厂耳标号" prop="originalEarNumber">
|
||||||
|
<el-input v-if="isEdit" v-model="detail.originalEarNumber" placeholder="请输入" clearable/>
|
||||||
|
<b v-else v-text="detail.originalEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="戴耳标照片" class="row">
|
||||||
|
<el-image :src="detail.picture" :preview-src-list="[detail.picture]"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品种" prop="variety">
|
||||||
|
<ai-select v-if="isEdit" v-model="detail.variety" dict="variety"/>
|
||||||
|
<b v-else v-text="dict.getLabel('variety',detail.variety)"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别" prop="category">
|
||||||
|
<ai-select v-if="isEdit" v-model="detail.category" dict="category"/>
|
||||||
|
<b v-else v-text="dict.getLabel('category',detail.category)"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="日龄/天">
|
||||||
|
<el-input v-if="isEdit" v-model.number="detail.age" placeholder="请输入" clearable/>
|
||||||
|
<b v-else v-text="detail.age"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="体重/公斤">
|
||||||
|
<el-input v-if="isEdit" v-model.number="detail.weight" placeholder="请输入" clearable/>
|
||||||
|
<b v-else v-text="detail.weight"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isEdit||isAdd">
|
||||||
|
<el-button type="primary" @click="submit">提交</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.etAdd {
|
||||||
|
}
|
||||||
|
</style>
|
||||||
121
project/xumu/AppEarTag/etList.vue
Normal file
121
project/xumu/AppEarTag/etList.vue
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "养殖场", prop: "userName", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "登记时间", prop: "createTime"},
|
||||||
|
{label: "日龄/天", prop: "age", width: 120, align: 'right'},
|
||||||
|
{label: "登记体重", prop: "weight", width: 120, align: 'right'},
|
||||||
|
{label: "戴标员", prop: "userName", width: 120, align: 'center'},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "etList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/breed/earTag/page", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
this.$confirm("确定删除该条数据?").then(() => {
|
||||||
|
this.instance.post("/api/breed/earTag/del", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.code == '0' && res?.data != 1) {
|
||||||
|
this.$message.success("删除成功")
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "category", "variety")
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="etList" title="耳标登记">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-select placeholder="全部机构" v-model="search.userId" :instance="instance" :action="`/api/breed/earTag/getOrgList`" :prop="{label:'name'}" readonly/>
|
||||||
|
<ai-select placeholder="全部养殖场" v-model="search.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${search.userId||''}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖舍" v-model="search.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.farmId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖栏" v-model="search.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.houseId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<el-input placeholder="戴标员" v-model="search.userName" dict="authStatus" size="small" clearable/>
|
||||||
|
<el-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber" dict="authStatus" size="small" clearable/>
|
||||||
|
<ai-select placeholder="全部类别" v-model="search.category" dict="category"/>
|
||||||
|
<ai-select placeholder="全部品种" v-model="search.variety" dict="variety"/>
|
||||||
|
<ai-search label="登记日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-search label="日龄">
|
||||||
|
<el-input placeholder="最小日龄" v-model="search.beginAge" size="small" clearable/>
|
||||||
|
<el-input placeholder="最大日龄" v-model="search.endAge" size="small" clearable/>
|
||||||
|
</ai-search>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">新增</el-button>
|
||||||
|
<ai-download :instance="instance" url="/api/breed/earTag/export" :params="{...search,...page}" :fileName="`耳标登记导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#add',query:{id:row.id}})">查看</el-button>
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#add',query:{id:row.id,edit:1}})">编辑</el-button>
|
||||||
|
<el-button type="text" class="deleteBtn" @click="handleDelete(row.id)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.etList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppImmunityManage/AppImmunityManage.vue
Normal file
35
project/xumu/AppImmunityManage/AppImmunityManage.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppImmunityManage",
|
||||||
|
label: "免疫登记",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return hash == "#add" ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppImmunityManage">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppImmunityManage {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
201
project/xumu/AppImmunityManage/add.vue
Normal file
201
project/xumu/AppImmunityManage/add.vue
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagPicker from "../components/AiEartagPicker.vue";
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "疫苗名称", prop: "vaccineName"},
|
||||||
|
{label: "用药方式", prop: "method"},
|
||||||
|
{label: "药量(ml)", prop: "dosage"},
|
||||||
|
{label: "生产厂家", prop: "factory"},
|
||||||
|
{label: "厂家批号", prop: "batchNumber"},
|
||||||
|
{label: "免疫时间", prop: "immunityTime"},
|
||||||
|
{label: "登记时间", prop: "createTime"},
|
||||||
|
{label: "防疫员", prop: "userName"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "immunityAdd",
|
||||||
|
components: {AiEartagPicker},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []},
|
||||||
|
columns,
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
isAdd: v => !v.$route.query.id,
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/breed/immunity/getInfo", null, {params: {biochipEarNumber: id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
detail.detailList = detail.immunityList || []
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
this.$confirm("确定删除该条数据?").then(() => {
|
||||||
|
this.instance.post("/api/breed/immunity/del", null, {
|
||||||
|
params: {id}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAdd() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/breed/immunity/add", this.detail).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$message.success("新增成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
const action = !this.form.id ? "/api/breed/immunity/add" : "/api/breed/immunity/update"
|
||||||
|
this.instance.post(action, this.form).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.dialog = false
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("yesOrNo", "category", "variety", "source")
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="immunityAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid c-3" v-if="isAdd">
|
||||||
|
<el-form-item label="养殖场" prop="farmId" :rules="{required:true,message:'请选择 养殖场'}">
|
||||||
|
<ai-select v-model="detail.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId" :rules="{required:true,message:'请选择 养殖舍'}">
|
||||||
|
<ai-select v-model="detail.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${detail.farmId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId" :rules="{required:true,message:'请选择 养殖栏'}">
|
||||||
|
<ai-select v-model="detail.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${detail.houseId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="牲畜" prop="earNumberList" :rules="{required:true,message:'请选择 牲畜'}" class="row">
|
||||||
|
<ai-eartag-picker v-model="detail.earNumberList" :instance="instance" :penId="detail.penId"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
<div v-else class="grid c-4">
|
||||||
|
<el-form-item label="养殖场" prop="farmId">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId">
|
||||||
|
<b v-text="detail.houseName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId">
|
||||||
|
<b v-text="detail.penName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生物芯片耳标号">
|
||||||
|
<b v-text="detail.biochipEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="免疫登记">
|
||||||
|
<template v-if="isAdd">
|
||||||
|
<div class="grid c-3">
|
||||||
|
<el-form-item label="免疫日期" prop="immunityTime" :rules="{required:true,message:'请选择 免疫日期'}">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="detail.immunityTime"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="疫苗名称" prop="vaccineName" :rules="{required:true,message:'请选择 疫苗名称'}">
|
||||||
|
<ai-input v-model="detail.vaccineName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用药方式" prop="method">
|
||||||
|
<ai-input v-model="detail.method"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生产厂家" prop="factory">
|
||||||
|
<ai-input v-model="detail.factory"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="每头药量" prop="dosage">
|
||||||
|
<ai-input v-model="detail.dosage"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="厂家批号" prop="batchNumber">
|
||||||
|
<ai-input v-model="detail.batchNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-button type="text" slot="right" @click="dialog=true">新增</el-button>
|
||||||
|
<ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row,$index}">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="dialog=true,form=row">编辑</el-button>
|
||||||
|
<el-button type="text" class="deleteBtn" @click="handleDelete(row.id)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
<ai-dialog v-model="dialog" title="免疫登记" @closed="form={}" @confirm="submit">
|
||||||
|
<el-form size="small" label-width="120px" class="grid">
|
||||||
|
<el-form-item label="免疫日期" prop="immunityTime" :rules="{required:true,message:'请选择 免疫日期'}">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="form.immunityTime"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="疫苗名称" prop="vaccineName" :rules="{required:true,message:'请选择 疫苗名称'}">
|
||||||
|
<ai-input v-model="form.vaccineName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用药方式" prop="method">
|
||||||
|
<ai-input v-model="form.method"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生产厂家" prop="factory">
|
||||||
|
<ai-input v-model="form.factory"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="每头药量" prop="dosage">
|
||||||
|
<ai-input v-model="form.dosage"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="厂家批号" prop="batchNumber">
|
||||||
|
<ai-input v-model="form.batchNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ai-dialog>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button v-if="isAdd" type="primary" @click="handleAdd">提交</el-button>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.immunityAdd {
|
||||||
|
.el-date-editor {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
106
project/xumu/AppImmunityManage/list.vue
Normal file
106
project/xumu/AppImmunityManage/list.vue
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "养殖场", prop: "userName", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "最近免疫日期", prop: "immunityTime"},
|
||||||
|
{label: "最近登记时间", prop: "createTime"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "immunityList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/breed/immunity/page", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "category", "variety")
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="immunityList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-select placeholder="全部养殖场" v-model="search.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖舍" v-model="search.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.farmId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖栏" v-model="search.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.houseId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-search label="免疫日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.immunityBeginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.immunityEndDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-search label="登记日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<el-input placeholder="原场耳标号" v-model="search.originalEarNumber" dict="authStatus" size="small" clearable/>
|
||||||
|
<el-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber" dict="authStatus" size="small" clearable/>
|
||||||
|
<el-input placeholder="电子耳标号" v-model="search.electronicEarNumber" dict="authStatus" size="small" clearable/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">新增</el-button>
|
||||||
|
<ai-download :instance="instance" url="/api/breed/immunity/export" :params="{...search,...page}" :fileName="`免疫登记导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.immunityList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppInsuranceApply/AppInsuranceApply.vue
Normal file
35
project/xumu/AppInsuranceApply/AppInsuranceApply.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppInsuranceApply",
|
||||||
|
label: "投保申请",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return hash == "#add" ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("insuranceAuditStatus", "insureType", "insureStatus", "category", "variety")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppInsuranceApply">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppInsuranceApply {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
177
project/xumu/AppInsuranceApply/add.vue
Normal file
177
project/xumu/AppInsuranceApply/add.vue
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue";
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "类别", prop: "category", dict: "category"},
|
||||||
|
{label: "品种", prop: "variety", dict: "variety"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "iaAdd",
|
||||||
|
components: {AiEartagPicker},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []},
|
||||||
|
columns,
|
||||||
|
companyList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
|
||||||
|
},
|
||||||
|
isAdd: v => !v.$route.query.id,
|
||||||
|
isEdit: v => v.$route.query.edit == 1,
|
||||||
|
formImages: v => [
|
||||||
|
{label: "身份证(正面)", prop: "frontCard", rules: {required: v.isAdd || v.isEdit, message: '请上传 身份证(正面)'}},
|
||||||
|
{label: "身份证(反面)", prop: "reverseCard", rules: {required: v.isAdd || v.isEdit, message: '请上传 身份证(反面)'}},
|
||||||
|
{label: "营业执照", prop: "businessPic", rules: {required: v.isAdd || v.isEdit, message: '请上传 营业执照'}},
|
||||||
|
{label: "畜禽经营许可证", prop: "breedPic", rules: {required: v.isAdd || v.isEdit, message: '请上传 畜禽经营许可证'}},
|
||||||
|
{label: "动物防疫条件许可证", prop: "prevention", rules: {required: v.isAdd || v.isEdit, message: '请上传 动物防疫条件许可证'}},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/insurance/apply/getInfo", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
detail.detailList = detail.detailList || []
|
||||||
|
let {farmPicture: picture = "{}"} = detail
|
||||||
|
picture = JSON.parse(picture)
|
||||||
|
return this.detail = {...detail, ...picture}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCompanies() {
|
||||||
|
this.instance.post("/api/insurance/apply/getCompany").then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.companyList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getProducts(id) {
|
||||||
|
const item = this.companyList.find(e => e.id == id)
|
||||||
|
return item?.children || []
|
||||||
|
},
|
||||||
|
submit(submitType) {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
const earNumberList = this.detail.detailList.map(e => e.biochipEarNumber)
|
||||||
|
const farmPicture = {}
|
||||||
|
this.formImages.forEach(e => {
|
||||||
|
const {prop} = e
|
||||||
|
const val = this.detail[prop]
|
||||||
|
if (val) {
|
||||||
|
farmPicture[prop] = val
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.detail.farmPicture = JSON.stringify(farmPicture)
|
||||||
|
this.instance.post("/api/insurance/apply/addOrEdit", {...this.detail, submitType, earNumberList}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getCompanies()
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="iaAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="养殖场" prop="farmId" :rules="{required: isAdd||isEdit,message:'请选择 养殖场'}">
|
||||||
|
<ai-select v-if="isAdd||isEdit" v-model="detail.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
<b v-else v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="承保公司" prop="companyId" :rules="{required: isAdd||isEdit,message:'请选择 承保公司'}">
|
||||||
|
<ai-select v-if="isAdd||isEdit" v-model="detail.companyId" :select-list="companyList" :prop="{label:'name'}"/>
|
||||||
|
<b v-else v-text="detail.companyName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保险产品" prop="productType" :rules="{required: isAdd||isEdit,message:'请选择 保险产品'}">
|
||||||
|
<ai-select v-if="isAdd||isEdit" v-model="detail.productType" :select-list="getProducts(detail.companyId)" :prop="{label:'name',value:'productType'}"
|
||||||
|
@select="v=>$set(detail,'insureType',v.children[0].insureType)"/>
|
||||||
|
<b v-else v-text="detail.productType"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="投保类型">
|
||||||
|
<ai-input :value="dict.getLabel('insureType',detail.insureType)" placeholder="根据保险产品自动带出" :edit="isAdd||isEdit" readonly/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系人">
|
||||||
|
<ai-input v-model="detail.contacts" :edit="isAdd||isEdit"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系电话">
|
||||||
|
<ai-input v-model="detail.phone" :edit="isAdd||isEdit"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="投保对象">
|
||||||
|
<template #right v-if="isAdd||isEdit">
|
||||||
|
<ai-eartag-picker @select="v=>detail.detailList=v" :instance="instance" value-key="biochipEarNumber"
|
||||||
|
:action="`/api/insurance/apply/getEarNumberList?farmId=${detail.farmId}`">
|
||||||
|
<el-button type="text">选择</el-button>
|
||||||
|
</ai-eartag-picker>
|
||||||
|
</template>
|
||||||
|
<ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1" hideOptions/>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="证件信息">
|
||||||
|
<div class="grid c-5 el-form--label-top">
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-if="isAdd||isEdit" v-model="detail[img.prop]" :instance="instance" :limit="1" value-is-url/>
|
||||||
|
<el-image :src="detail[img.prop]" :preview-src-list="[detail[img.prop]]" v-else/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="审核信息" v-if="!(isAdd||isEdit)">
|
||||||
|
<el-form-item label="审核状态">{{ dict.getLabel('insuranceAuditStatus', detail.auditStatus) }}</el-form-item>
|
||||||
|
<el-form-item label="审核时间">{{ detail.auditTime }}</el-form-item>
|
||||||
|
<el-form-item label="审核人">{{ detail.auditName }}</el-form-item>
|
||||||
|
<el-form-item label="保单订单号">{{ detail.orderNo }}</el-form-item>
|
||||||
|
<el-form-item label="保单资料">
|
||||||
|
<el-image :src="detail.picture" :preview-src-list="[detail.picture]"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="说明">{{ detail.remarks }}</el-form-item>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isAdd||isEdit">
|
||||||
|
<el-button type="primary" @click="submit(1)">保存草稿</el-button>
|
||||||
|
<el-button type="primary" @click="submit(2)">保存并提交</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.iaAdd {
|
||||||
|
:deep(.el-form--label-top) {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
119
project/xumu/AppInsuranceApply/list.vue
Normal file
119
project/xumu/AppInsuranceApply/list.vue
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "投保单号", prop: "orderNo"},
|
||||||
|
{label: "所属养殖场", prop: "farmName"},
|
||||||
|
{label: "投保类型", prop: "insureType", dict: "insureType"},
|
||||||
|
{label: "承保公司", prop: "companyName"},
|
||||||
|
{label: "投保时间", prop: "createTime"},
|
||||||
|
{label: "投保状态", prop: "status", width: 160, dict: "insureStatus"},
|
||||||
|
{label: "审核状态", prop: "auditStatus", width: 120, dict: "insuranceAuditStatus"},
|
||||||
|
{label: "申请人", prop: "applyName", width: 120},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "iaList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/insurance/apply/page", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records.map(e => ({...e, permit: `${e.status}` + e.auditStatus}))
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
this.$confirm("确定删除该条数据?").then(() => {
|
||||||
|
this.instance.post("/api/insurance/apply/del", null, {
|
||||||
|
params: {id}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="iaList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-select placeholder="全部养殖场" v-model="search.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-input placeholder="投保订单号" v-model="search.orderNo"/>
|
||||||
|
<ai-select placeholder="全部投保类型" v-model="search.insureType" dict="insureType"/>
|
||||||
|
<ai-select placeholder="全部投保状态" v-model="search.status" dict="insureStatus"/>
|
||||||
|
<ai-select placeholder="全部审批状态" v-model="search.auditStatus" dict="auditStatus"/>
|
||||||
|
<ai-search label="投保日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">新增</el-button>
|
||||||
|
<ai-download :instance="instance" url="/api/insurance/apply/export" :params="{...search,...page}" :fileName="`投保申请导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<template v-if="['00','03'].includes(row.permit)">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#add',query:{id:row.id,edit:1}})">编辑</el-button>
|
||||||
|
<el-button type="text" @click="handleDelete(row.id)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.id}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.iaList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppInsuranceAudit/AppInsuranceAudit.vue
Normal file
35
project/xumu/AppInsuranceAudit/AppInsuranceAudit.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppInsuranceAudit",
|
||||||
|
label: "投保审批",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return ["#add", "#audit"].includes(hash) ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "insureType", "insureStatus", "category", "variety")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppInsuranceAudit">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppInsuranceAudit {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
213
project/xumu/AppInsuranceAudit/add.vue
Normal file
213
project/xumu/AppInsuranceAudit/add.vue
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue";
|
||||||
|
import AiIdcardRemote from "@project/xumu/components/AiIdcardRemote.vue";
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "类别", prop: "category", dict: "category"},
|
||||||
|
{label: "品种", prop: "variety", dict: "variety"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "iaAdd",
|
||||||
|
components: {AiIdcardRemote, AiEartagPicker},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []},
|
||||||
|
columns,
|
||||||
|
companyList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
|
||||||
|
},
|
||||||
|
isAdd: v => !v.$route.query.id,
|
||||||
|
isEdit: v => v.$route.query.edit == 1,
|
||||||
|
isAudit: v => v.$route.hash == "#audit",
|
||||||
|
formImages: v => [
|
||||||
|
{label: "身份证(正面)", prop: "frontCard", rules: {required: v.isAdd, message: '请上传 身份证(正面)'}},
|
||||||
|
{label: "身份证(反面)", prop: "reverseCard", rules: {required: v.isAdd, message: '请上传 身份证(反面)'}},
|
||||||
|
{label: "营业执照", prop: "businessPic", rules: {required: v.isAdd, message: '请上传 营业执照'}},
|
||||||
|
{label: "畜禽经营许可证", prop: "breedPic", rules: {required: v.isAdd, message: '请上传 畜禽经营许可证'}},
|
||||||
|
{label: "动物防疫条件许可证", prop: "prevention", rules: {required: v.isAdd, message: '请上传 动物防疫条件许可证'}},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id ? this.instance.post("/api/insurance/apply/getInfo", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
detail.detailList = detail.detailList || []
|
||||||
|
let {farmPicture: picture = "{}"} = detail
|
||||||
|
picture = JSON.parse(picture)
|
||||||
|
return this.detail = {...detail, ...picture}
|
||||||
|
}
|
||||||
|
}) : Promise.resolve()
|
||||||
|
},
|
||||||
|
getCompanies() {
|
||||||
|
this.instance.post("/api/insurance/apply/getCompany").then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.companyList = res.data
|
||||||
|
this.$set(this.detail, "companyId", res.data?.[0]?.id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getProducts(id) {
|
||||||
|
const item = this.companyList.find(e => e.id == id)
|
||||||
|
return item?.children || []
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
const farmPicture = {}
|
||||||
|
this.formImages.forEach(e => {
|
||||||
|
const {prop} = e
|
||||||
|
const val = this.detail[prop]
|
||||||
|
if (val) {
|
||||||
|
farmPicture[prop] = val
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.detail.farmPicture = JSON.stringify(farmPicture)
|
||||||
|
this.instance.post("/api/insurance/apply/addOrEditOffline", this.detail).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAudit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/insurance/apply/audit", this.detail).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getRemoteInfo(userId) {
|
||||||
|
userId && this.instance.post("/api/siteUser/querySiteByUserId", null, {
|
||||||
|
params: {userId}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.$set(this.detail, "farmId", res.data?.[0]?.id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail().finally(() => this.getCompanies())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="iaAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="养殖户" class="row">
|
||||||
|
<ai-idcard-remote :instance="instance" @enter="getRemoteInfo"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖场" prop="farmId" :rules="{required:isAdd||isEdit,message:'请选择 养殖场'}">
|
||||||
|
<ai-select v-if="isAdd||isEdit" v-model="detail.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
<b v-else v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="承保公司" prop="companyId" :rules="{required:isAdd||isEdit,message:'请选择 承保公司'}">
|
||||||
|
<ai-select v-if="isAdd||isEdit" v-model="detail.companyId" :select-list="companyList" :prop="{label:'name'}" disabled/>
|
||||||
|
<b v-else v-text="detail.companyName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保险产品" prop="productType" :rules="{required:isAdd||isEdit,message:'请选择 保险产品'}">
|
||||||
|
<ai-select v-if="isAdd||isEdit" v-model="detail.productType" :select-list="getProducts(detail.companyId)" :prop="{label:'name',value:'productType'}"
|
||||||
|
@select="v=>$set(detail,'insureType',v.children[0].insureType)"/>
|
||||||
|
<b v-else v-text="detail.productType"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="投保类型">
|
||||||
|
<ai-input :value="dict.getLabel('insureType',detail.insureType)" placeholder="根据保险产品自动带出" :edit="isAdd||isEdit" readonly/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系人">
|
||||||
|
<ai-input v-model="detail.contacts" :edit="isAdd||isEdit"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系电话">
|
||||||
|
<ai-input v-model="detail.phone" :edit="isAdd||isEdit"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="投保对象">
|
||||||
|
<template #right v-if="isAdd">
|
||||||
|
<ai-eartag-picker @select="v=>detail.detailList=v" :instance="instance"
|
||||||
|
:action="`/api/insurance/apply/getEarNumberList?farmId=${detail.farmId}`">
|
||||||
|
<el-button type="text">选择</el-button>
|
||||||
|
</ai-eartag-picker>
|
||||||
|
</template>
|
||||||
|
<ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1" hideOptions/>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="证件信息">
|
||||||
|
<div class="grid c-5 el-form--label-top">
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-if="isAdd||isEdit" v-model="detail[img.prop]" :instance="instance" :limit="1" value-is-url/>
|
||||||
|
<el-image :src="detail[img.prop]" :preview-src-list="[detail[img.prop]]" v-else/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="审核信息" v-if="!(isAdd||isAudit)">
|
||||||
|
<el-form-item label="审核状态">{{ dict.getLabel('auditStatus', detail.auditStatus) }}</el-form-item>
|
||||||
|
<el-form-item label="保单资料" class="sc-4">
|
||||||
|
<el-image :src="detail.picture" :preview-src-list="[detail.picture]"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审核时间">{{ detail.auditTime }}</el-form-item>
|
||||||
|
<el-form-item label="审核人">{{ detail.auditName }}</el-form-item>
|
||||||
|
<el-form-item label="保单订单号">{{ detail.orderNo }}</el-form-item>
|
||||||
|
<el-form-item label="说明">{{ detail.remarks }}</el-form-item>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="保险资料" v-if="isAudit">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="保单订单号" prop="orderNo" :rules="{required:true,message:'请输入 保单订单号'}">
|
||||||
|
<ai-input v-model="detail.orderNo"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保单资料" class="sc-2">
|
||||||
|
<ai-uploader v-model="detail.picture" value-is-url :instance="instance" :limit="1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="说明">
|
||||||
|
<ai-input type="textarea" :rows="3" v-model="detail.remarks"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isAdd||isEdit">
|
||||||
|
<el-button type="primary" @click="submit">提交</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-if="isAudit" type="primary" @click="handleAudit">提交</el-button>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.iaAdd {
|
||||||
|
:deep(.el-form--label-top) {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
108
project/xumu/AppInsuranceAudit/list.vue
Normal file
108
project/xumu/AppInsuranceAudit/list.vue
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "投保单号", prop: "orderNo"},
|
||||||
|
{label: "所属养殖场", prop: "farmName"},
|
||||||
|
{label: "投保类型", prop: "insureType", dict: "insureType"},
|
||||||
|
{label: "承保公司", prop: "companyName"},
|
||||||
|
{label: "投保时间", prop: "createTime"},
|
||||||
|
{label: "投保状态", prop: "status", width: 160, dict: "insureStatus"},
|
||||||
|
{label: "审核状态", prop: "auditStatus", width: 120, dict: "auditStatus"},
|
||||||
|
{label: "申请人", prop: "applyName", width: 120},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "iaList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/insurance/apply/getAuditPage", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records.map(e => ({...e, permit: `${e.status}` + e.auditStatus}))
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="iaList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-input placeholder="投保订单号" v-model="search.orderNo"/>
|
||||||
|
<ai-select placeholder="全部投保类型" v-model="search.insureType" dict="insureType"/>
|
||||||
|
<ai-select placeholder="全部投保状态" v-model="search.status" dict="insureStatus"/>
|
||||||
|
<ai-select placeholder="全部审批状态" v-model="search.auditStatus" dict="auditStatus"/>
|
||||||
|
<ai-search label="投保日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="养殖户" v-model="search.userName"/>
|
||||||
|
<ai-input placeholder="养殖场" v-model="search.farmName"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">新增</el-button>
|
||||||
|
<ai-download :instance="instance" url="/api/insurance/apply/exportAudit" :params="{...search,...page}" :fileName="`投保审批导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<template v-if="['01'].includes(row.permit)">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#audit',query:{id:row.id}})">审批</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.id}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.iaList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppLoanApply/AppLoanApply.vue
Normal file
35
project/xumu/AppLoanApply/AppLoanApply.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppLoanApply",
|
||||||
|
label: "贷款申请",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return hash == "#add" ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "loanProduct", "loanStatus", "category", "variety")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppLoanApply">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppLoanApply {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
186
project/xumu/AppLoanApply/add.vue
Normal file
186
project/xumu/AppLoanApply/add.vue
Normal file
@@ -0,0 +1,186 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue";
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "类别", prop: "category", dict: "category"},
|
||||||
|
{label: "品种", prop: "variety", dict: "variety"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "loanAdd",
|
||||||
|
components: {AiEartagPicker},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: [], loanAmount: 0},
|
||||||
|
columns,
|
||||||
|
bankList: [],
|
||||||
|
filterText: ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
|
||||||
|
},
|
||||||
|
isAdd: v => !v.$route.query.id,
|
||||||
|
isEdit: v => v.$route.query.edit == 1,
|
||||||
|
formImages: v => [
|
||||||
|
{label: "身份证(正面)", prop: "frontCard", rules: {required: v.isAdd || v.isEdit, message: '请上传 身份证(正面)'}},
|
||||||
|
{label: "身份证(反面)", prop: "reverseCard", rules: {required: v.isAdd || v.isEdit, message: '请上传 身份证(反面)'}},
|
||||||
|
{label: "营业执照", prop: "businessPic", rules: {required: v.isAdd || v.isEdit, message: '请上传 营业执照'}},
|
||||||
|
{label: "畜禽经营许可证", prop: "breedPic", rules: {required: v.isAdd || v.isEdit, message: '请上传 畜禽经营许可证'}},
|
||||||
|
{label: "动物防疫条件许可证", prop: "prevention", rules: {required: v.isAdd || v.isEdit, message: '请上传 动物防疫条件许可证'}},
|
||||||
|
],
|
||||||
|
selectedEartags: v => v.detail.detailList?.length || 0,
|
||||||
|
tableData: v => v.detail.detailList?.filter(e => e.biochipEarNumber.indexOf(v.filterText) > -1) || [],
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/loan/apply/getInfo", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
detail.detailList = detail.detailList || []
|
||||||
|
let {farmPicture: picture = "{}"} = detail
|
||||||
|
picture = JSON.parse(picture)
|
||||||
|
return this.detail = {...detail, ...picture}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getBanks() {
|
||||||
|
this.instance.post("/api/loan/apply/getBank").then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.bankList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getProducts(id) {
|
||||||
|
const item = this.bankList.find(e => e.id == id)
|
||||||
|
return item?.children || []
|
||||||
|
},
|
||||||
|
submit(submitType) {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
const farmPicture = {}
|
||||||
|
this.formImages.forEach(e => {
|
||||||
|
const {prop} = e
|
||||||
|
const val = this.detail[prop]
|
||||||
|
if (val) {
|
||||||
|
farmPicture[prop] = val
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.detail.farmPicture = JSON.stringify(farmPicture)
|
||||||
|
this.instance.post("/api/loan/apply/addOrEdit", {...this.detail, submitType}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getBanks()
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="loanAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="养殖场" prop="farmId" :rules="{required: isAdd||isEdit,message:'请选择 养殖场'}">
|
||||||
|
<ai-select v-if="isAdd||isEdit" v-model="detail.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
<b v-else v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款银行" prop="bankId" :rules="{required: isAdd||isEdit,message:'请选择 贷款银行'}">
|
||||||
|
<ai-select v-if="isAdd||isEdit" v-model="detail.bankId" :select-list="bankList" :prop="{label:'name'}"/>
|
||||||
|
<b v-else v-text="detail.bankName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款产品" prop="productType" :rules="{required: isAdd||isEdit,message:'请选择 贷款产品'}">
|
||||||
|
<ai-select v-if="isAdd||isEdit" v-model="detail.productType"
|
||||||
|
:select-list="getProducts(detail.bankId)" :prop="{label:'name',value:'productType'}"/>
|
||||||
|
<b v-else v-text="dict.getLabel('loanProduct',detail.productType)"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预期贷款额(万)" prop="loanAmount" :rules="{required: isAdd||isEdit,message:'请输入 预期贷款额'}">
|
||||||
|
<ai-input v-model.number="detail.loanAmount" :edit="isAdd||isEdit"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系人" prop="contacts" :rules="{required: isAdd||isEdit,message:'请输入 联系人'}">
|
||||||
|
<ai-input v-model="detail.contacts" :edit="isAdd||isEdit"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系电话" prop="phone" :rules="{required: isAdd||isEdit,message:'请输入 联系电话'}">
|
||||||
|
<ai-input v-model="detail.phone" :edit="isAdd||isEdit"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="质押标的">
|
||||||
|
<template #right>
|
||||||
|
<ai-input placeholder="请输入/扫描耳标号" v-model="filterText" class="shrink"/>
|
||||||
|
<ai-eartag-picker @select="v=>detail.detailList=v" :instance="instance" v-if="isAdd||isEdit" value-key="biochipEarNumber"
|
||||||
|
:action="`/api/insurance/apply/getEarNumberList?farmId=${detail.farmId}`">
|
||||||
|
<el-button type="text">选择</el-button>
|
||||||
|
</ai-eartag-picker>
|
||||||
|
</template>
|
||||||
|
<ai-highlight class="mar-b8 font-14" :content="`拟抵押标的选择 @v 只`" color="red" :value="selectedEartags"/>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :isShowPagination="!1" hideOptions/>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="证件信息">
|
||||||
|
<div v-if="isAdd||isEdit" class="font-12 color-888">只能上传JPG/PNG文件,且不超过2M</div>
|
||||||
|
<div class="grid c-5 el-form--label-top">
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-if="isAdd||isEdit" v-model="detail[img.prop]" :instance="instance" :limit="1" value-is-url/>
|
||||||
|
<el-image :src="detail[img.prop]" :preview-src-list="[detail[img.prop]]" v-else/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="审核信息" v-if="!(isAdd||isEdit)">
|
||||||
|
<el-form-item label="审核状态">{{ dict.getLabel('auditStatus', detail.auditStatus) }}</el-form-item>
|
||||||
|
<el-form-item label="审核时间">{{ detail.auditTime }}</el-form-item>
|
||||||
|
<el-form-item label="审核人">{{ detail.auditName }}</el-form-item>
|
||||||
|
<el-form-item label="贷款合同号">{{ detail.contractNo || "-" }}</el-form-item>
|
||||||
|
<el-form-item label="贷款资料">
|
||||||
|
<el-image :src="detail.picture" :preview-src-list="[detail.picture]"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="说明">{{ detail.remarks }}</el-form-item>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isAdd||isEdit">
|
||||||
|
<el-button type="primary" @click="submit(1)">保存草稿</el-button>
|
||||||
|
<el-button type="primary" @click="submit(2)">保存并提交</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.loanAdd {
|
||||||
|
:deep(.el-form--label-top) {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.shrink {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
118
project/xumu/AppLoanApply/list.vue
Normal file
118
project/xumu/AppLoanApply/list.vue
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "贷款合同号", prop: "contractNo"},
|
||||||
|
{label: "所属养殖户", prop: "applyName"},
|
||||||
|
{label: "所属养殖场", prop: "farmName"},
|
||||||
|
{label: "贷款金额(万元)", prop: "loanAmount"},
|
||||||
|
{label: "贷款状态", prop: "status", width: 160, dict: "loanStatus"},
|
||||||
|
{label: "审核状态", prop: "auditStatus", width: 120, dict: "auditStatus"},
|
||||||
|
{label: "贷款时间", prop: "createTime", width: 160},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "loanList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/loan/apply/page", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records.map(e => ({...e, permit: `${e.status}` + e.auditStatus}))
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
this.$confirm("确定删除该条数据?").then(() => {
|
||||||
|
this.instance.post("/api/loan/apply/del", null, {
|
||||||
|
params: {id}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="loanList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-input placeholder="贷款合同号" v-model="search.contractNo"/>
|
||||||
|
<ai-select placeholder="全部贷款状态" v-model="search.status" dict="loanStatus"/>
|
||||||
|
<ai-select placeholder="全部审批状态" v-model="search.auditStatus" dict="auditStatus"/>
|
||||||
|
<ai-search label="贷款日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="养殖户" v-model="search.applyName"/>
|
||||||
|
<ai-input placeholder="养殖场" v-model="search.farmName"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">新增</el-button>
|
||||||
|
<ai-download :instance="instance" url="/api/loan/apply/export" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<template v-if="['00','03'].includes(row.permit)">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#add',query:{id:row.id,edit:1}})">编辑</el-button>
|
||||||
|
<el-button type="text" @click="handleDelete(row.id)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.id}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.loanList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppLoanAudit/AppLoanAudit.vue
Normal file
35
project/xumu/AppLoanAudit/AppLoanAudit.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppLoanAudit",
|
||||||
|
label: "贷款审核",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return ["#audit", "#add"].includes(hash) ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "loanProduct", "loanStatus", "category", "variety")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppLoanAudit">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppLoanAudit {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
244
project/xumu/AppLoanAudit/add.vue
Normal file
244
project/xumu/AppLoanAudit/add.vue
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue";
|
||||||
|
import AiIdcardRemote from "@project/xumu/components/AiIdcardRemote.vue";
|
||||||
|
|
||||||
|
const records = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "报案号", prop: "reportNo"},
|
||||||
|
{label: "审批状态", prop: "auditStatus", dict: "auditStatus"},
|
||||||
|
{label: "审批时间", prop: "auditTime"},
|
||||||
|
{label: "审批人", prop: "auditName"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "loanAdd",
|
||||||
|
components: {AiIdcardRemote, AiEartagPicker},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []},
|
||||||
|
records,
|
||||||
|
filterText: "",
|
||||||
|
bankList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.isAdd ? `新增${appName}` : v.isAudit ? `${appName}审批` : `${appName}详情`
|
||||||
|
},
|
||||||
|
isAdd: v => !v.$route.query.id,
|
||||||
|
isAudit: v => v.$route.hash == "#audit",
|
||||||
|
formImages: v => [
|
||||||
|
{label: "身份证(正面)", prop: "frontCard", rules: {required: v.isAdd, message: '请上传 身份证(正面)'}},
|
||||||
|
{label: "身份证(反面)", prop: "reverseCard", rules: {required: v.isAdd, message: '请上传 身份证(反面)'}},
|
||||||
|
{label: "营业执照", prop: "businessPic", rules: {required: v.isAdd, message: '请上传 营业执照'}},
|
||||||
|
{label: "畜禽经营许可证", prop: "breedPic", rules: {required: v.isAdd, message: '请上传 畜禽经营许可证'}},
|
||||||
|
{label: "动物防疫条件许可证", prop: "prevention", rules: {required: v.isAdd, message: '请上传 动物防疫条件许可证'}},
|
||||||
|
],
|
||||||
|
columns: v => [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "类别", prop: "category", dict: "category"},
|
||||||
|
{label: "品种", prop: "variety", dict: "variety"}
|
||||||
|
].filter(e => !e.hide),
|
||||||
|
selectedEartags: v => v.detail.detailList?.length || 0,
|
||||||
|
tableData: v => v.detail.detailList?.filter(e => e.biochipEarNumber.indexOf(v.filterText) > -1) || [],
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id ? this.instance.post("/api/loan/apply/getInfo", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
detail.detailList = detail.detailList || []
|
||||||
|
let {farmPicture: picture} = detail
|
||||||
|
picture = JSON.parse(picture || "{}")
|
||||||
|
return this.detail = {...detail, ...picture}
|
||||||
|
}
|
||||||
|
}) : Promise.resolve()
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
const farmPicture = {}
|
||||||
|
this.formImages.forEach(e => {
|
||||||
|
const {prop} = e
|
||||||
|
const val = this.detail[prop]
|
||||||
|
if (val) {
|
||||||
|
farmPicture[prop] = val
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.detail.farmPicture = JSON.stringify(farmPicture)
|
||||||
|
this.instance.post("/api/loan/apply/addOrEditOffline", {...this.detail}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
audit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/loan/apply/audit", {...this.detail}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getBanks() {
|
||||||
|
this.instance.post("/api/loan/apply/getBank").then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.bankList = res.data
|
||||||
|
this.$set(this.detail, "bankId", res.data?.[0]?.id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getProducts(id) {
|
||||||
|
const item = this.bankList.find(e => e.id == id)
|
||||||
|
return item?.children || []
|
||||||
|
},
|
||||||
|
getRemoteInfo(userId) {
|
||||||
|
userId && this.instance.post("/api/siteUser/querySiteByUserId", null, {
|
||||||
|
params: {userId}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.$set(this.detail, "farmId", res.data?.[0]?.id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail().finally(() => this.getBanks())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="loanAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="养殖户" class="row">
|
||||||
|
<ai-idcard-remote :instance="instance" @enter="getRemoteInfo"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖场" prop="farmId" :rules="{required: isAdd,message:'请选择 养殖场'}">
|
||||||
|
<ai-select v-if="isAdd" v-model="detail.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
<b v-else v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款银行" prop="bankId" :rules="{required: isAdd,message:'请选择 贷款银行'}">
|
||||||
|
<ai-select v-if="isAdd" v-model="detail.bankId" :select-list="bankList" :prop="{label:'name'}" disabled/>
|
||||||
|
<b v-else v-text="detail.bankName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款产品" prop="productType" :rules="{required: isAdd,message:'请选择 贷款产品'}">
|
||||||
|
<ai-select v-if="isAdd" v-model="detail.productType"
|
||||||
|
:select-list="getProducts(detail.bankId)" :prop="{label:'name',value:'productType'}"/>
|
||||||
|
<b v-else v-text="dict.getLabel('loanProduct',detail.productType)"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预期贷款额(万)" prop="loanAmount" :rules="{required: isAdd,message:'请输入 预期贷款额'}">
|
||||||
|
<ai-input v-model.number="detail.loanAmount" :edit="isAdd"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系人" prop="contacts" :rules="{required: isAdd,message:'请输入 联系人'}">
|
||||||
|
<ai-input v-model="detail.contacts" :edit="isAdd"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系电话" prop="phone" :rules="{required: isAdd,message:'请输入 联系电话'}">
|
||||||
|
<ai-input v-model="detail.phone" :edit="isAdd"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="质押标的">
|
||||||
|
<template #right>
|
||||||
|
<ai-input placeholder="请输入/扫描耳标号" v-model="filterText" class="shrink"/>
|
||||||
|
<ai-eartag-picker @select="v=>detail.detailList=v" :instance="instance" v-if="isAdd"
|
||||||
|
:action="`/api/insurance/apply/getEarNumberList?farmId=${detail.farmId}`">
|
||||||
|
<el-button type="text">选择</el-button>
|
||||||
|
</ai-eartag-picker>
|
||||||
|
</template>
|
||||||
|
<ai-highlight class="mar-b8 font-14" :content="`拟抵押标的选择 @v 只`" color="red" :value="selectedEartags"/>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :isShowPagination="!1" hideOptions/>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="证件信息">
|
||||||
|
<div v-if="isAdd" class="font-12 color-888">只能上传JPG/PNG文件,且不超过2M</div>
|
||||||
|
<div class="grid c-5 el-form--label-top">
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader :readonly="!isAdd" v-model="detail[img.prop]" :instance="instance" :limit="1" value-is-url/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="银行资料" v-if="isAdd">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="贷款合同号" prop="contractNo" :rules="{required:true,message:'请输入贷款合同号'}">
|
||||||
|
<ai-input v-model="detail.contractNo"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款资料" class="sc-2">
|
||||||
|
<ai-uploader v-model="detail.picture" value-is-url :instance="instance" :limit="1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="说明">
|
||||||
|
<ai-input type="textarea" :rows="3" v-model="detail.remarks"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="审核信息" v-if="!isAdd">
|
||||||
|
<div class="grid">
|
||||||
|
<template v-if="isAudit">
|
||||||
|
<el-form-item label="审批状态" prop="auditStatus" :rules="{required:true,message:'请选择审批状态'}">
|
||||||
|
<ai-select v-model="detail.auditStatus" dict="auditStatus"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款资料" class="sc-3">
|
||||||
|
<ai-uploader v-model="detail.picture" value-is-url :instance="instance" :limit="1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款合同号" prop="contractNo" :rules="{required:true,message:'请输入 报案号'}">
|
||||||
|
<ai-input v-model="detail.contractNo"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="说明">
|
||||||
|
<ai-input type="textarea" :rows="3" v-model="detail.remarks"/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-form-item label="审核状态">{{ dict.getLabel('auditStatus', detail.auditStatus) }}</el-form-item>
|
||||||
|
<el-form-item label="贷款合同号">{{ detail.contractNo }}</el-form-item>
|
||||||
|
<el-form-item label="审核时间">{{ detail.auditTime }}</el-form-item>
|
||||||
|
<el-form-item label="贷款资料" class="sc-3">
|
||||||
|
<el-image :src="detail.picture" :preview-src-list="[detail.picture]"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审核人">{{ detail.auditName }}</el-form-item>
|
||||||
|
<el-form-item label="说明">{{ detail.remarks }}</el-form-item>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button v-if="isAdd" type="primary" @click="submit">提交</el-button>
|
||||||
|
<el-button v-if="isAudit" type="primary" @click="audit">提交</el-button>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.loanAdd {
|
||||||
|
:deep(.el-form--label-top) {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.shrink {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
108
project/xumu/AppLoanAudit/list.vue
Normal file
108
project/xumu/AppLoanAudit/list.vue
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "贷款合同号", prop: "contractNo"},
|
||||||
|
{label: "所属养殖户", prop: "applyName"},
|
||||||
|
{label: "所属养殖场", prop: "farmName"},
|
||||||
|
{label: "贷款银行", prop: "bankName"},
|
||||||
|
{label: "贷款产品", prop: "productType", dict: "loanProduct"},
|
||||||
|
{label: "贷款时间", prop: "createTime", width: 160},
|
||||||
|
{label: "贷款状态", prop: "status", dict: "loanStatus", width: 100},
|
||||||
|
{label: "审批状态", prop: "auditStatus", dict: "auditStatus", width: 100},
|
||||||
|
{label: "审批人", prop: "auditName"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "loanList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/loan/apply/getAuditPage", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records.map(e => ({...e, permit: `${e.status}` + e.auditStatus}))
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="loanList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-input placeholder="贷款合同号" v-model="search.contractNo"/>
|
||||||
|
<ai-select placeholder="全部贷款状态" v-model="search.status" dict="loanStatus"/>
|
||||||
|
<ai-select placeholder="全部审批状态" v-model="search.auditStatus" dict="auditStatus"/>
|
||||||
|
<ai-search label="贷款日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="养殖户" v-model="search.applyName"/>
|
||||||
|
<ai-input placeholder="养殖场" v-model="search.farmName"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">新增</el-button>
|
||||||
|
<ai-download :instance="instance" url="/api/loan/apply/exportAudit" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<template v-if="['1'].includes(row.auditStatus)">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#audit',query:{id:row.id}})">审核</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.id}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.loanList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppOutAudit/AppOutAudit.vue
Normal file
35
project/xumu/AppOutAudit/AppOutAudit.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppOutAudit",
|
||||||
|
label: "淘汰审核",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return ["#audit", "#add"].includes(hash) ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus","outReason", "category", "variety")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppOutAudit">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppOutAudit {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
155
project/xumu/AppOutAudit/add.vue
Normal file
155
project/xumu/AppOutAudit/add.vue
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "oaAdd",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.isAudit ? `${appName}审批` : `${appName}详情`
|
||||||
|
},
|
||||||
|
isAudit: v => v.$route.hash == "#audit",
|
||||||
|
formImages: v => [
|
||||||
|
{label: "身长测量照片", prop: "heightPic"},
|
||||||
|
{label: "生物芯片照片", prop: "biochipPic"},
|
||||||
|
{label: "防疫耳标照片", prop: "preventionPic"},
|
||||||
|
{label: "其他说明照片", prop: "otherPic"},
|
||||||
|
],
|
||||||
|
columns: v => [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "身长测量照片", prop: "heightPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "电子耳标照片", prop: "earNumberPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "防疫耳标照片", prop: "preventionPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
].filter(e => !e.hide),
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/breed/out/getAuditInfo", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/breed/out/audit", {...this.detail}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="oaAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid c-4">
|
||||||
|
<el-form-item label="生物芯片耳标号" class="row">
|
||||||
|
<b v-text="detail.biochipEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖场" prop="farmId">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId">
|
||||||
|
<b v-text="detail.houseName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId">
|
||||||
|
<b v-text="detail.penName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电子耳标号" prop="electronicEarNumber">
|
||||||
|
<b v-text="detail.electronicEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="原厂耳标号" prop="category">
|
||||||
|
<b v-text="detail.originalEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别" prop="category">
|
||||||
|
<b v-text="detail.category"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品种" prop="variety">
|
||||||
|
<b v-text="detail.variety"/>
|
||||||
|
</el-form-item>
|
||||||
|
<div class="row flex">
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-model="detail[img.prop]" value-is-url readonly/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="淘汰信息">
|
||||||
|
<el-form-item label="淘汰原因">
|
||||||
|
<b v-text="dict.getLabel('outReason',detail.reason)"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="淘汰时间">
|
||||||
|
<b v-text="detail.outTime"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<b v-text="detail.remark"/>
|
||||||
|
</el-form-item>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="审核信息">
|
||||||
|
<div class="grid">
|
||||||
|
<template v-if="isAudit">
|
||||||
|
<el-form-item label="审批状态" prop="auditStatus" :rules="{required:true,message:'请选择审批状态'}">
|
||||||
|
<ai-select v-model="detail.auditStatus" dict="auditStatus"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="意见">
|
||||||
|
<ai-input type="textarea" :rows="3" v-model="detail.remark"/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-form-item label="审核状态">{{ dict.getLabel('auditStatus', detail.auditStatus) }}</el-form-item>
|
||||||
|
<el-form-item label="审核时间">{{ detail.auditTime }}</el-form-item>
|
||||||
|
<el-form-item label="审核人">{{ detail.auditName }}</el-form-item>
|
||||||
|
<el-form-item label="意见">{{ detail.remarks }}</el-form-item>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isAudit">
|
||||||
|
<el-button type="primary" @click="submit">提交</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.oaAdd {
|
||||||
|
:deep(.el-form--label-top) {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
112
project/xumu/AppOutAudit/list.vue
Normal file
112
project/xumu/AppOutAudit/list.vue
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "养殖场", prop: "userName", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "类别", prop: "category", dict: "category", width: 120},
|
||||||
|
{label: "品种", prop: "variety", dict: "variety", width: 120},
|
||||||
|
{label: "日龄(天)", prop: "age", width: 80},
|
||||||
|
{label: "淘汰时间", prop: "outTime"},
|
||||||
|
{label: "淘汰原因", prop: "reason", width: 80},
|
||||||
|
{label: "登记时间", prop: "createTime"},
|
||||||
|
{label: "操作人", prop: "userName", width: 100},
|
||||||
|
{label: "审核状态", prop: "auditStatus", dict: "auditStatus", width: 80},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "oaList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/breed/out/getAuditPage", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records.map(e => ({...e, permit: `${e.status}` + e.auditStatus}))
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="oaList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-select placeholder="全部养殖场" v-model="search.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖舍" v-model="search.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.farmId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖栏" v-model="search.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.houseId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部审核状态" v-model="search.auditStatus" dict="auditStatus"/>
|
||||||
|
<ai-search label="淘汰日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.outBeginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.outEndDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-search label="登记日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="原场耳标号" v-model="search.originalEarNumber"/>
|
||||||
|
<ai-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber"/>
|
||||||
|
<ai-input placeholder="电子耳标号" v-model="search.electronicEarNumber"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-download :instance="instance" url="/api/breed/out/exportAudit" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<template v-if="['1'].includes(row.auditStatus)">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#audit',query:{id:row.id}})">审核</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.id}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.oaList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppOutManage/AppOutManage.vue
Normal file
35
project/xumu/AppOutManage/AppOutManage.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppOutManage",
|
||||||
|
label: "淘汰登记",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return hash == "#add" ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppOutManage">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppOutManage {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
170
project/xumu/AppOutManage/add.vue
Normal file
170
project/xumu/AppOutManage/add.vue
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagRemote from "@project/xumu/components/AiEartagRemote.vue";
|
||||||
|
|
||||||
|
const formImages = [
|
||||||
|
{label: "身长测量照片", prop: "heightPic",},
|
||||||
|
{label: "生物芯片照片", prop: "biochipPic",},
|
||||||
|
{label: "防疫耳标照片", prop: "preventionPic",},
|
||||||
|
{label: "其他说明照片", prop: "otherPic",},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "outAdd",
|
||||||
|
components: {AiEartagRemote},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formImages,
|
||||||
|
filter: "",
|
||||||
|
detail: {},
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
isAdd: v => !v.$route.query.id,
|
||||||
|
isEdit: v => v.$route.query.edit == 1,
|
||||||
|
isAuthing: v => v.detail.auditStatus == 1,
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail(id) {
|
||||||
|
return id && this.instance.post("/api/breed/out/page", {biochipEarNumber: id}).then(res => {
|
||||||
|
if (res?.data?.records) {
|
||||||
|
const detail = res.data.records[0] || {}
|
||||||
|
if (detail.picture) {
|
||||||
|
Object.entries(JSON.parse(detail.picture)).forEach(([key, value]) => {
|
||||||
|
detail[key] = value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
const {biochipEarNumber, id, outTime, heightPic, biochipPic, preventionPic, otherPic, reason, remarks} = this.detail
|
||||||
|
this.instance.post("/api/breed/out/addOrEdit", {
|
||||||
|
biochipEarNumber, id, outTime, picture: JSON.stringify({heightPic, biochipPic, preventionPic, otherPic}), reason, remarks
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0 && res?.data != 1) {
|
||||||
|
this.$confirm("是否返回列表页?", "提交成功").then(() => this.back()).catch(() => this.getDetail(biochipEarNumber))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAudit() {
|
||||||
|
this.$refs.form.validate().then(() => {
|
||||||
|
const {id} = this.detail
|
||||||
|
this.instance.post("/api/breed/out/audit", null, {params: {id, ...this.form}}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$message.success("操作成功")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handlerAutocomplete(value) {
|
||||||
|
'biochipEarNumber|farmId|houseId|penId|electronicEarNumber|originalEarNumber|category|variety'.split("|").forEach(prop => this.$set(this.detail, prop, value[prop]))
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("yesOrNo", "category", "variety", "outReason")
|
||||||
|
this.getDetail(this.$route.query.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="outAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid c-4">
|
||||||
|
<ai-eartag-remote :instance="instance" @enter="handlerAutocomplete" class="row"/>
|
||||||
|
<el-form-item label="生物芯片耳标号">
|
||||||
|
<b v-text="detail.biochipEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖场" prop="farmId">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId">
|
||||||
|
<b v-text="detail.houseName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId">
|
||||||
|
<b v-text="detail.penName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电子耳标号" prop="electronicEarNumber">
|
||||||
|
<b v-text="detail.electronicEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="原厂耳标号" prop="originalEarNumber">
|
||||||
|
<b v-text="detail.originalEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别" prop="category">
|
||||||
|
<b v-text="detail.category"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品种" prop="variety">
|
||||||
|
<b v-text="detail.variety"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="上传照片">
|
||||||
|
<div class="grid c-4">
|
||||||
|
<el-form-item v-for="(img, i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-if="isAdd || isEdit" v-model="detail[img.prop]" :instance="instance" :limit="1" value-is-url/>
|
||||||
|
<el-image :src="detail[img.prop]" :preview-src-list="[detail[img.prop]]" v-else/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="淘汰录入">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="淘汰日期" prop="outTime" :rules="[{ required: true, message: '请选择淘汰日期' }]">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-if="isAdd || isEdit" v-model="detail.outTime"/>
|
||||||
|
<b v-else v-text="detail.outTime"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="淘汰原因" prop="reason" :rules="[{ required: true, message: '请选择淘汰原因' }]">
|
||||||
|
<ai-select v-if="isAdd || isEdit" v-model="detail.reason" dict="outReason"/>
|
||||||
|
<b v-else v-text="detail.reason"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark" class="row">
|
||||||
|
<ai-input type="textarea" :row="3" v-model="detail.remark" :edit="isAdd || isEdit"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="审批信息" v-if="isAuthing">
|
||||||
|
<el-form :model="form" size="small" ref="form" label-width="120px">
|
||||||
|
<el-form-item label="是否同意" prop="auditStatus" :rules="[{ required: true, message: '请选择是否同意' }]">
|
||||||
|
<ai-select v-model="form.auditStatus"
|
||||||
|
:select-list="[{ dictValue: 2, dictName: '同意' }, { dictValue: 3, dictName: '不同意' }]"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审批意见" prop="auditReason">
|
||||||
|
<el-input type="textarea" :row="3" v-model="form.auditReason" clearable placeholder="请输入"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button type="primary" @click="submit" v-if="isAdd || isEdit">提交</el-button>
|
||||||
|
<el-button type="primary" @click="handleAudit" v-if="isAuthing">提交</el-button>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.outAdd {
|
||||||
|
.el-date-editor {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
143
project/xumu/AppOutManage/list.vue
Normal file
143
project/xumu/AppOutManage/list.vue
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "养殖场", prop: "userName", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "类别", prop: "category", dict: "category", width: 120},
|
||||||
|
{label: "品种", prop: "variety", dict: "variety", width: 120},
|
||||||
|
{label: "日龄(天)", prop: "age", width: 80},
|
||||||
|
{label: "淘汰时间", prop: "outTime"},
|
||||||
|
{label: "淘汰原因", prop: "reason", width: 80},
|
||||||
|
{label: "登记时间", prop: "createTime"},
|
||||||
|
{label: "操作人", prop: "userName", width: 100},
|
||||||
|
{label: "审核状态", prop: "auditStatus", dict: "auditStatus", width: 80},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "outList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/breed/out/page", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
this.$confirm("确定删除该条数据?").then(() => {
|
||||||
|
this.instance.post("/api/breed/weight/del", null, {
|
||||||
|
params: {id}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAuditAgain(id) {
|
||||||
|
this.$confirm("是否要再次提交审批?").then(() => {
|
||||||
|
this.instance.post("/api/breed/out/audit", null, {
|
||||||
|
params: {id, auditStatus: 1}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功")
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "category", "variety")
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="outList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-select placeholder="全部养殖场" v-model="search.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖舍" v-model="search.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.farmId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖栏" v-model="search.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.houseId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部审核状态" v-model="search.auditStatus" dict="auditStatus"/>
|
||||||
|
<ai-search label="淘汰日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.outBeginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.outEndDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-search label="登记日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="原场耳标号" v-model="search.originalEarNumber"/>
|
||||||
|
<ai-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber"/>
|
||||||
|
<ai-input placeholder="电子耳标号" v-model="search.electronicEarNumber"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">新增</el-button>
|
||||||
|
<ai-download :instance="instance" url="/api/breed/out/export" :params="{...search,...page}" :fileName="`淘汰导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
|
||||||
|
<el-button v-if="row.auditStatus==1" type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber}})">查看</el-button>
|
||||||
|
<template v-else>
|
||||||
|
<el-button v-if="row.auditStatus==2" type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber}})">查看</el-button>
|
||||||
|
<el-button v-if="row.auditStatus==2" type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber,edit:1}})">编辑</el-button>
|
||||||
|
<el-button v-if="row.auditStatus==3" type="text" @click="handleAuditAgain(row.id)">再次提交</el-button>
|
||||||
|
<el-button type="text" @click="handleDelete(row.id)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.outList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
407
project/xumu/AppRoleRightsManager/AppRoleRightsManager.vue
Normal file
407
project/xumu/AppRoleRightsManager/AppRoleRightsManager.vue
Normal file
@@ -0,0 +1,407 @@
|
|||||||
|
<template>
|
||||||
|
<section class="AppRoleRightsManager">
|
||||||
|
<ai-list v-if="!showDetail">
|
||||||
|
<ai-title slot="title" title="角色管理" isShowBottomBorder/>
|
||||||
|
<template #content>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button size="small" type="primary" icon="iconfont iconAdd"
|
||||||
|
@click="$router.push({hash:'#add'})"
|
||||||
|
v-if="$permissions('admin_sysapprole_add')">
|
||||||
|
添加
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
icon="iconfont iconDelete"
|
||||||
|
:disabled="!multipleSelection.length"
|
||||||
|
class="del-btn-list"
|
||||||
|
@click="deleteApp('all')"
|
||||||
|
v-if="$permissions('admin_sysapprole_del')"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<el-input
|
||||||
|
size="small"
|
||||||
|
v-model="search.roleName"
|
||||||
|
placeholder="角色名称"
|
||||||
|
clearable
|
||||||
|
@change="searchList()"
|
||||||
|
suffix-icon="iconfont iconSearch"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="adminList" :colConfigs="colConfigs" :total="total" :current.sync="page.pageNum"
|
||||||
|
:size.sync="page.pageSize"
|
||||||
|
@getList="getTableData" :col-configs="colConfigs" :dict="dict"
|
||||||
|
@selection-change="v=>multipleSelection=v">
|
||||||
|
<el-table-column label="角色用户" slot="users" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="font-12 flex wrap gap-6">
|
||||||
|
<el-tag size="mini" v-for="(item, i) in row.users" :key="i">{{ item.name }}
|
||||||
|
<template v-if="item.phone">({{ item.phone }})</template>
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<el-button type="text" @click="beforeCopy(row)" v-if="$permissions('admin_sysapprole_edit')">复制
|
||||||
|
</el-button>
|
||||||
|
<el-button type="text" @click="viewApp(row)" v-if="$permissions('admin_sysapprole_detail')">详情
|
||||||
|
</el-button>
|
||||||
|
<el-button type="text" @click="openRightsGraph(row)" v-if="$permissions('admin_sysapprole_detail')">关系图
|
||||||
|
</el-button>
|
||||||
|
<el-button type="text" @click="toAddAppRole(row)" v-if="$permissions('admin_sysapprole_edit')">编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button type="text" @click="deleteApp(row)" v-if="$permissions('admin_sysapprole_del')">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
<ai-dialog
|
||||||
|
title="应用角色详情"
|
||||||
|
:visible.sync="viewShow"
|
||||||
|
width="600px"
|
||||||
|
customFooter>
|
||||||
|
<ai-card title="基本信息">
|
||||||
|
<template #content>
|
||||||
|
<ai-wrapper>
|
||||||
|
<ai-info-item label="应用角色名称" :value="viewInfo.name" isLine/>
|
||||||
|
</ai-wrapper>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="权限信息">
|
||||||
|
<template #content>
|
||||||
|
<div style="margin-bottom: 16px" v-text="roleList.map(e => e.name).join('、')"/>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="角色账号">
|
||||||
|
<template #right>
|
||||||
|
<span style="text-align: right; color: #999">
|
||||||
|
共<span style="color: #26f" v-text="userList.length"/>个账号
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #content>
|
||||||
|
<div class="datail-table-body" v-if="userList.length">
|
||||||
|
<div class="datail-item" v-for="(item, index) in userList" :key="index">
|
||||||
|
<span class="item-name">{{ item.name }}</span>
|
||||||
|
<span style="color: #999">{{ item.phone }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
<template #footer>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="toAddAppRole(viewInfo)"
|
||||||
|
v-if="$permissions('admin_sysapprole_edit')"
|
||||||
|
>编辑角色
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</ai-dialog>
|
||||||
|
<ai-dialog title="权限关系图" :visible.sync="rightsGraph" class="rightsGraphDialog" customFooter>
|
||||||
|
<rights-graph :instance="instance" :dict="dict" :app="selectApp"/>
|
||||||
|
<el-button slot="footer" @click="rightsGraph=false">关闭</el-button>
|
||||||
|
</ai-dialog>
|
||||||
|
<!--复制角色-->
|
||||||
|
<el-dialog
|
||||||
|
class="editStyle"
|
||||||
|
:visible.sync="copyDialog"
|
||||||
|
width="520px"
|
||||||
|
@close="dataInit()"
|
||||||
|
title="复制角色">
|
||||||
|
<el-form :model="form" label-width="80px">
|
||||||
|
<el-form-item label="角色名" :rules="[{ required: true, message: '', trigger: 'blur' }]">
|
||||||
|
<el-input
|
||||||
|
v-model="editName"
|
||||||
|
placeholder="请输入..."
|
||||||
|
size="small"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" style="text-align: center">
|
||||||
|
<el-button
|
||||||
|
style="width: 92px"
|
||||||
|
size="small"
|
||||||
|
@click="copyDialog = false"
|
||||||
|
>取消
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
style="width: 92px"
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
@click="copyFn()"
|
||||||
|
:disabled="!editName"
|
||||||
|
>
|
||||||
|
确认
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
</ai-list>
|
||||||
|
<rights-add v-else :instance="instance" :dict="dict" :permissions="permissions"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import RightsAdd from "./rightsAdd";
|
||||||
|
import RightsGraph from "./rightsGraph";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppRoleRightsManager",
|
||||||
|
components: {RightsGraph, RightsAdd},
|
||||||
|
label: "角色管理",
|
||||||
|
provide() {
|
||||||
|
return {
|
||||||
|
top: this
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function,
|
||||||
|
actions: {
|
||||||
|
default: () => ({
|
||||||
|
list: '/admin/role/page',
|
||||||
|
apps: '/admin/role/list-all',
|
||||||
|
delete: '/admin/role/del',
|
||||||
|
detail: '/admin/role/queryById-checked',
|
||||||
|
modify: '/admin/role/modify',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
colConfigs() {
|
||||||
|
return [
|
||||||
|
{type: "selection"},
|
||||||
|
{label: "角色名", prop: "name", width: 140},
|
||||||
|
{label: "所属端", prop: "type", width: '100px', dict: "roleType"},
|
||||||
|
{label: "用户数量", prop: "roleCount", align: 'center', width: '80px'},
|
||||||
|
{slot: "users"},
|
||||||
|
{slot: "options"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
showDetail() {
|
||||||
|
return this.$route.hash == "#add"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
page: {pageNum: 1, pageSize: 10},
|
||||||
|
search: {roleName: ''},
|
||||||
|
adminList: [], //列表数据
|
||||||
|
total: 0,
|
||||||
|
multipleSelection: [],
|
||||||
|
delShow: false,
|
||||||
|
delParams: "",
|
||||||
|
delIds: [],
|
||||||
|
viewShow: false,
|
||||||
|
viewInfo: {},
|
||||||
|
roleList: [], //详情权限列表
|
||||||
|
row: {},
|
||||||
|
copyDialog: false,
|
||||||
|
titleDel: "",
|
||||||
|
form: {},
|
||||||
|
editName: "",
|
||||||
|
userList: [],
|
||||||
|
rightsGraph: false,
|
||||||
|
selectApp: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData();
|
||||||
|
this.dict.load('roleType')
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//查询table列表
|
||||||
|
getTableData() {
|
||||||
|
this.adminList = [];
|
||||||
|
this.instance.post(this.actions.list, null, {
|
||||||
|
params: {...this.page, ...this.search}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.total = res.data.total;
|
||||||
|
this.adminList = res.data.records;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//查询
|
||||||
|
searchList() {
|
||||||
|
this.page.pageNum = 1;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
//添加按钮
|
||||||
|
toAddAppRole(item) {
|
||||||
|
this.$router.push({
|
||||||
|
hash: "#add",
|
||||||
|
query: {
|
||||||
|
id: item.id,
|
||||||
|
name: item.name,
|
||||||
|
type: item.type,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//删除
|
||||||
|
deleteApp(e) {
|
||||||
|
if (e == "all") {
|
||||||
|
this.multipleSelection.map((item) => {
|
||||||
|
this.delIds.push(item.id);
|
||||||
|
});
|
||||||
|
this.delParams = `ids=${this.delIds}`;
|
||||||
|
this.titleDel = "确定要执行删除操作吗?";
|
||||||
|
} else {
|
||||||
|
this.delParams = `ids=${e.id}`;
|
||||||
|
this.titleDel = "确定需要删除该角色吗?";
|
||||||
|
}
|
||||||
|
this.$confirm(this.titleDel, {
|
||||||
|
type: "error",
|
||||||
|
}).then(() => {
|
||||||
|
this.instance.post(`${this.actions.delete}?${this.delParams}`).then(res => {
|
||||||
|
if (res?.msg == "success") {
|
||||||
|
this.getTableData();
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).catch(() => 0);
|
||||||
|
},
|
||||||
|
//查看信息
|
||||||
|
viewApp(e) {
|
||||||
|
this.userList = e.users;
|
||||||
|
this.viewInfo = e;
|
||||||
|
this.viewShow = true;
|
||||||
|
this.getRowInfo(this.viewInfo.appId, this.viewInfo.id);
|
||||||
|
},
|
||||||
|
//查询 row 信息
|
||||||
|
getRowInfo(appId, id) {
|
||||||
|
this.roleList = [];
|
||||||
|
this.instance.post(`${this.actions.detail}?id=${appId}&roleId=${id}`)
|
||||||
|
.then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.roleList = res.data.filter(e => e.checked)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//复制
|
||||||
|
beforeCopy(row) {
|
||||||
|
this.row = row;
|
||||||
|
this.copyDialog = true;
|
||||||
|
this.getRowInfo(this.row.appId, this.row.id);
|
||||||
|
},
|
||||||
|
//确认复制
|
||||||
|
copyFn() {
|
||||||
|
let crr = [];
|
||||||
|
let appRoleList = this.roleList;
|
||||||
|
for (let i = 0; i < appRoleList.length; i++) {
|
||||||
|
if (appRoleList[i].checked) {
|
||||||
|
crr.push(appRoleList[i].id);
|
||||||
|
if (appRoleList[i].list.length) {
|
||||||
|
for (let j = 0; j < appRoleList[i].list.length; j++) {
|
||||||
|
if (appRoleList[i].list[j].checked) {
|
||||||
|
crr.push(appRoleList[i].list[j].id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.instance.post(`${this.actions.modify}?menus=${crr}`, null, {
|
||||||
|
params: {
|
||||||
|
roleName: this.editName,
|
||||||
|
appId: this.row.appId,
|
||||||
|
type: this.row.type
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message({message: "复制成功", type: "success"});
|
||||||
|
this.copyDialog = false;
|
||||||
|
this.searchList()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dataInit() {
|
||||||
|
this.multipleSelection = [];
|
||||||
|
this.row = {};
|
||||||
|
},
|
||||||
|
openRightsGraph(row) {
|
||||||
|
this.rightsGraph = true
|
||||||
|
this.selectApp = row
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.AppRoleRightsManager {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
|
||||||
|
:deep( .ai-dialog ) {
|
||||||
|
.ai-card {
|
||||||
|
box-shadow: none;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
|
||||||
|
.aibar {
|
||||||
|
height: 40px;
|
||||||
|
background: #f3f6f9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ai-card__body {
|
||||||
|
padding: 0 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep( .rightsGraphDialog ) {
|
||||||
|
.el-dialog__body {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ai-dialog__content {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep( .datail-table-body ) {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.datail-item {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 50%;
|
||||||
|
height: 24px;
|
||||||
|
line-height: 24px;
|
||||||
|
|
||||||
|
span {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-name {
|
||||||
|
width: 102px;
|
||||||
|
padding-left: 16px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.datail-item:nth-of-type(2n - 1) {
|
||||||
|
border-right: 1px solid rgba(208, 212, 220, 1);
|
||||||
|
width: calc(50% - 1px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.padd-l0 {
|
||||||
|
padding-left: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pad-l16 {
|
||||||
|
padding-left: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
193
project/xumu/AppRoleRightsManager/rightsAdd.vue
Normal file
193
project/xumu/AppRoleRightsManager/rightsAdd.vue
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
<template>
|
||||||
|
<ai-detail class="rightsAdd">
|
||||||
|
<ai-title :title="addTitle" slot="title" isShowBottomBorder isShowBack @onBackClick="back"/>
|
||||||
|
<template #content>
|
||||||
|
<el-form size="small" ref="rightsForm" :model="form" label-width="120px" :rules="rules">
|
||||||
|
<ai-card title="基本信息">
|
||||||
|
<template #content>
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="应用角色名称" prop="roleName">
|
||||||
|
<el-input v-model="form.roleName" placeholder="请输入应用角色名称" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="角色标记" prop="type" :rules="{required:true,message:'请选择角色标记'}">
|
||||||
|
<ai-select v-model="form.type" dict="roleType" placeholder="请选择角色标记" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="权限信息">
|
||||||
|
<template #content>
|
||||||
|
<el-form-item label="权限列表" prop="menus">
|
||||||
|
<div class="roleList">
|
||||||
|
<el-input v-model="filterText" placeholder="请输入..." clearable suffix-icon="iconfont iconSearch"
|
||||||
|
@change="$refs.tree.filter(filterText)" :validate-event="false"/>
|
||||||
|
<div class="tree_list">
|
||||||
|
<el-tree class="filter-tree" ref="roleTree"
|
||||||
|
:data="roleList"
|
||||||
|
show-checkbox
|
||||||
|
:props="defaultProps"
|
||||||
|
default-expand-all
|
||||||
|
:check-strictly="false"
|
||||||
|
node-key="id"
|
||||||
|
:default-checked-keys="form.menus"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
@check="handleMenusSelect"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="back()">取消</el-button>
|
||||||
|
<el-button type="primary" @click="confirm">保存</el-button>
|
||||||
|
</template>
|
||||||
|
</ai-detail>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "rightsAdd",
|
||||||
|
inject: ['top'],
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {},
|
||||||
|
id: '',
|
||||||
|
appList: [],
|
||||||
|
roleList: [],
|
||||||
|
defaultProps: {
|
||||||
|
children: 'list',
|
||||||
|
label: 'name'
|
||||||
|
},
|
||||||
|
treeList: [],
|
||||||
|
filterText: '',
|
||||||
|
msgTitle: '添加'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.isEdit) {
|
||||||
|
let {id, name: roleName, type} = this.$route.query
|
||||||
|
this.form = {menus: [], id, roleName, type}
|
||||||
|
this.msgTitle = '编辑'
|
||||||
|
}
|
||||||
|
this.getPermissions()
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isEdit() {
|
||||||
|
return this.$route.query.id
|
||||||
|
},
|
||||||
|
addTitle() {
|
||||||
|
return this.isEdit ? '编辑应用角色' : '新增应用角色'
|
||||||
|
},
|
||||||
|
rules() {
|
||||||
|
return {
|
||||||
|
roleName: {required: true, message: '请输入应用角色名称'},
|
||||||
|
roleType: {required: true, message: '请选择角色标记'},
|
||||||
|
menus: {required: true, message: '请选择权限列表内容'},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
filterNode(value, data) {
|
||||||
|
if (!value) return true;
|
||||||
|
return data.name.indexOf(value) !== -1;
|
||||||
|
},
|
||||||
|
//应用名称选择 获取权限列表
|
||||||
|
getId(data) {
|
||||||
|
if (data.list.length) {
|
||||||
|
data.list.forEach(item => {
|
||||||
|
this.getId(item)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
if (data.checked) {
|
||||||
|
this.form.menus?.push(data.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getPermissions() {
|
||||||
|
this.filterText = ''
|
||||||
|
let {id: roleId} = this.form
|
||||||
|
this.instance.post(this.top.actions.detail, null, {
|
||||||
|
params: {roleId}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.roleList = res.data;
|
||||||
|
if (this.isEdit) {
|
||||||
|
this.roleList.forEach(e => this.getId(e))
|
||||||
|
}
|
||||||
|
this.roleList = this.roleList.filter(item => !(item.component && item.isApp == 0 && item.isMenu == 0))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleMenusSelect(node, selected) {
|
||||||
|
this.$set(this.form, 'menus', [...selected?.checkedKeys])
|
||||||
|
this.$refs.rightsForm.validateField('menus')
|
||||||
|
},
|
||||||
|
//保存提交
|
||||||
|
confirm() {
|
||||||
|
this.$refs.rightsForm.validate().then(() => {
|
||||||
|
let menus = [this.$refs.roleTree?.getHalfCheckedKeys(), this.$refs.roleTree?.getCheckedKeys()]?.flat()?.toString()
|
||||||
|
this.instance.post(this.top.actions.modify, null, {
|
||||||
|
params: {...this.form, menus}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.msg == "success") {
|
||||||
|
this.$message.success(`${this.msgTitle}应用角色成功`)
|
||||||
|
this.back()
|
||||||
|
this.top.searchList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//取消 返回
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.rightsAdd {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.el-form-item {
|
||||||
|
.el-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-error {
|
||||||
|
.roleList {
|
||||||
|
border-color: #f46;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.roleList {
|
||||||
|
background-color: #fcfcfc;
|
||||||
|
border-radius: 2px;
|
||||||
|
border: solid 1px #d0d4dc;
|
||||||
|
padding: 8px;
|
||||||
|
|
||||||
|
.input {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 5px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tree_list {
|
||||||
|
padding: 5px;
|
||||||
|
height: 370px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
192
project/xumu/AppRoleRightsManager/rightsGraph.vue
Normal file
192
project/xumu/AppRoleRightsManager/rightsGraph.vue
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
<template>
|
||||||
|
<section class="rightsGraph">
|
||||||
|
<div id="RightGraph"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
;
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "rightsGraph",
|
||||||
|
inject: ['top'],
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
app: Object
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
graphData() {
|
||||||
|
let data = [...this.users, ...this.nodes].map(e => {
|
||||||
|
if (e.x) {
|
||||||
|
return e
|
||||||
|
} else return {...e, ...this.renderPosition(e)}
|
||||||
|
})
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
data,
|
||||||
|
links: this.links,
|
||||||
|
categories: data.map(e => e.category).flat().map(name => ({name}))
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
graph: null,
|
||||||
|
nodes: [],
|
||||||
|
links: [],
|
||||||
|
users: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
graphData: {
|
||||||
|
deep: true, handler() {
|
||||||
|
this.refreshGraph()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initGraph() {
|
||||||
|
let dom = document.querySelector("#RightGraph")
|
||||||
|
if (dom) {
|
||||||
|
this.graph = echarts.init(dom)
|
||||||
|
this.graph.setOption({
|
||||||
|
tooltip: {},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
type: 'graph',
|
||||||
|
layout: 'none',
|
||||||
|
roam: true,
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: 'right',
|
||||||
|
formatter: '{b}'
|
||||||
|
},
|
||||||
|
labelLayout: {
|
||||||
|
hideOverlap: true,
|
||||||
|
},
|
||||||
|
scaleLimit: {
|
||||||
|
min: 0.4,
|
||||||
|
max: 4
|
||||||
|
},
|
||||||
|
lineStyle: {
|
||||||
|
color: 'target',
|
||||||
|
curveness: 0.1
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
focus: 'adjacency',
|
||||||
|
lineStyle: {
|
||||||
|
width: 5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
this.graph.on('click', this.handleNodeClick)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
refreshGraph() {
|
||||||
|
this.graph?.setOption({
|
||||||
|
series: this.graphData
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getAppRoles(role) {
|
||||||
|
if (role) {
|
||||||
|
this.nodes.push({...role, category: '应用角色', value: "应用角色", symbolSize: 15})
|
||||||
|
} else this.instance.post(this.top.actions.list, null, {
|
||||||
|
params: {pageSize: 999}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
res.data.records.map(e => {
|
||||||
|
this.getUsers(e.users, e.id)
|
||||||
|
this.nodes.push({...e, category: '应用角色', value: "应用角色"})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getUsers(pending, source) {
|
||||||
|
pending?.map(e => {
|
||||||
|
if (!this.users.some(u => u.id == e.phone)) {
|
||||||
|
this.users.push({id: e.phone, name: e.name, symbolSize: 5, category: '用户', value: "用户"})
|
||||||
|
}
|
||||||
|
this.links.push({source, target: e.phone})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getPermissions({id: roleId, name: category, dataIndex}) {
|
||||||
|
const addNodes = (list, source, category, pos) => {
|
||||||
|
list?.map(e => {
|
||||||
|
let node = {
|
||||||
|
...e,
|
||||||
|
symbolSize: 5,
|
||||||
|
category,
|
||||||
|
value: e.list?.length > 0 ? "应用" : "权限",
|
||||||
|
}
|
||||||
|
node = {...node, ...this.renderPosition(pos || node)}
|
||||||
|
this.nodes.splice(dataIndex, 0, node)
|
||||||
|
if (e.checked == 1) {
|
||||||
|
this.links.push({source, target: e.id})
|
||||||
|
}
|
||||||
|
addNodes(e.list, e.id, e.label, node)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
roleId && this.instance.post(this.top.actions.detail, null, {
|
||||||
|
params: {roleId}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
addNodes(res.data, roleId, category)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleNodeClick(v) {
|
||||||
|
let {data: role, dataIndex} = v
|
||||||
|
if (!this.nodes.some(e => e.category == role?.name)) {
|
||||||
|
role && this.getPermissions({...role, dataIndex})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
renderPosition(node) {
|
||||||
|
node = JSON.parse(JSON.stringify(node))
|
||||||
|
let pos = {x: 0, y: 0}
|
||||||
|
if (node?.x) {
|
||||||
|
pos.x = Math.max(this.graph?.getWidth() / 3 * 2, node.x) + 100 + Math.random() * 50
|
||||||
|
pos.y = node.y + Math.random() * 100 - 50
|
||||||
|
} else if (node.value == '应用角色') {
|
||||||
|
pos.x = this.graph?.getWidth() / 3 - 200 + Math.random() * 200
|
||||||
|
pos.y = this.graph?.getHeight() / 2 - 100 + Math.random() * 200
|
||||||
|
} else if (node.value == '应用') {
|
||||||
|
pos.x = this.graph?.getWidth() / 3 * 2 - 100 + Math.random() * 100
|
||||||
|
pos.y = Math.random() * this.graph?.getHeight()
|
||||||
|
} else if (node.value == '用户') {
|
||||||
|
pos.x = Math.random() * 50
|
||||||
|
pos.y = Math.random() * this.graph?.getHeight()
|
||||||
|
} else {
|
||||||
|
pos.x = this.graph?.getWidth() - 100 + Math.random() * 100
|
||||||
|
pos.y = Math.random() * this.graph?.getHeight()
|
||||||
|
}
|
||||||
|
return pos
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getAppRoles(this.app)
|
||||||
|
this.getUsers(this.app.users, this.app.id)
|
||||||
|
this.getPermissions(this.app)
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.initGraph()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.rightsGraph {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
:deep( #RightGraph ){
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 500px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppSellApply/AppSellApply.vue
Normal file
35
project/xumu/AppSellApply/AppSellApply.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppSellApply",
|
||||||
|
label: "出栏申请",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return ["#edit", "#add"].includes(hash) ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "loanProduct", "loanStatus", "category", "variety")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppSellApply">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppSellApply {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
145
project/xumu/AppSellApply/add.vue
Normal file
145
project/xumu/AppSellApply/add.vue
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue";
|
||||||
|
|
||||||
|
const records = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "解押凭证号", prop: "releaseNo"},
|
||||||
|
{label: "审批状态", prop: "auditStatus", dict: "auditStatus"},
|
||||||
|
{label: "审批时间", prop: "auditTime"},
|
||||||
|
{label: "审批人", prop: "auditName"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "sellAdd",
|
||||||
|
components: {AiEartagPicker},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []},
|
||||||
|
records
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.isEdit ? `新增${appName}` : `${appName}详情`
|
||||||
|
},
|
||||||
|
isEdit: v => v.$route.hash == "#edit",
|
||||||
|
formImages: v => [
|
||||||
|
{label: "合同/协议", prop: "contractPicture", rules: {required: v.isEdit, message: '请上传 合同/协议'}},
|
||||||
|
],
|
||||||
|
columns: v => [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "身长测量照片", prop: "heightPicture", upload: {instance: v.instance, readonly: !v.isEdit, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "电子耳标照片", prop: "earNumberPicture", upload: {instance: v.instance, readonly: !v.isEdit, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "防疫耳标照片", prop: "preventionPicture", upload: {instance: v.instance, readonly: !v.isEdit, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "解押办结凭证号", prop: "releaseNo", hide: v.isEdit},
|
||||||
|
].filter(e => !e.hide),
|
||||||
|
selectedEartags: v => v.detail.list?.length || 0,
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/sell/apply/getInfo", null, {params: {contractNo: id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
detail.detailList = detail.detailList || []
|
||||||
|
detail.list = detail.list || []
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/sell/apply/add", {...this.detail}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="sellAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="养殖场" prop="farmId" :rules="{message:'请选择 养殖场'}">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款银行" prop="bankId" :rules="{message:'请选择 贷款银行'}">
|
||||||
|
<b v-text="detail.bankName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款产品" prop="productType" :rules="{message:'请选择 贷款产品'}">
|
||||||
|
<b v-text="dict.getLabel('loanProduct',detail.productType)"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款金额(万)" prop="loanAmount" :rules="{message:'请输入 预期贷款额'}">
|
||||||
|
<ai-input v-model.number="detail.loanAmount" :edit="!1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系人" prop="contacts" :rules="{message:'请输入 联系人'}">
|
||||||
|
<ai-input v-model="detail.contacts" :edit="!1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系电话" prop="phone" :rules="{message:'请输入 联系电话'}">
|
||||||
|
<ai-input v-model="detail.phone" :edit="!1"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="标的信息">
|
||||||
|
<template #right v-if="isEdit">
|
||||||
|
<ai-eartag-picker @select="v=>detail.detailList=v" :instance="instance"
|
||||||
|
:action="`/api/sell/apply/getClaimEarNumberList?contractNo=${detail.contractNo}`">
|
||||||
|
<el-button type="text">选择</el-button>
|
||||||
|
</ai-eartag-picker>
|
||||||
|
</template>
|
||||||
|
<ai-highlight class="mar-b8 font-14" :content="`投保标的共${detail.insureNumber||0}只,已理赔标的共 @v 只`" color="red" :value="selectedEartags"/>
|
||||||
|
<ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1" hideOptions/>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="解押材料" v-if="isEdit">
|
||||||
|
<div class="font-12 mar-b8">只能上传JPG/PNG文件,且不超过2M,一次最多5张</div>
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-model="detail[img.prop]" :instance="instance" value-is-url :limit="5"/>
|
||||||
|
</el-form-item>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="出栏解押记录" v-else>
|
||||||
|
<ai-table :tableData="detail.list" :colConfigs="records" :isShowPagination="!1" hideOptions/>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isEdit">
|
||||||
|
<el-button type="primary" @click="submit(1)">提交</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.sellAdd {
|
||||||
|
:deep(.el-form--label-top) {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
103
project/xumu/AppSellApply/list.vue
Normal file
103
project/xumu/AppSellApply/list.vue
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "贷款合同号", prop: "contractNo"},
|
||||||
|
{label: "所属养殖户", prop: "applyName"},
|
||||||
|
{label: "所属养殖场", prop: "farmName"},
|
||||||
|
{label: "贷款金额(万元)", prop: "loanAmount"},
|
||||||
|
{label: "贷款状态", prop: "status", dict: "loanStatus"},
|
||||||
|
{label: "贷款时间", prop: "createTime", width: 160},
|
||||||
|
{label: "说明", prop: "remarks"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "sellList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/sell/apply/page", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records.map(e => ({...e, permit: `${e.status}` + e.auditStatus}))
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="sellList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-input placeholder="贷款合同号" v-model="search.contractNo"/>
|
||||||
|
<ai-search label="贷款日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="养殖户" v-model="search.applyName"/>
|
||||||
|
<ai-input placeholder="养殖场" v-model="search.farmName"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-download :instance="instance" url="/api/sell/apply/export" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<template v-if="['1'].includes(row.status)">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#edit',query:{id:row.contractNo}})">出栏申请</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.contractNo}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.sellList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppSellAudit/AppSellAudit.vue
Normal file
35
project/xumu/AppSellAudit/AppSellAudit.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppSellAudit",
|
||||||
|
label: "出栏审核",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return ["#audit", "#add"].includes(hash) ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "loanProduct", "loanStatus", "category", "variety")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppSellAudit">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppSellAudit {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
149
project/xumu/AppSellAudit/add.vue
Normal file
149
project/xumu/AppSellAudit/add.vue
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "saAdd",
|
||||||
|
components: {AiEartagPicker},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.isAudit ? `${appName}审批` : `${appName}详情`
|
||||||
|
},
|
||||||
|
isAudit: v => v.$route.hash == "#audit",
|
||||||
|
formImages: v => [
|
||||||
|
{label: "合同/协议", prop: "contractPicture"},
|
||||||
|
],
|
||||||
|
columns: v => [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "身长测量照片", prop: "heightPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "电子耳标照片", prop: "earNumberPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "防疫耳标照片", prop: "preventionPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
].filter(e => !e.hide),
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/sell/apply/getAuditInfo", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/sell/apply/audit", {...this.detail}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="saAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid">
|
||||||
|
<el-form-item label="养殖场" prop="farmId" :rules="{message:'请选择 养殖场'}">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款银行" prop="bankId" :rules="{message:'请选择 贷款银行'}">
|
||||||
|
<b v-text="detail.bankName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款产品" prop="productType" :rules="{message:'请选择 贷款产品'}">
|
||||||
|
<b v-text="dict.getLabel('loanProduct',detail.productType)"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="贷款金额(万)" prop="loanAmount" :rules="{message:'请输入 预期贷款额'}">
|
||||||
|
<ai-input v-model.number="detail.loanAmount" :edit="!1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系人" prop="contacts" :rules="{message:'请输入 联系人'}">
|
||||||
|
<ai-input v-model="detail.contacts" :edit="!1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系电话" prop="phone" :rules="{message:'请输入 联系电话'}">
|
||||||
|
<ai-input v-model="detail.phone" :edit="!1"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="标的信息">
|
||||||
|
<ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1" hideOptions/>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="解押材料">
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-model="detail[img.prop]" value-is-url readonly/>
|
||||||
|
</el-form-item>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="审核信息">
|
||||||
|
<div class="grid">
|
||||||
|
<template v-if="isAudit">
|
||||||
|
<el-form-item label="审批状态" prop="auditStatus" :rules="{required:true,message:'请选择审批状态'}">
|
||||||
|
<ai-select v-model="detail.auditStatus" dict="auditStatus"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="解压资料" class="sc-3">
|
||||||
|
<ai-uploader v-model="detail.picture" value-is-url :instance="instance" :limit="1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="解押凭证号" prop="reportNo" :rules="{required:true,message:'请输入 解押凭证号'}">
|
||||||
|
<ai-input v-model="detail.reportNo"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="说明">
|
||||||
|
<ai-input type="textarea" :rows="3" v-model="detail.remarks"/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-form-item label="审核状态">{{ dict.getLabel('auditStatus', detail.auditStatus) }}</el-form-item>
|
||||||
|
<el-form-item label="解压资料" class="sc-3">
|
||||||
|
<el-image :src="detail.picture" :preview-src-list="[detail.picture]"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审核时间">{{ detail.auditTime }}</el-form-item>
|
||||||
|
<el-form-item label="审核人">{{ detail.auditName }}</el-form-item>
|
||||||
|
<el-form-item label="说明">{{ detail.remarks }}</el-form-item>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isAudit">
|
||||||
|
<el-button type="primary" @click="submit">提交</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.saAdd {
|
||||||
|
:deep(.el-form--label-top) {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
102
project/xumu/AppSellAudit/list.vue
Normal file
102
project/xumu/AppSellAudit/list.vue
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "解押凭证号", prop: "releaseNo"},
|
||||||
|
{label: "贷款合同号", prop: "contractNo"},
|
||||||
|
{label: "所属养殖户", prop: "applyName"},
|
||||||
|
{label: "解押数量", prop: "sellNumber"},
|
||||||
|
{label: "审批状态", prop: "auditStatus", dict: "auditStatus"},
|
||||||
|
{label: "审批时间", prop: "auditTime", width: 160},
|
||||||
|
{label: "审批人", prop: "auditName"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "saList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/sell/apply/getAuditPage", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records.map(e => ({...e, permit: `${e.status}` + e.auditStatus}))
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="saList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-input placeholder="解押凭证号" v-model="search.releaseNo"/>
|
||||||
|
<ai-input placeholder="贷款合同号" v-model="search.contractNo"/>
|
||||||
|
<ai-select placeholder="全部审批状态" v-model="search.auditStatus" dict="auditStatus"/>
|
||||||
|
<ai-search label="投保日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.auditBeginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.auditEndDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="养殖户" v-model="search.applyName"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-download :instance="instance" url="/api/sell/apply/exportAudit" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<template v-if="['1'].includes(row.auditStatus)">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#audit',query:{id:row.id}})">审核</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.id}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.saList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
231
project/xumu/AppSign/AppSign.vue
Normal file
231
project/xumu/AppSign/AppSign.vue
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
<template>
|
||||||
|
<section class="AppSign">
|
||||||
|
<div class="left signLeftBg">
|
||||||
|
<el-row type="flex" align="middle">
|
||||||
|
<img class="AiIcon" v-if="/[\\\/]/.test(logo.icon)" :src="logo.icon" alt=""/>
|
||||||
|
<ai-icon v-else-if="logo.icon" type="logo" :icon="logo.icon"/>
|
||||||
|
<div v-if="logo.text" class="logoText mar-l8" v-text="logo.text"/>
|
||||||
|
</el-row>
|
||||||
|
<div class="signLeftContent">
|
||||||
|
<div class="titlePane">
|
||||||
|
<b v-text="system.name"/>
|
||||||
|
<div v-text="system.title"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="right">
|
||||||
|
<div class="projectName mar-b48" :title="system.fullTitle">{{ system.fullTitle }}</div>
|
||||||
|
<el-card class="signBox">
|
||||||
|
<div class="choosePlatform flex column" v-if="!isAdmin&&!form.type">
|
||||||
|
<div class="font-20 mar-b40 t-center t-bold">请选择业务端后登陆</div>
|
||||||
|
<div class="selectPlatform fill">
|
||||||
|
<div class="flex center pointer" v-for="op in platforms" :key="op.dictValue"
|
||||||
|
v-text="op.dictName" @click="$set(form,'type',op.dictValue)"/>
|
||||||
|
</div>
|
||||||
|
<div class="mar-t32 font-12" style="align-self: flex-end">
|
||||||
|
未注册用户请扫码添加客服咨询
|
||||||
|
<i class="iconfont iconEwm" style="font-size: 20px"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<template v-else>
|
||||||
|
<div class="font-20 mar-b40 t-center t-bold"><i v-if="!isAdmin" class="el-icon-back" @click="form.type=null"/>账号登录</div>
|
||||||
|
<el-form :model="form" ref="form" :rules="rules">
|
||||||
|
<el-form-item prop="username">
|
||||||
|
<el-input v-model="form.username" placeholder="请输入您的账号"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="password">
|
||||||
|
<el-input type="password" v-model="form.password" placeholder="请输入您的密码" show-password/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="t-right font-12">忘记密码请联系客服处理</div>
|
||||||
|
<el-button type="primary" class="login-btn" @click="handleSignIn">登录</el-button>
|
||||||
|
</template>
|
||||||
|
</el-card>
|
||||||
|
<el-row type="flex" align="middle" class="bottomRecord">
|
||||||
|
<div v-if="system.recordDesc" v-text="system.recordDesc"/>
|
||||||
|
<el-link v-if="system.recordNo" v-text="system.recordNo" :href="system.recordURL"/>
|
||||||
|
<div v-if="system.ssl" v-html="system.ssl"/>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {mapMutations, mapState} from 'vuex'
|
||||||
|
|
||||||
|
const rules = {
|
||||||
|
username: [{required: true, message: '请输入您的账号', trigger: 'blur'}],
|
||||||
|
password: [{required: true, message: '请输入您的密码', trigger: 'blur'}]
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppSign",
|
||||||
|
label: "登录页",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
rules,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user', 'sys']),
|
||||||
|
instance: v => v.$request,
|
||||||
|
system: v => v.sys?.info || {
|
||||||
|
fullTitle: '畜牧养殖产业一体化平台'
|
||||||
|
},
|
||||||
|
logo: v => !!v.system.loginLogo ? {icon: v.system.loginLogo, text: v.system.loginLogoText} : {icon: v.system.logo, text: v.system.logoText},
|
||||||
|
isAdmin: v => v.$route.hash == "#sinoecare", //用来判断是否是管理员登录,
|
||||||
|
dict: v => v.$dict,
|
||||||
|
platforms: v => v.dict.getDict('roleType').filter(e => !['platform', 'other', 'service'].includes(e.dictValue))
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("roleType")
|
||||||
|
if (this.user.token) {
|
||||||
|
this.handleGotoHome()
|
||||||
|
} else {
|
||||||
|
const {code} = this.$route.query
|
||||||
|
if (code) {
|
||||||
|
this.toLogin(code)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapMutations(['setToken']),
|
||||||
|
login(data) {
|
||||||
|
if (data?.access_token) {
|
||||||
|
this.setToken([data.token_type, data.access_token].join(" "))
|
||||||
|
this.handleGotoHome()
|
||||||
|
} else {
|
||||||
|
this.$message.error(data?.msg || "登录失败!")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleGotoHome() {
|
||||||
|
this.$message.success("登录成功!")
|
||||||
|
if (this.$route.hash == "#dv") {
|
||||||
|
this.$router.push({name: "数据大屏入口", hash: "#dv"})
|
||||||
|
} else {
|
||||||
|
this.$router.push({name: "Home"})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleSignIn() {
|
||||||
|
this.$refs.form.validate().then(() => {
|
||||||
|
const password = this.$encryption(this.form.password)
|
||||||
|
this.form.type = this.form.type || "platform"
|
||||||
|
this.$request.post("/api/oauth/token", null, {
|
||||||
|
auth: {username: 'villcloud', password: "villcloud"},
|
||||||
|
params: {grant_type: 'password', scope: 'server', ...this.form, password}
|
||||||
|
}).then(data => {
|
||||||
|
this.login(data)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.AppSign {
|
||||||
|
display: flex;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
|
||||||
|
.selectPlatform {
|
||||||
|
width: 100%;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
grid-gap: 10px;
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
color: #fff;
|
||||||
|
background: $primaryBtnColor;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.signBox {
|
||||||
|
width: 500px;
|
||||||
|
min-height: 300px;
|
||||||
|
position: relative;
|
||||||
|
color: $primaryColor;
|
||||||
|
|
||||||
|
.choosePlatform {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
padding: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon-back {
|
||||||
|
position: absolute;
|
||||||
|
left: 20px;
|
||||||
|
top: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-btn {
|
||||||
|
font-size: 16px;
|
||||||
|
width: 100%;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
margin: 16px auto;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.AiIcon {
|
||||||
|
font-size: 40px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logoText {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.left) {
|
||||||
|
width: 480px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
padding-left: 64px;
|
||||||
|
padding-top: 40px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 16px;
|
||||||
|
|
||||||
|
.iconcunwei1 {
|
||||||
|
font-size: 36px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.right) {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
background-color: #F6F8FB;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: calc(100% - 80px) 0, calc(100% - 40px) 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.bottomRecord {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
gap: 16px;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 20px;
|
||||||
|
|
||||||
|
.el-link {
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppTreatmentManage/AppTreatmentManage.vue
Normal file
35
project/xumu/AppTreatmentManage/AppTreatmentManage.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppTreatmentManage",
|
||||||
|
label: "治疗登记",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return hash == "#add" ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppTreatmentManage">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppTreatmentManage {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
186
project/xumu/AppTreatmentManage/add.vue
Normal file
186
project/xumu/AppTreatmentManage/add.vue
Normal file
@@ -0,0 +1,186 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagPicker from "../components/AiEartagPicker.vue";
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "药品名称", prop: "drugName"},
|
||||||
|
{label: "药量(ml)", prop: "dosage"},
|
||||||
|
{label: "生产厂家", prop: "factory"},
|
||||||
|
{label: "厂家批号", prop: "batchNumber"},
|
||||||
|
{label: "疾病名称", prop: "diseaseName"},
|
||||||
|
{label: "症状", prop: "symptom"},
|
||||||
|
{label: "兽医", prop: "userName"},
|
||||||
|
{label: "治疗时间", prop: "immunityTime"},
|
||||||
|
{label: "登记时间", prop: "createTime"},
|
||||||
|
]
|
||||||
|
const formItems = [
|
||||||
|
{label: "药品名称", prop: "drugName", rules: {required: true, message: '请选择 药品名称'}},
|
||||||
|
{label: "每头药量", prop: "dosage"},
|
||||||
|
{label: "生产厂家", prop: "factory"},
|
||||||
|
{label: "厂家批号", prop: "batchNumber"},
|
||||||
|
{label: "疾病名称", prop: "diseaseName"},
|
||||||
|
{label: "症状", prop: "symptom"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "treatmentAdd",
|
||||||
|
components: {AiEartagPicker},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []},
|
||||||
|
columns, formItems,
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
isAdd: v => !v.$route.query.id,
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/breed/treatment/getInfo", null, {params: {biochipEarNumber: id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
detail.detailList = detail.treatmentList || []
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
this.$confirm("确定删除该条数据?").then(() => {
|
||||||
|
this.instance.post("/api/breed/treatment/del", null, {
|
||||||
|
params: {id}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAdd() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/breed/treatment/add", this.detail).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$message.success("新增成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/breed/treatment/update", this.form).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.dialog = false
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("yesOrNo")
|
||||||
|
this.detail.treatmentTime = this.$moment().format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="treatmentAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid c-3" v-if="isAdd">
|
||||||
|
<el-form-item label="养殖场" prop="farmId" :rules="{required:true,message:'请选择 养殖场'}">
|
||||||
|
<ai-select v-model="detail.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId" :rules="{required:true,message:'请选择 养殖舍'}">
|
||||||
|
<ai-select v-model="detail.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${detail.farmId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId" :rules="{required:true,message:'请选择 养殖栏'}">
|
||||||
|
<ai-select v-model="detail.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${detail.houseId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="牲畜" prop="earNumberList" :rules="{required:true,message:'请选择 牲畜'}" class="row">
|
||||||
|
<ai-eartag-picker v-model="detail.earNumberList" :instance="instance" :penId="detail.penId"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
<div v-else class="grid c-4">
|
||||||
|
<el-form-item label="养殖场" prop="farmId">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId">
|
||||||
|
<b v-text="detail.houseName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId">
|
||||||
|
<b v-text="detail.penName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生物芯片耳标号">
|
||||||
|
<b v-text="detail.biochipEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="治疗登记">
|
||||||
|
<template v-if="isAdd">
|
||||||
|
<div class="grid c-3">
|
||||||
|
<el-form-item label="治疗日期" prop="treatmentTime" :rules="{required:true,message:'请选择 治疗日期'}">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="detail.treatmentTime"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-for="(item,i) in formItems" :key="i" v-bind="item">
|
||||||
|
<ai-input v-model="detail[item.prop]"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-button type="text" slot="right" @click="dialog=true">新增</el-button>
|
||||||
|
<ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row,$index}">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="dialog=true,form=row">编辑</el-button>
|
||||||
|
<el-button type="text" class="deleteBtn" @click="handleDelete(row.id)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
<ai-dialog v-model="dialog" title="治疗登记" @closed="form={}" @confirm="submit">
|
||||||
|
<el-form size="small" label-width="120px" class="grid">
|
||||||
|
<el-form-item label="治疗日期" prop="treatmentTime" :rules="{required:true,message:'请选择 治疗日期'}">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="form.treatmentTime"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-for="(item,i) in formItems" :key="i" v-bind="item">
|
||||||
|
<ai-input v-model="detail[item.prop]"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ai-dialog>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button v-if="isAdd" type="primary" @click="handleAdd">提交</el-button>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.treatmentAdd {
|
||||||
|
.el-date-editor {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
106
project/xumu/AppTreatmentManage/list.vue
Normal file
106
project/xumu/AppTreatmentManage/list.vue
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "养殖场", prop: "userName", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "最近治疗日期", prop: "treatmentTime"},
|
||||||
|
{label: "最近登记时间", prop: "createTime"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "treatmentList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/breed/treatment/page", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "category", "variety")
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="treatmentList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-select placeholder="全部养殖场" v-model="search.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖舍" v-model="search.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.farmId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖栏" v-model="search.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.houseId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-search label="治疗日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.treatmentBeginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.treatmentEndDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-search label="登记日期">
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<el-input placeholder="原场耳标号" v-model="search.originalEarNumber" size="small" clearable/>
|
||||||
|
<el-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber" size="small" clearable/>
|
||||||
|
<el-input placeholder="电子耳标号" v-model="search.electronicEarNumber" size="small" clearable/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">新增</el-button>
|
||||||
|
<ai-download :instance="instance" url="/api/breed/treatment/export" :params="{...search,...page}" :fileName="`治疗登记导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.treatmentList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
project/xumu/AppWeightManage/AppWeightManage.vue
Normal file
35
project/xumu/AppWeightManage/AppWeightManage.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppWeightManage",
|
||||||
|
label: "体重管理",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return hash == "#add" ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load( "yesOrNo", "category", "variety", "dataSources")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppWeightManage">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppWeightManage {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
144
project/xumu/AppWeightManage/add.vue
Normal file
144
project/xumu/AppWeightManage/add.vue
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiSelect from "dui/packages/basic/AiSelect.vue";
|
||||||
|
import AiDialog from "dui/packages/basic/AiDialog.vue";
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "数据来源", prop: "source", dict: "dataSources"},
|
||||||
|
{label: "重量", prop: "weight"},
|
||||||
|
{label: "称重时间", prop: "createTime"},
|
||||||
|
{label: "是否变更过", prop: "isUpdate", dict: "yesOrNo"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "weightAdd",
|
||||||
|
components: {AiDialog, AiSelect},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []},
|
||||||
|
columns,
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/breed/weight/getInfo", null, {params: {biochipEarNumber: id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
detail.detailList = detail.weightList || []
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
this.$confirm("确定删除该条数据?").then(() => {
|
||||||
|
this.instance.post("/api/breed/weight/del", null, {
|
||||||
|
params: {id}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.form.biochipEarNumber = this.detail.biochipEarNumber
|
||||||
|
this.instance.post("/api/breed/weight/addOrEdit", null, {params: this.form}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.dialog = false
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="weightAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid c-4">
|
||||||
|
<el-form-item label="生物芯片耳标号">
|
||||||
|
<b v-text="detail.biochipEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖场" prop="farmId">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId">
|
||||||
|
<b v-text="detail.houseName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId">
|
||||||
|
<b v-text="detail.penName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别" prop="penId">
|
||||||
|
<b v-text="detail.category"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品种" prop="penId">
|
||||||
|
<b v-text="detail.variety"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="最近称重时间">
|
||||||
|
<b v-text="detail.todayCreateTime||detail.lastCreateTime"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="最新体重(公斤)">
|
||||||
|
<b v-text="detail.todayWeight||detail.lastWeight"/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="体重录入">
|
||||||
|
<el-button type="text" slot="right" @click="dialog=true">新增</el-button>
|
||||||
|
<ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row,$index}">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="dialog=true,form=row">编辑</el-button>
|
||||||
|
<el-button type="text" class="deleteBtn" @click="handleDelete(row.id)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-card>
|
||||||
|
<ai-dialog v-model="dialog" title="体重录入" @closed="form={}" @confirm="submit" width="50vw">
|
||||||
|
<el-form size="small" label-width="120px" :model="form" ref="detail" class="grid">
|
||||||
|
<el-form-item label="办理时间" prop="createTime" :rules="[{required:true,message:'请选择办理时间'}]">
|
||||||
|
<el-date-picker v-model="form.createTime" :readonly="form.id" value-format="yyyy-MM-dd HH:mm:ss"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="体重(公斤)" prop="weight" :rules="[{required:true,message:'请输入体重(公斤)'}]">
|
||||||
|
<ai-input type="number" v-model="form.weight"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ai-dialog>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.weightAdd {
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user