Compare commits
	
		
			1 Commits
		
	
	
		
			devops
			...
			feature/rs
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 50e56a9812 | 
| @@ -1,5 +0,0 @@ | |||||||
| 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 |  | ||||||
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -30,4 +30,3 @@ yarn-error.log* | |||||||
| /examples/router/apps.js | /examples/router/apps.js | ||||||
| /src/apps/ | /src/apps/ | ||||||
| /src/config.json | /src/config.json | ||||||
| /src/utils/apps.js |  | ||||||
|   | |||||||
							
								
								
									
										69
									
								
								bin/build.js
									
									
									
									
									
								
							
							
						
						
									
										69
									
								
								bin/build.js
									
									
									
									
									
								
							| @@ -1,6 +1,5 @@ | |||||||
| const axios = require('axios') | const axios = require('axios') | ||||||
| const {fsExtra, copyFiles, findApp, chalkTag, fs} = require("./tools"); | const {fsExtra, copyFiles} = require("./tools"); | ||||||
| const compiler = require('vue-template-compiler') |  | ||||||
| const getBuildConfig = id => { | const getBuildConfig = id => { | ||||||
|   axios.post('http://192.168.1.87:12525/node/custom/detail', null, {params: {id}}).then(res => { |   axios.post('http://192.168.1.87:12525/node/custom/detail', null, {params: {id}}).then(res => { | ||||||
|     if (res?.data) { |     if (res?.data) { | ||||||
| @@ -10,68 +9,6 @@ const getBuildConfig = id => { | |||||||
|     } |     } | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| 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 = {}) => { | const createPages = (config = {}) => { | ||||||
|   fsExtra.emptyDir("src/apps", err => { |   fsExtra.emptyDir("src/apps", err => { | ||||||
| @@ -87,13 +24,13 @@ const createPages = (config = {}) => { | |||||||
|         copyFiles("src/apps/core", "packages/core"), |         copyFiles("src/apps/core", "packages/core"), | ||||||
|         copyFiles("src/apps/custom", `project/${customPath}`), |         copyFiles("src/apps/custom", `project/${customPath}`), | ||||||
|         ...Object.keys(stdApps).map(e => copyFiles(`src/apps/${e.replace(/^packages[\\\/]/, '')}`, e)), |         ...Object.keys(stdApps).map(e => copyFiles(`src/apps/${e.replace(/^packages[\\\/]/, '')}`, e)), | ||||||
|       ]).then(() => createRoutes(config)).then(() => fsExtra.ensureFile("src/apps/actions.js")) |       ]).then(() => fsExtra.ensureFile("src/apps/actions.js")) | ||||||
|     } |     } | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
|  |  | ||||||
| const start = () => { | const start = () => { | ||||||
|   const buildId = process.argv[2] || process.env.VUE_APP_OMS_ID || 'f670cc46-7cf7-4a0f-86ee-3077044c0b17' |   const buildId = process.argv[2] || 'f670cc46-7cf7-4a0f-86ee-3077044c0b17' | ||||||
|   getBuildConfig(buildId) |   getBuildConfig(buildId) | ||||||
| } | } | ||||||
| start() | start() | ||||||
|   | |||||||
| @@ -21,11 +21,10 @@ const getAppInfo = (file, apps) => { | |||||||
|  |  | ||||||
| const start = () => { | const start = () => { | ||||||
|   chalkTag.info("开始扫描库工程...") |   chalkTag.info("开始扫描库工程...") | ||||||
|   const {VUE_APP_SCOPE, VUE_APP_CORE} = process.env |   const {VUE_APP_SCOPE} = process.env | ||||||
|   const list = [] |   const list = [] | ||||||
|   let scanScope = ['packages', 'project'] |   let scanScope = ['packages', 'project'] | ||||||
|   if (VUE_APP_SCOPE) scanScope = [`project/${VUE_APP_SCOPE}`] |   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(() => { |   Promise.all(scanScope.map(e => findApp(e, app => getAppInfo(app, list)))).then(() => { | ||||||
|     fsExtra.outputFile('examples/router/apps.js', `export default [${list.map(e => { |     fsExtra.outputFile('examples/router/apps.js', `export default [${list.map(e => { | ||||||
|       const {name, label, path, esm} = e |       const {name, label, path, esm} = e | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| import { Message } from 'element-ui' | import {Message} from 'element-ui' | ||||||
| import instance from 'dui/lib/js/request' | import instance from 'dui/lib/js/request' | ||||||
|  |  | ||||||
| let baseURLs = { | let baseURLs = { | ||||||
| @@ -11,7 +11,7 @@ instance.interceptors.request.use(config => { | |||||||
|     config.url = "/ns" + config.url |     config.url = "/ns" + config.url | ||||||
|   } |   } | ||||||
|   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)) | ||||||
|   | |||||||
							
								
								
									
										24
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								package.json
									
									
									
									
									
								
							| @@ -4,17 +4,13 @@ | |||||||
|   "private": false, |   "private": false, | ||||||
|   "author": "kubbo", |   "author": "kubbo", | ||||||
|   "scripts": { |   "scripts": { | ||||||
|     "dev": "vue-cli-service serve examples/main.js", |     "dev": "rsbuild dev", | ||||||
|     "build": "vue-cli-service build", |     "build": "rsbuild build", | ||||||
|     "oms": "vue-cli-service serve examples/main.js --mode oms", |     "oms": "rsbuild dev --mode oms", | ||||||
|     "xumu": "vue-cli-service serve examples/main.js --mode xumu", |  | ||||||
|     "sync": "node bin/appsSync.js", |     "sync": "node bin/appsSync.js", | ||||||
|     "preview": "node bin/build.js && vue-cli-service serve", |     "preview": "node bin/build.js && rsbuild dev", | ||||||
|     "predev": "node bin/scanApps.js", |     "predev": "node bin/scanApps.js", | ||||||
|     "preoms": "dotenv -e .env.oms 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" |  | ||||||
|   }, |   }, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@amap/amap-jsapi-loader": "^1.0.1", |     "@amap/amap-jsapi-loader": "^1.0.1", | ||||||
| @@ -45,16 +41,18 @@ | |||||||
|     "@babel/plugin-proposal-logical-assignment-operators": "^7.10.4", |     "@babel/plugin-proposal-logical-assignment-operators": "^7.10.4", | ||||||
|     "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4", |     "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4", | ||||||
|     "@babel/plugin-proposal-optional-chaining": "^7.10.4", |     "@babel/plugin-proposal-optional-chaining": "^7.10.4", | ||||||
|     "@vue/cli-plugin-babel": "^3.6.0", |     "@rsbuild/core": "^1.0.17", | ||||||
|     "@vue/cli-plugin-eslint": "^3.6.0", |     "@rsbuild/plugin-babel": "^1.0.2", | ||||||
|     "@vue/cli-service": "^3.6.0", |     "@rsbuild/plugin-sass": "^1.0.4", | ||||||
|  |     "@rsbuild/plugin-vue2": "^1.0.1", | ||||||
|  |     "autoprefixer": "^10.4.20", | ||||||
|     "axios": "^0.19.2", |     "axios": "^0.19.2", | ||||||
|     "babel-eslint": "^10.1.0", |     "babel-eslint": "^10.1.0", | ||||||
|     "core-js": "^2.6.11", |  | ||||||
|     "dotenv-cli": "^7.4.2", |     "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", | ||||||
|  |     "fs-extra": "^11.2.0", | ||||||
|     "image-webpack-loader": "^6.0.0", |     "image-webpack-loader": "^6.0.0", | ||||||
|     "inquirer": "^6.5.2", |     "inquirer": "^6.5.2", | ||||||
|     "mockjs": "^1.1.0", |     "mockjs": "^1.1.0", | ||||||
|   | |||||||
| @@ -49,7 +49,6 @@ | |||||||
|               <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> | ||||||
| @@ -78,7 +77,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' }, | ||||||
| @@ -86,7 +85,6 @@ | |||||||
|           { 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: [], | ||||||
| @@ -102,9 +100,7 @@ | |||||||
|  |  | ||||||
|     created() { |     created() { | ||||||
|       this.search.areaId = this.user.info.areaId |       this.search.areaId = this.user.info.areaId | ||||||
|       this.dict.load('auditStatus').then(() => { |       this.getList() | ||||||
|         this.getList() |  | ||||||
|       }) |  | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     methods: { |     methods: { | ||||||
| @@ -176,34 +172,6 @@ | |||||||
|             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,27 +1,151 @@ | |||||||
| <template> | <template> | ||||||
|   <section class="AppDictionary"> |   <section class="AppDictionary"> | ||||||
|     <component :is="currentPage" v-bind="$props"/> |     <ai-list v-if="!showDetail"> | ||||||
|  |       <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: { | ||||||
|     currentPage() { |     showDetail() { | ||||||
|       let {hash} = this.$route |       return this.$route.hash == "#add" | ||||||
|       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> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,142 +0,0 @@ | |||||||
| <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.component" class="opBtn" v-text="`添加下级`" @click="addMenu(data)"/> |                 <div v-if="data.type<2" 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,16 +54,29 @@ | |||||||
|         <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="style"> |         <el-form-item label="菜单类型" prop="type"> | ||||||
|           <el-input v-model="form.style" placeholder="请输入" clearable/> |           <ai-select v-model="form.type" clearable :selectList="dict.getDict('menuType')"/> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
|         <el-form-item label="菜单应用" prop="component"> |         <template v-if="form.type==0"> | ||||||
|           <el-input v-model="form.component" placeholder="请输入" clearable/> |           <el-form-item label="菜单图标" prop="style"> | ||||||
|         </el-form-item> |             <el-input v-model="form.style" placeholder="请输入" clearable/> | ||||||
|         <el-form-item label="路径(path)" prop="path"> |           </el-form-item> | ||||||
|           <el-input v-model="form.path" placeholder="请输入" clearable/> |         </template> | ||||||
|         </el-form-item> |         <template v-if="form.type==1"> | ||||||
|         <template v-if="form.component"> |           <el-form-item label="菜单图标" prop="style"> | ||||||
|  |             <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> | ||||||
| @@ -71,7 +84,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 label="排序" prop="showIndex"> |         <el-form-item v-if="form.type<2" 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> | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| <template> | <template> | ||||||
|   <div class="AppFormReview"> |   <div class="AppGridReview"> | ||||||
|     <keep-alive :include="['List']"> |     <keep-alive :include="['List']"> | ||||||
|       <component ref="component" :is="component" :permissions="permissions " @change="onChange" :params="params" :instance="instance" :dict="dict"></component> |       <component ref="component" :is="component" :permissions="permissions " @change="onChange" :params="params" :instance="instance" :dict="dict"></component> | ||||||
|     </keep-alive> |     </keep-alive> | ||||||
| @@ -11,7 +11,7 @@ | |||||||
|   import Detail from './components/Detail' |   import Detail from './components/Detail' | ||||||
| 
 | 
 | ||||||
|   export default { |   export default { | ||||||
|     name: 'AppFormReview', |     name: 'AppGridReview', | ||||||
|     label: '网格动态', |     label: '网格动态', | ||||||
| 
 | 
 | ||||||
|     props: { |     props: { | ||||||
| @@ -56,7 +56,7 @@ | |||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <style lang="scss"> | <style lang="scss"> | ||||||
| .AppFormReview { | .AppGridReview { | ||||||
|   height: 100%; |   height: 100%; | ||||||
|   background: #F3F6F9; |   background: #F3F6F9; | ||||||
|   overflow: auto; |   overflow: auto; | ||||||
| @@ -114,8 +114,8 @@ | |||||||
|             this.instance.post(`/app/appgirdnews/examine?id=${this.params.id}&pass=${this.form.status}&opinion=${this.form.opinion}`).then(res => { |             this.instance.post(`/app/appgirdnews/examine?id=${this.params.id}&pass=${this.form.status}&opinion=${this.form.opinion}`).then(res => { | ||||||
|               if (res?.code == 0) { |               if (res?.code == 0) { | ||||||
|                 this.isShowExamine = false |                 this.isShowExamine = false | ||||||
|  |                 this.getDetail() | ||||||
|                 this.$message.success('审核成功!') |                 this.$message.success('审核成功!') | ||||||
|                 this.cancel(true) |  | ||||||
|               } |               } | ||||||
|             }) |             }) | ||||||
|           } |           } | ||||||
|   | |||||||
| @@ -17,9 +17,8 @@ | |||||||
|           <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-if="row.parentRuleName != '工单处理' && row.numberLimit">{{row.numberLimit.length ? $dict.getLabel("integralRuleScoringCycle", row.scoringCycle) |               <span v-else>{{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,10 +10,6 @@ | |||||||
|               <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> | ||||||
| @@ -128,7 +124,6 @@ export default { | |||||||
|     return { |     return { | ||||||
|       form: { |       form: { | ||||||
|         title: '', |         title: '', | ||||||
|         quota: 1, |  | ||||||
|         detail: '', |         detail: '', | ||||||
|         lng: '', |         lng: '', | ||||||
|         lat: '', |         lat: '', | ||||||
| @@ -149,7 +144,6 @@ 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"}], | ||||||
| @@ -191,17 +185,17 @@ export default { | |||||||
|   watch: { |   watch: { | ||||||
|     'form.intoTime': { |     'form.intoTime': { | ||||||
|       handler(val) { |       handler(val) { | ||||||
|         if (Array.isArray(val) && val.length >= 2) { |         if(val) { | ||||||
|           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 (Array.isArray(val) && val.length >= 2) { |         if(val) { | ||||||
|           this.form.exitBegintime = val[0]; |           this.form.exitBegintime = val[0] | ||||||
|           this.form.exitEndtime = val[1]; |           this.form.exitEndtime = val[1] | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -8,7 +8,6 @@ | |||||||
|         <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,26 +7,29 @@ | |||||||
|           <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="基本信息"> | ||||||
|                 <div class="grid"> |                 <template #content> | ||||||
|                   <el-form-item label="项目/系统名称" prop="name" class="row"> |                   <el-form-item label="项目/系统名称" prop="name"> | ||||||
|                     <ai-input v-model="form.name"/> |                     <el-input v-model="form.name" placeholder="请输入" clearable/> | ||||||
|                   </el-form-item> |                   </el-form-item> | ||||||
|                   <el-form-item label="系统类型" prop="type"> |                   <el-row type="flex"> | ||||||
|                     <ai-select v-model="form.type" dict="systemType" @change="form.apps = []"/> |                     <div class="fill"> | ||||||
|                   </el-form-item> |                       <el-form-item label="系统类型" prop="type"> | ||||||
|                   <el-form-item label="库项目根路径" prop="customPath"> |                         <ai-select v-model="form.type" :selectList="dict.getDict('systemType')" @change="form.apps = []"/> | ||||||
|                     <ai-input v-model="form.customPath"/> |                       </el-form-item> | ||||||
|                   </el-form-item> |                       <el-form-item label="更新项目路径" prop="dist"> | ||||||
|                   <el-form-item label="更新项目路径" prop="dist"> |                         <el-input v-model="form.dist" placeholder="常填写nginx路径,下载包从这里取" clearable/> | ||||||
|                     <ai-input v-model="form.dist" placeholder="常填写nginx路径,下载包从这里取"/> |                       </el-form-item> | ||||||
|                   </el-form-item> |                     </div> | ||||||
|                   <el-form-item label="版本号" prop="version"> |                     <div class="fill mar-l16"> | ||||||
|                     <ai-input v-model="form.version"/> |                       <el-form-item label="库项目根路径" prop="customPath"> | ||||||
|                   </el-form-item> |                         <el-input v-model="form.customPath" placeholder="请输入" clearable/> | ||||||
|                   <el-form-item label="微信机器人" prop="webhook"> |                       </el-form-item> | ||||||
|                     <ai-input v-model="form.webhook"/> |                       <el-form-item label="版本号" prop="version"> | ||||||
|                   </el-form-item> |                         <el-input v-model="form.version" placeholder="请输入" clearable/> | ||||||
|                 </div> |                       </el-form-item> | ||||||
|  |                     </div> | ||||||
|  |                   </el-row> | ||||||
|  |                 </template> | ||||||
|               </ai-card> |               </ai-card> | ||||||
|               <ai-card title="主库应用"> |               <ai-card title="主库应用"> | ||||||
|                 <template #content> |                 <template #content> | ||||||
| @@ -35,15 +38,13 @@ | |||||||
|                   <ai-empty v-else>请先选择系统类型</ai-empty> |                   <ai-empty v-else>请先选择系统类型</ai-empty> | ||||||
|                 </template> |                 </template> | ||||||
|               </ai-card> |               </ai-card> | ||||||
|               <component class="extraConfig" title="扩展设置" :is="extraConfig" v-model="form.extra" :appList="appList"/> |               <component class="extraConfig" title="扩展设置" :is="extraConfig" v-model="form.extra"/> | ||||||
|             </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 |             <ai-lib-table :meta="appList" customData :isShowPagination="false" v-bind="$props" disabled :colConfigs="appListConfigs"> | ||||||
|                           :colConfigs="appListConfigs"> |  | ||||||
|               <template slot="options" slot-scope="{row}"> |               <template slot="options" slot-scope="{row}"> | ||||||
|                 <ai-dialog-btn text="编辑" :customFooter="false" dialogTitle="应用配置" width="500px" |                 <ai-dialog-btn text="编辑" :customFooter="false" dialogTitle="应用配置" width="500px" @onConfirm="handleAppEdit(row)"> | ||||||
|                                @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="请输入应用名称"/> | ||||||
| @@ -100,7 +101,7 @@ export default { | |||||||
|   }, |   }, | ||||||
|   data() { |   data() { | ||||||
|     return { |     return { | ||||||
|       form: {apps: [], type: null, customPath: "", extra: {sysInfo: {}}}, |       form: {apps: [], type: null, sysInfo: {}, customPath: ""}, | ||||||
|       rules: { |       rules: { | ||||||
|         name: {required: true, message: "请输入"}, |         name: {required: true, message: "请输入"}, | ||||||
|         type: {required: true, message: "请选择"}, |         type: {required: true, message: "请选择"}, | ||||||
| @@ -112,6 +113,20 @@ export default { | |||||||
|         {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: { | ||||||
|   | |||||||
| @@ -6,13 +6,13 @@ export default { | |||||||
|     event: "input" |     event: "input" | ||||||
|   }, |   }, | ||||||
|   props: { |   props: { | ||||||
|     form: { default: () => ({ sysInfo: {} }) }, |     form: Object, | ||||||
|     title: String |     title: String | ||||||
|   }, |   }, | ||||||
|   watch: { |   watch: { | ||||||
|     form: { |     form: { | ||||||
|       handler(v) { |       handler() { | ||||||
|         this.$emit("input", v) |         this.$emit("input", this.form) | ||||||
|       }, |       }, | ||||||
|       deep: true |       deep: true | ||||||
|     } |     } | ||||||
| @@ -26,14 +26,14 @@ export default { | |||||||
|       <ai-dialog-btn text="设置系统信息" dialogTitle="系统信息"> |       <ai-dialog-btn text="设置系统信息" dialogTitle="系统信息"> | ||||||
|         <el-form size="small" label-width="140px"> |         <el-form size="small" label-width="140px"> | ||||||
|           <el-form-item label="系统标题"> |           <el-form-item label="系统标题"> | ||||||
|             <el-input v-model="form.sysInfo.fullTitle" placeholder="请输入..." clearable /> |             <el-input v-model="form.sysInfo.fullTitle" placeholder="请输入..." clearable/> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|           <el-form-item label="favicon"> |           <el-form-item label="favicon"> | ||||||
|             <el-input v-model="form.sysInfo.favicon" placeholder="请输入..." clearable /> |             <el-input v-model="form.sysInfo.favicon" placeholder="请输入..." clearable/> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|           <el-form-item label="logo"> |           <el-form-item label="logo"> | ||||||
|             <el-row type="flex"> |             <el-row type="flex"> | ||||||
|               <el-input v-model="form.sysInfo.logo" placeholder="请输入..." clearable /> |               <el-input v-model="form.sysInfo.logo" placeholder="请输入..." clearable/> | ||||||
|               <el-input class="mar-l10" v-model="form.sysInfo.logoText" placeholder="logo文字"> |               <el-input class="mar-l10" v-model="form.sysInfo.logoText" placeholder="logo文字"> | ||||||
|                 <template #prepend>logo文字</template> |                 <template #prepend>logo文字</template> | ||||||
|               </el-input> |               </el-input> | ||||||
| @@ -56,30 +56,29 @@ export default { | |||||||
|                 <template #prepend>左上角副标题</template> |                 <template #prepend>左上角副标题</template> | ||||||
|               </el-input> |               </el-input> | ||||||
|             </el-row> |             </el-row> | ||||||
|             <el-input class="mar-t10" type="textarea" rows="5" v-model="form.sysInfo.desc" placeholder="副标题" |             <el-input class="mar-t10" type="textarea" rows="5" v-model="form.sysInfo.desc" placeholder="副标题" clearable/> | ||||||
|               clearable /> |  | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|           <el-row type="flex"> |           <el-row type="flex"> | ||||||
|             <div class="fill"> |             <div class="fill"> | ||||||
|               <el-form-item label="版权所有"> |               <el-form-item label="版权所有"> | ||||||
|                 <el-input v-model="form.sysInfo.recordDesc" placeholder="请输入..." clearable /> |                 <el-input v-model="form.sysInfo.recordDesc" placeholder="请输入..." clearable/> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|               <el-form-item label="备案号"> |               <el-form-item label="备案号"> | ||||||
|                 <el-input v-model="form.sysInfo.recordNo" placeholder="请输入..." clearable /> |                 <el-input v-model="form.sysInfo.recordNo" placeholder="请输入..." clearable/> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|             </div> |             </div> | ||||||
|             <div class="fill"> |             <div class="fill"> | ||||||
|               <el-form-item label="框架版本"> |               <el-form-item label="框架版本"> | ||||||
|                 <!--edition :版本,标准版:standard、上架版:saas 简易版(不带扫码):simple --> |                 <!--edition :版本,标准版:standard、上架版:saas 简易版(不带扫码):simple --> | ||||||
|                 <el-input v-model="form.sysInfo.edition" placeholder="请输入..." clearable /> |                 <el-input v-model="form.sysInfo.edition" placeholder="请输入..." clearable/> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|               <el-form-item label="备案跳转链接"> |               <el-form-item label="备案跳转链接"> | ||||||
|                 <el-input v-model="form.sysInfo.recordURL" placeholder="请输入..." clearable /> |                 <el-input v-model="form.sysInfo.recordURL" placeholder="请输入..." clearable/> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|             </div> |             </div> | ||||||
|           </el-row> |           </el-row> | ||||||
|           <el-form-item label="可信证书"> |           <el-form-item label="可信证书"> | ||||||
|             <el-input type="textarea" v-model="form.sysInfo.ssl" placeholder="请输入可信证书的html代码" clearable rows="5" /> |             <el-input type="textarea" v-model="form.sysInfo.ssl" placeholder="请输入可信证书的html代码" clearable rows="5"/> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-form> |         </el-form> | ||||||
|       </ai-dialog-btn> |       </ai-dialog-btn> | ||||||
| @@ -94,23 +93,25 @@ export default { | |||||||
|         <el-checkbox v-model="form.appQRCode">手机APP</el-checkbox> |         <el-checkbox v-model="form.appQRCode">手机APP</el-checkbox> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
|       <el-form-item label="接口是否单服务"> |       <el-form-item label="接口是否单服务"> | ||||||
|         <el-checkbox v-model="form.isSingleService" /> |         <el-checkbox v-model="form.isSingleService"/> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
|       <el-form-item label="域名根目录"> |       <el-form-item label="域名根目录"> | ||||||
|         <el-input v-model="form.base" clearable placeholder="填写域名根目录(baseURL)" /> |         <el-input v-model="form.base" clearable placeholder="填写域名根目录(baseURL)"/> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
|       <el-form-item label="默认首页"> |       <el-form-item label="默认首页"> | ||||||
|         <el-input v-model="form.homePage" clearable placeholder="填写应用的文件名" /> |         <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> | ||||||
|       <el-form-item label="开启百度流量"> |       <el-form-item label="开启百度流量"> | ||||||
|         <el-checkbox v-model="form.hmt" /> |         <el-checkbox v-model="form.hmt"/> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
|       <el-form-item label="是否加载AI助手"> |       <el-form-item label="是否加载AI助手"> | ||||||
|         <el-checkbox v-model="form.copilot" /> |         <el-checkbox v-model="form.copilot"/> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
|     </template> |     </template> | ||||||
|   </ai-card> |   </ai-card> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
|  | <style scoped lang="scss"> | ||||||
|  | .webConfig { | ||||||
|  | } | ||||||
|  | </style> | ||||||
|   | |||||||
| @@ -10,20 +10,14 @@ export default { | |||||||
|   }, |   }, | ||||||
|   props: { |   props: { | ||||||
|     form: Object, |     form: Object, | ||||||
|     title: String, |     title: String | ||||||
|     appList: {default: () => []} |  | ||||||
|   }, |   }, | ||||||
|   watch: { |   watch: { | ||||||
|     form: { |     form: { | ||||||
|       handler(v) { |       handler() { | ||||||
|         this.$emit("input", v) |         this.$emit("input", this.form) | ||||||
|       }, |       }, | ||||||
|       deep: true |       deep: true | ||||||
|     }, |  | ||||||
|     tabBar: { |  | ||||||
|       deep: true, handler(v) { |  | ||||||
|         this.$emit("input", {...this.form, tabBar: {...v, list: v.list.filter(e => !!e.pagePath) || []}}) |  | ||||||
|       } |  | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   data() { |   data() { | ||||||
| @@ -63,11 +57,6 @@ export default { | |||||||
|       this.tabBar.list.splice(i, 1, this.tabBar.list[i + offset]) |       this.tabBar.list.splice(i, 1, this.tabBar.list[i + offset]) | ||||||
|       this.tabBar.list.splice(i + offset, 1, row) |       this.tabBar.list.splice(i + offset, 1, row) | ||||||
|     } |     } | ||||||
|   }, |  | ||||||
|   created() { |  | ||||||
|     if (this.form.tabBar?.list?.length > 0) { |  | ||||||
|       this.tabBar = this.form.tabBar |  | ||||||
|     } |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
|   | |||||||
| @@ -1,128 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,263 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,43 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,85 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,135 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,182 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,110 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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", "productType") |  | ||||||
|   }, |  | ||||||
| } |  | ||||||
| </script> |  | ||||||
|  |  | ||||||
| <template> |  | ||||||
|   <section class="AppClaimApply"> |  | ||||||
|     <component :is="currentPage" v-bind="$props" /> |  | ||||||
|   </section> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <style scoped lang="scss"> |  | ||||||
| .AppClaimApply { |  | ||||||
|   height: 100%; |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
| @@ -1,147 +0,0 @@ | |||||||
| <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: [], list: [] }, |  | ||||||
|       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 |  | ||||||
|           detail.detailList = detail.detailList || [] |  | ||||||
|           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="dict.getLabel('productType',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.map(e=>({biochipEarNumber:e}))" :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> |  | ||||||
| @@ -1,123 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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", "productType") |  | ||||||
|   }, |  | ||||||
| } |  | ||||||
| </script> |  | ||||||
|  |  | ||||||
| <template> |  | ||||||
|   <section class="AppClaimAudit"> |  | ||||||
|     <component :is="currentPage" v-bind="$props" /> |  | ||||||
|   </section> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <style scoped lang="scss"> |  | ||||||
| .AppClaimAudit { |  | ||||||
|   height: 100%; |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
| @@ -1,160 +0,0 @@ | |||||||
| <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="dict.getLabel('productType',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> |  | ||||||
| @@ -1,107 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,155 +0,0 @@ | |||||||
| <script> |  | ||||||
| import { mapState } from "vuex" |  | ||||||
| import AiAudit from "../components/AiAudit.vue"; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
|   name: "deathAdd", |  | ||||||
|   props: { |  | ||||||
|     instance: Function, |  | ||||||
|     permissions: Function, |  | ||||||
|     dict: Object |  | ||||||
|   }, |  | ||||||
|   data() { |  | ||||||
|     return { |  | ||||||
|       detail: { detailList: [] } |  | ||||||
|     } |  | ||||||
|   }, |  | ||||||
|   components:{AiAudit}, |  | ||||||
|   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/getAuditPage", { id }).then(res => { |  | ||||||
|         if (res?.data?.records?.[0]) { |  | ||||||
|           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="dict.getLabel('category', detail.category)" /> |  | ||||||
|           </el-form-item> |  | ||||||
|           <el-form-item label="品种" prop="variety"> |  | ||||||
|             <b v-text="dict.getLabel('variety', 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-audit @change="v => $set(detail, 'auditStatus', v)" /> |  | ||||||
|             </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> |  | ||||||
| @@ -1,112 +0,0 @@ | |||||||
| <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/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"> |  | ||||||
| .deathList { |  | ||||||
|   height: 100%; |  | ||||||
|  |  | ||||||
|   .deleteBtn { |  | ||||||
|     color: $errorColor; |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,167 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,142 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,32 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,202 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,142 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,36 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,165 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,121 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,201 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,106 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,177 +0,0 @@ | |||||||
| <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="dict.getLabel('productType', 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> |  | ||||||
| @@ -1,119 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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", "productType") |  | ||||||
|   }, |  | ||||||
| } |  | ||||||
| </script> |  | ||||||
|  |  | ||||||
| <template> |  | ||||||
|   <section class="AppInsuranceAudit"> |  | ||||||
|     <component :is="currentPage" v-bind="$props" /> |  | ||||||
|   </section> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <style scoped lang="scss"> |  | ||||||
| .AppInsuranceAudit { |  | ||||||
|   height: 100%; |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
| @@ -1,228 +0,0 @@ | |||||||
| <script> |  | ||||||
| import { mapState } from "vuex" |  | ||||||
| import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue"; |  | ||||||
| import AiIdcardRemote from "@project/xumu/components/AiIdcardRemote.vue"; |  | ||||||
| import AiAudit from "../components/AiAudit.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, AiAudit }, |  | ||||||
|   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 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/addOrEditOffline", { ...this.detail, earNumberList }).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?.[0]) { |  | ||||||
|           const { id } = res.data[0] |  | ||||||
|           this.$set(this.detail, "farmId", id) |  | ||||||
|           this.$set(this.detail, "targetUser", userId) |  | ||||||
|         } |  | ||||||
|       }) |  | ||||||
|     } |  | ||||||
|   }, |  | ||||||
|   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=${detail.targetUser}`" :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="dict.getLabel('productType', 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="auditStatus" |  | ||||||
|             :rules="[{ required: true, type: 'enum', enum: [2, 3], message: '请选择是否同意' },]"> |  | ||||||
|             <ai-audit @change="v => $set(detail, 'auditStatus', v)" /> |  | ||||||
|           </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="orderNo" :rules="{ required: true, message: '请输入 保单订单号' }" |  | ||||||
|             v-if="detail.auditStatus == 2"> |  | ||||||
|             <ai-input v-model="detail.orderNo" /> |  | ||||||
|           </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> |  | ||||||
| @@ -1,108 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,188 +0,0 @@ | |||||||
| <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 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/loan/apply/addOrEdit", { ...this.detail, submitType, earNumberList }).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> |  | ||||||
| @@ -1,118 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,248 +0,0 @@ | |||||||
| <script> |  | ||||||
| import { mapState } from "vuex" |  | ||||||
| import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue"; |  | ||||||
| import AiIdcardRemote from "@project/xumu/components/AiIdcardRemote.vue"; |  | ||||||
| import AiAudit from "../components/AiAudit.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, AiAudit }, |  | ||||||
|   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-audit @change="v => $set(detail, 'auditStatus', v)" /> |  | ||||||
|             </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: detail.auditStatus == 2, 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> |  | ||||||
| @@ -1,108 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,157 +0,0 @@ | |||||||
| <script> |  | ||||||
| import { mapState } from "vuex" |  | ||||||
| import AiAudit from "../components/AiAudit.vue"; |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
|   name: "oaAdd", |  | ||||||
|   props: { |  | ||||||
|     instance: Function, |  | ||||||
|     permissions: Function, |  | ||||||
|     dict: Object |  | ||||||
|   }, |  | ||||||
|   components:{AiAudit}, |  | ||||||
|   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/getAuditPage", { id }).then(res => { |  | ||||||
|         if (res?.data?.records?.[0]) { |  | ||||||
|           const detail = res.data.records[0] || {} |  | ||||||
|           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="dict.getLabel('category',detail.category)" /> |  | ||||||
|           </el-form-item> |  | ||||||
|           <el-form-item label="品种" prop="variety"> |  | ||||||
|             <b v-text="dict.getLabel('variety',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-audit @change="v => $set(detail, 'auditStatus', v)" /> |  | ||||||
|             </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> |  | ||||||
| @@ -1,112 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,170 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,143 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,407 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,193 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,192 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,147 +0,0 @@ | |||||||
| <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(() => { |  | ||||||
|         const earNumberList = this.detail.detailList.map(e => e.biochipEarNumber) |  | ||||||
|         this.instance.post("/api/sell/apply/add", { ...this.detail, earNumberList }).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"> |  | ||||||
|             <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.map(e=>({biochipEarNumber:e}))" :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> |  | ||||||
| @@ -1,103 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,149 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,102 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,231 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,186 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,106 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,35 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,144 +0,0 @@ | |||||||
| <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> |  | ||||||
| @@ -1,105 +0,0 @@ | |||||||
| <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"}, |  | ||||||
|   {label: "品种", prop: "variety", dict: "variety"}, |  | ||||||
|   {label: "称重日期", prop: "todayCreateTime", width: 160}, |  | ||||||
|   {label: "当日体重(公斤)", prop: "todayWeight", width: 120}, |  | ||||||
|   {label: "上次称重日期", prop: "lastCreateTime", width: 160}, |  | ||||||
|   {label: "上次体重(公斤)", prop: "lastWeight", width: 120}, |  | ||||||
| ] |  | ||||||
| export default { |  | ||||||
|   name: "weightList", |  | ||||||
|   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/weight/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="weightList" :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.category" dict="category"/> |  | ||||||
|         <ai-select placeholder="全部品种" v-model="search.variety" dict="variety"/> |  | ||||||
|         <el-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber" dict="authStatus" size="small" clearable/> |  | ||||||
|         <ai-search label="称重日期"> |  | ||||||
|           <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.weightBeginDate" type="datetime" placeholder="开始日期" size="small"/> |  | ||||||
|           <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.weightEndDate" type="datetime" placeholder="结束日期" size="small"/> |  | ||||||
|         </ai-search> |  | ||||||
|       </template> |  | ||||||
|     </ai-search-bar> |  | ||||||
|     <ai-search-bar> |  | ||||||
|       <template #left> |  | ||||||
|         <ai-download :instance="instance" url="/api/breed/weight/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"> |  | ||||||
| .weightList { |  | ||||||
|   height: 100%; |  | ||||||
|  |  | ||||||
|   .deleteBtn { |  | ||||||
|     color: $errorColor; |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
| @@ -1,19 +0,0 @@ | |||||||
| <script> |  | ||||||
| const options = [ |  | ||||||
|   { dictValue: 2, dictName: '同意' }, |  | ||||||
|   { dictValue: 3, dictName: '不同意' } |  | ||||||
| ] |  | ||||||
| export default { |  | ||||||
|   name: "AiAudit", |  | ||||||
|   data() { |  | ||||||
|     return { |  | ||||||
|       options, auditStatus: "" |  | ||||||
|     } |  | ||||||
|   }, |  | ||||||
| } |  | ||||||
| </script> |  | ||||||
| <template> |  | ||||||
|   <section class="AiAudit"> |  | ||||||
|     <ai-select v-model="auditStatus" :select-list="options" v-bind="$attrs" v-on="$listeners" /> |  | ||||||
|   </section> |  | ||||||
| </template> |  | ||||||
| @@ -1,115 +0,0 @@ | |||||||
| <script> |  | ||||||
| export default { |  | ||||||
|   name: "AiEartagPicker", |  | ||||||
|   props: { |  | ||||||
|     instance: Function, |  | ||||||
|     value: { default: () => [] }, |  | ||||||
|     action: { default: "/api/breed/earTag/getEarTagByPenId" }, |  | ||||||
|     penId: String, |  | ||||||
|     valueKey: { type: String, default: "biochipEarNumber" } |  | ||||||
|   }, |  | ||||||
|   model: { |  | ||||||
|     prop: "value", |  | ||||||
|     event: "input" |  | ||||||
|   }, |  | ||||||
|   data() { |  | ||||||
|     return { |  | ||||||
|       list: [], |  | ||||||
|       dialog: false, |  | ||||||
|       selected: [], |  | ||||||
|       origin: [] |  | ||||||
|     } |  | ||||||
|   }, |  | ||||||
|   computed: { |  | ||||||
|     api: v => { |  | ||||||
|       let url = v.action |  | ||||||
|       if (v.penId) { |  | ||||||
|         url += `?penId=${v.penId}` |  | ||||||
|       } |  | ||||||
|       return url |  | ||||||
|     } |  | ||||||
|   }, |  | ||||||
|   watch: { |  | ||||||
|     api: { |  | ||||||
|       immediate: true, |  | ||||||
|       handler() { |  | ||||||
|         this.getEartag() |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|   }, |  | ||||||
|   methods: { |  | ||||||
|     getEartag() { |  | ||||||
|       !/undefined/.test(this.api) && this.instance.post(this.api).then(res => { |  | ||||||
|         if (res?.data) { |  | ||||||
|           const key = this.valueKey |  | ||||||
|           this.origin = res.data ?? [] |  | ||||||
|           this.list = res.data?.map(v => { |  | ||||||
|             if (typeof v == 'string') { |  | ||||||
|               return { key: v, label: v } |  | ||||||
|             } else if (key) { |  | ||||||
|               return { key: v[key], label: v[key] } |  | ||||||
|             } |  | ||||||
|           }) || [] |  | ||||||
|         } |  | ||||||
|       }) |  | ||||||
|     }, |  | ||||||
|     handleConfirm() { |  | ||||||
|       this.dialog = false |  | ||||||
|       this.$emit("input", this.selected) |  | ||||||
|       this.$emit("select", this.origin.filter(v => this.selected.includes(v?.[this.valueKey] ?? v))) |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| </script> |  | ||||||
|  |  | ||||||
| <template> |  | ||||||
|   <section class="AiEartagPicker"> |  | ||||||
|     <div style="width: auto;" v-if="$slots.default" @click="dialog = true"> |  | ||||||
|       <slot /> |  | ||||||
|     </div> |  | ||||||
|     <el-select v-else :value="value" clearable multiple placeholder="请选择"> |  | ||||||
|       <el-option v-for="(op, i) in list" :key="i" :label="op.label" :value="op.key" /> |  | ||||||
|       <div slot="prefix" @click.stop="dialog = true" /> |  | ||||||
|     </el-select> |  | ||||||
|     <ai-dialog v-model="dialog" title="选择牲畜" width="800px" @confirm="handleConfirm" @closed="selected = []" |  | ||||||
|       @open="selected = value"> |  | ||||||
|       <el-transfer :data="list" v-model="selected" :titles="['可选', '已选择']" /> |  | ||||||
|     </ai-dialog> |  | ||||||
|   </section> |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <style scoped lang="scss"> |  | ||||||
| .AiEartagPicker { |  | ||||||
|   width: 100%; |  | ||||||
|  |  | ||||||
|   :deep(.el-select) { |  | ||||||
|     width: 100%; |  | ||||||
|     position: relative; |  | ||||||
|  |  | ||||||
|     .el-input__inner { |  | ||||||
|       padding-left: 15px !important; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     .el-input__prefix { |  | ||||||
|       left: 0; |  | ||||||
|       right: 0; |  | ||||||
|       z-index: 999; |  | ||||||
|  |  | ||||||
|       &>div { |  | ||||||
|         height: 100%; |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   :deep(.el-transfer) { |  | ||||||
|     display: flex; |  | ||||||
|     justify-content: center; |  | ||||||
|     align-items: center; |  | ||||||
|  |  | ||||||
|     .el-transfer-panel { |  | ||||||
|       width: auto; |  | ||||||
|       min-width: 200px; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
| @@ -1,40 +0,0 @@ | |||||||
| <script> |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
|   name: "AiEartagRemote", |  | ||||||
|   props: { |  | ||||||
|     instance: Function |  | ||||||
|   }, |  | ||||||
|   data() { |  | ||||||
|     return { |  | ||||||
|       value: "", |  | ||||||
|       info: {} |  | ||||||
|     } |  | ||||||
|   }, |  | ||||||
|   methods: { |  | ||||||
|     getText(biochipEarNumber) { |  | ||||||
|       this.info = {} |  | ||||||
|       return this.instance.post("/api/breed/earTag/page", {biochipEarNumber, pageSize: 10, pageNum: 1}).then(res => { |  | ||||||
|         if (res?.data?.records) { |  | ||||||
|           this.info = res.data.records[0] |  | ||||||
|           this.$emit('enter', this.info) |  | ||||||
|         } |  | ||||||
|       }) |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| </script> |  | ||||||
|  |  | ||||||
| <template> |  | ||||||
|   <section class="AiEartagRemote"> |  | ||||||
|     <ai-input v-model="value" placeholder="请输入耳标号按回车查询,或扫描耳标号" @keyup.enter.native="getText(value)"/> |  | ||||||
|   </section> |  | ||||||
|  |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <style scoped lang="scss"> |  | ||||||
| .AiEartagRemote { |  | ||||||
|   gap: 8px; |  | ||||||
|   width: 100%; |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
| @@ -1,48 +0,0 @@ | |||||||
| <script> |  | ||||||
|  |  | ||||||
| export default { |  | ||||||
|   name: "AiIdcardRemote", |  | ||||||
|   props: { |  | ||||||
|     instance: Function |  | ||||||
|   }, |  | ||||||
|   data() { |  | ||||||
|     return { |  | ||||||
|       value: "", |  | ||||||
|       info: {} |  | ||||||
|     } |  | ||||||
|   }, |  | ||||||
|   computed: { |  | ||||||
|     infoText: v => [v.info.name, v.info.idCard].filter(Boolean)?.join('  ')?.trim() |  | ||||||
|   }, |  | ||||||
|   methods: { |  | ||||||
|     getText(idCard) { |  | ||||||
|       this.info = {} |  | ||||||
|       if (!this.ID.check(idCard)) return this.$message.error("请输入正确的身份证号") |  | ||||||
|       return this.instance.post("/api/user/getUserByIdCard", null, {params: {idCard}}).then(res => { |  | ||||||
|         if (res?.data) { |  | ||||||
|           this.info = res.data |  | ||||||
|           this.$emit('enter', this.info.id) |  | ||||||
|         } |  | ||||||
|       }) |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| </script> |  | ||||||
|  |  | ||||||
| <template> |  | ||||||
|   <section class="AiIdcardRemote flex"> |  | ||||||
|     <ai-input v-model="value" @keyup.enter.native="getText(value)"/> |  | ||||||
|     <b class="text" v-text="infoText"/> |  | ||||||
|   </section> |  | ||||||
|  |  | ||||||
| </template> |  | ||||||
|  |  | ||||||
| <style scoped lang="scss"> |  | ||||||
| .AiIdcardRemote { |  | ||||||
|   gap: 8px; |  | ||||||
|  |  | ||||||
|   .AiInput { |  | ||||||
|     min-width: 300px; |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
							
								
								
									
										
											BIN
										
									
								
								public/favicon.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								public/favicon.ico
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 4.2 KiB | 
| @@ -4,17 +4,18 @@ | |||||||
|     <meta charset="utf-8"> |     <meta charset="utf-8"> | ||||||
|     <meta http-equiv="X-UA-Compatible" content="IE=edge"> |     <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||||||
|     <meta name="viewport" content="width=device-width,initial-scale=1.0"> |     <meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||||||
|     <link rel="stylesheet" href="<%= BASE_URL %>cdn/viewerjs/1.11.6/viewer.css"/> |     <link rel="icon" href="<%= assetPrefix %>favicon.ico"/> | ||||||
|     <link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/2.10.18/index.css"> |     <link rel="stylesheet" href="<%= assetPrefix %>cdn/viewerjs/1.11.6/viewer.css"/> | ||||||
|     <link rel="stylesheet" href="<%= BASE_URL %>cdn/jsoneditor/10.0.2/jsoneditor.min.css"> |     <link rel="stylesheet" href="<%= assetPrefix %>cdn/avue/2.10.18/index.css"> | ||||||
|     <link rel="stylesheet" href="<%= BASE_URL %>cdn/highlight/atom-one-dark.min.css"> |     <link rel="stylesheet" href="<%= assetPrefix %>cdn/jsoneditor/10.0.2/jsoneditor.min.css"> | ||||||
|     <script src="<%= BASE_URL %>cdn/jsoneditor/10.0.2/jsoneditor.min.js" charset="utf-8"></script> |     <link rel="stylesheet" href="<%= assetPrefix %>cdn/highlight/atom-one-dark.min.css"> | ||||||
|     <script src="<%= BASE_URL %>cdn/viewerjs/1.11.6/viewer.min.js" charset="utf-8"></script> |     <script src="<%= assetPrefix %>cdn/jsoneditor/10.0.2/jsoneditor.min.js" charset="utf-8"></script> | ||||||
|     <script src="<%= BASE_URL %>cdn/avue/2.10.18/avue.min.js" charset="utf-8"></script> |     <script src="<%= assetPrefix %>cdn/viewerjs/1.11.6/viewer.min.js" charset="utf-8"></script> | ||||||
|     <script src="<%= BASE_URL %>cdn/echarts/echarts@5.5.0.min.js" charset="utf-8"></script> |     <script src="<%= assetPrefix %>cdn/avue/2.10.18/avue.min.js" charset="utf-8"></script> | ||||||
|     <script src="<%= BASE_URL %>cdn/echarts/echarts-gl@2.0.9.min.js" charset="utf-8"></script> |     <script src="<%= assetPrefix %>cdn/echarts/echarts@5.5.0.min.js" charset="utf-8"></script> | ||||||
|     <script src="<%= BASE_URL %>cdn/markdown-it/markdown-it.min.js" charset="utf-8"></script> |     <script src="<%= assetPrefix %>cdn/echarts/echarts-gl@2.0.9.min.js" charset="utf-8"></script> | ||||||
|     <script src="<%= BASE_URL %>cdn/highlight/highlight.min.js" charset="utf-8"></script> |     <script src="<%= assetPrefix %>cdn/markdown-it/markdown-it.min.js" charset="utf-8"></script> | ||||||
|  |     <script src="<%= assetPrefix %>cdn/highlight/highlight.min.js" charset="utf-8"></script> | ||||||
|     <title>web端应用库-展示页面</title> |     <title>web端应用库-展示页面</title> | ||||||
|     <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js" referrerpolicy="origin"></script> |     <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js" referrerpolicy="origin"></script> | ||||||
|     <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js" referrerpolicy="origin"></script> |     <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js" referrerpolicy="origin"></script> | ||||||
|   | |||||||
							
								
								
									
										70
									
								
								rsbuild.config.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								rsbuild.config.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,70 @@ | |||||||
|  | import {defineConfig} from '@rsbuild/core'; | ||||||
|  | import {pluginVue2} from '@rsbuild/plugin-vue2'; | ||||||
|  | import {pluginSass} from '@rsbuild/plugin-sass'; | ||||||
|  | import {pluginBabel} from '@rsbuild/plugin-babel'; | ||||||
|  | import path from "path"; | ||||||
|  |  | ||||||
|  | const proxy = process.env.VUE_APP_API || "http://192.168.1.87:9000" | ||||||
|  | const port = process.env.VUE_APP_PORT || 7000 | ||||||
|  | const entry = process.env.NODE_ENV == "production" ? "./src/main.js" : "./examples/main.js" | ||||||
|  | console.log("当前模式:", process.env.NODE_ENV) | ||||||
|  | console.log("当前后台服务地址:", proxy, "\n") | ||||||
|  | export default defineConfig({ | ||||||
|  |   plugins: [pluginVue2(), | ||||||
|  |     pluginSass({ | ||||||
|  |       sassLoaderOptions: { | ||||||
|  |         additionalData: `@import "~dui/lib/styles/vars.scss";` | ||||||
|  |       } | ||||||
|  |     }), | ||||||
|  |     // pluginBabel({ | ||||||
|  |     //   include: [ | ||||||
|  |     //     path.resolve(__dirname, 'packages'), | ||||||
|  |     //     path.resolve(__dirname, 'project'), | ||||||
|  |     //     path.resolve(__dirname, 'examples'), | ||||||
|  |     //     path.resolve(__dirname, 'src'), | ||||||
|  |     //     path.resolve(__dirname, 'ui/packages'), | ||||||
|  |     //     path.resolve(__dirname, 'ui/dv'), | ||||||
|  |     //     path.resolve(__dirname, 'ui/lib/js'), | ||||||
|  |     //   ] | ||||||
|  |     // }) | ||||||
|  |   ], | ||||||
|  |   source: { | ||||||
|  |     // 指定入口文件 | ||||||
|  |     entry: { | ||||||
|  |       index: entry, | ||||||
|  |     }, | ||||||
|  |     alias: { | ||||||
|  |       '@packages': path.resolve(__dirname, 'packages'), | ||||||
|  |       '@project': path.resolve(__dirname, 'project'), | ||||||
|  |       'dui': path.resolve(__dirname, 'ui'), | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   html: { | ||||||
|  |     template: './public/index.html', | ||||||
|  |   }, | ||||||
|  |   server: { | ||||||
|  |     host: '0.0.0.0', //主机地址 | ||||||
|  |     port, //端口号 | ||||||
|  |     open: true, | ||||||
|  |     proxy: { | ||||||
|  |       //设置代理,可解决跨 | ||||||
|  |       '/lan': { | ||||||
|  |         target: proxy, | ||||||
|  |         changeOrigin: true, | ||||||
|  |         pathRewrite: { | ||||||
|  |           //地址重写 | ||||||
|  |           '^/lan': '/' | ||||||
|  |         } | ||||||
|  |       }, | ||||||
|  |       '/sse': { | ||||||
|  |         target: "http://192.168.1.87:10409/v1", | ||||||
|  |         changeOrigin: true, | ||||||
|  |         pathRewrite: { | ||||||
|  |           //地址重写 | ||||||
|  |           '^/sse': '/' | ||||||
|  |         } | ||||||
|  |       }, | ||||||
|  |     }, | ||||||
|  |     disableHostCheck: true, | ||||||
|  |   } | ||||||
|  | }); | ||||||
| @@ -78,7 +78,7 @@ export default { | |||||||
|           }) |           }) | ||||||
|           break; |           break; | ||||||
|         case 'user': |         case 'user': | ||||||
|           this.$router.push({name: "AppUserInfo"}) |           this.$router.push({name: "个人中心"}) | ||||||
|           break; |           break; | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| <template> | <template> | ||||||
|   <section class="mainContent"> |   <section class="mainContent"> | ||||||
|     <ai-nav-tab :fixed="$HomePage" :routes="routes"/> |     <ai-nav-tab :fixed="homePage" :routes="routes"/> | ||||||
|     <router-view v-if="refresh"/> |     <router-view v-if="refresh"/> | ||||||
|   </section> |   </section> | ||||||
| </template> | </template> | ||||||
| @@ -11,8 +11,8 @@ import {mapState} from "vuex"; | |||||||
| export default { | export default { | ||||||
|   name: "mainContent", |   name: "mainContent", | ||||||
|   computed: { |   computed: { | ||||||
|     ...mapState(['user']), |     ...mapState(['user', 'homePage']), | ||||||
|     routes: v => v.user.info?.menuSet?.map(e => ({...e, label: e.name, name: e.component})) |     routes: v => v.user.info?.menuSet?.map(e => ({...e, label: e.name, name: e.id})) | ||||||
|   }, |   }, | ||||||
|   watch: { |   watch: { | ||||||
|     $route(v, old) { |     $route(v, old) { | ||||||
|   | |||||||
| @@ -28,6 +28,7 @@ | |||||||
|  |  | ||||||
| <script> | <script> | ||||||
| import {mapGetters} from "vuex"; | import {mapGetters} from "vuex"; | ||||||
|  | import qs from "querystring"; | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
|   name: "sliderNav", |   name: "sliderNav", | ||||||
| @@ -39,12 +40,11 @@ export default { | |||||||
|   }, |   }, | ||||||
|   computed: { |   computed: { | ||||||
|     ...mapGetters(['mods']), |     ...mapGetters(['mods']), | ||||||
|     navs: v => [v.$HomePage, ...v.sortList(v.menuList)], |     navs: v => v.sortList(v.menuList), | ||||||
|     menuPath() { |     menuPath() { | ||||||
|       const mods = [this.$HomePage, ...this.mods] |       let paths = [], current = this.mods?.find(e => e.route == this.$route.name) | ||||||
|       let paths = [], current = mods?.find(e => e.component == this.$route.name) |  | ||||||
|       const findParent = id => { |       const findParent = id => { | ||||||
|         let menu = mods?.find(e => e.id == id) |         let menu = this.mods?.find(e => e.id == id) | ||||||
|         if (menu) { |         if (menu) { | ||||||
|           paths.push(menu.id) |           paths.push(menu.id) | ||||||
|           if (!!menu.parentId) findParent(menu.parentId) |           if (!!menu.parentId) findParent(menu.parentId) | ||||||
| @@ -80,11 +80,12 @@ export default { | |||||||
|       if (item.route == this.$route.name) { |       if (item.route == this.$route.name) { | ||||||
|         //避免同一路由跳转的BUG vue-router官方BUG |         //避免同一路由跳转的BUG vue-router官方BUG | ||||||
|       } else { |       } else { | ||||||
|         let {component, path} = item, urlParams = '' |         let {route: name, path} = item | ||||||
|         if (path.indexOf('?') > -1) { |         if (!name) { | ||||||
|           urlParams = path.split('?').at(-1) |           this.$message.warning("暂无应用") | ||||||
|  |         } else { | ||||||
|  |           this.goto({name, query: qs.parse(path.split("?")?.[1])}) | ||||||
|         } |         } | ||||||
|         this.goto({path: `/v/${[component, urlParams].filter(Boolean).join("?")}`}) |  | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     goto(item) { |     goto(item) { | ||||||
| @@ -108,6 +109,7 @@ export default { | |||||||
|           } |           } | ||||||
|         } |         } | ||||||
|         list.forEach(e => findParent(e)) |         list.forEach(e => findParent(e)) | ||||||
|  |         console.log(map, list) | ||||||
|         this.initMenu(Object.values(map)) |         this.initMenu(Object.values(map)) | ||||||
|       } else { |       } else { | ||||||
|         this.initMenu() |         this.initMenu() | ||||||
| @@ -217,7 +219,7 @@ export default { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   :deep(.ai-menu ) { |   :deep(.ai-menu ){ | ||||||
|     padding-left: 0; |     padding-left: 0; | ||||||
|     flex: 1; |     flex: 1; | ||||||
|     min-height: 0; |     min-height: 0; | ||||||
| @@ -231,7 +233,7 @@ export default { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   :deep(.searchApp ) { |   :deep(.searchApp ){ | ||||||
|     display: flex; |     display: flex; | ||||||
|     align-items: center; |     align-items: center; | ||||||
|     height: 44px; |     height: 44px; | ||||||
|   | |||||||
| @@ -6,6 +6,7 @@ import utils from './utils'; | |||||||
| import vcUI from 'dui/packages'; | import vcUI from 'dui/packages'; | ||||||
| import appComp from 'dui/dv'; | import appComp from 'dui/dv'; | ||||||
| import store from './utils/store'; | import store from './utils/store'; | ||||||
|  | import autoRoutes from "./utils/autoRoutes"; | ||||||
| import extra from "./config.json" | import extra from "./config.json" | ||||||
| import axios from "./utils/axios"; | import axios from "./utils/axios"; | ||||||
| //备注底座信息,勿删 | //备注底座信息,勿删 | ||||||
| @@ -17,10 +18,8 @@ Vue.use(appComp); | |||||||
| Vue.config.productionTip = false; | Vue.config.productionTip = false; | ||||||
| Vue.prototype.$cdn = "https://cdn.cunwuyun.cn" | Vue.prototype.$cdn = "https://cdn.cunwuyun.cn" | ||||||
| Vue.prototype.$request = axios | Vue.prototype.$request = axios | ||||||
| const home = extra.homePage || 'console' |  | ||||||
| Vue.prototype.$HomePage = {name: '工作台', label: '工作台', component: home, id: `/v/${home}`, path: `/v/${home}`, style: "iconfont iconNav_Dashborad"} |  | ||||||
| Object.keys(utils).map((e) => (Vue.prototype[e] = utils[e])); | Object.keys(utils).map((e) => (Vue.prototype[e] = utils[e])); | ||||||
| const loadPage = () => new Vue({router, store, render: h => h(App)}).$mount("#app") | const loadPage = () => autoRoutes.init().finally(() => new Vue({router, store, render: h => h(App)}).$mount("#app")) | ||||||
| let theme = null | let theme = null | ||||||
| store.dispatch('getSystem', extra.sysInfo).then(res => { | store.dispatch('getSystem', extra.sysInfo).then(res => { | ||||||
|   theme = JSON.parse(res?.colorScheme || null) |   theme = JSON.parse(res?.colorScheme || null) | ||||||
|   | |||||||
							
								
								
									
										107
									
								
								src/utils/autoRoutes.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										107
									
								
								src/utils/autoRoutes.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,107 @@ | |||||||
|  | import {waiting} from "./index"; | ||||||
|  | import router from "./router"; | ||||||
|  | import store from "./store"; | ||||||
|  | import {Message} from "element-ui"; | ||||||
|  | import Vue from "vue"; | ||||||
|  | import extra from "../config.json" | ||||||
|  |  | ||||||
|  | let {state: {user}, commit, dispatch} = store | ||||||
|  | const signOut = () => commit("signOut"), | ||||||
|  |     getUserInfo = () => dispatch("getUserInfo"), | ||||||
|  |     existRoute = route => { | ||||||
|  |       return router.getRoutes()?.find(e => e.name == route?.name || e.path == route?.path) | ||||||
|  |     }, | ||||||
|  |     goto = (route, next) => { | ||||||
|  |       const exist = !!existRoute(route) | ||||||
|  |       return exist ? route.name ? next() : router.replace(route) : | ||||||
|  |           !route.name && route.path == "/" ? router.replace({name: "Home"}).catch(() => 0) : | ||||||
|  |               Message.error("无法找到路由,请联系系统管理员!") | ||||||
|  |     } | ||||||
|  | const loadApps = () => { | ||||||
|  |   //新App的自动化格式 | ||||||
|  |   waiting.init({innerHTML: '应用加载中..'}) | ||||||
|  |   let apps = require.context('../apps', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, "lazy") | ||||||
|  |   return Promise.all(apps.keys().map(path => apps(path).then(file => { | ||||||
|  |     if (file.default) { | ||||||
|  |       let {name} = file.default | ||||||
|  |       waiting.setContent(`加载${name}...`) | ||||||
|  |       Vue.component(name, file.default) | ||||||
|  |     } else return 0 | ||||||
|  |   }))).then(() => { | ||||||
|  |     waiting.setContent(`正在进入系统...`) | ||||||
|  |     setTimeout(() => waiting.close(), 1000) | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | const addHome = homePage => { | ||||||
|  |   const component = extra?.homePage || homePage.path | ||||||
|  |   if (extra?.homePage && Vue.component(component)) { | ||||||
|  |     homePage = {...homePage, path: component, component: () => import('../views/mainEntry'), meta: component} | ||||||
|  |   } | ||||||
|  |   router.addRoute('Home', homePage) | ||||||
|  |   router.options.routes[2].children.unshift(homePage) | ||||||
|  |   commit("setHomePage", { | ||||||
|  |     ...homePage, | ||||||
|  |     label: homePage.name, | ||||||
|  |     id: `/v/${component}`, | ||||||
|  |     isMenu: 1, | ||||||
|  |     route: homePage.name, | ||||||
|  |     component, | ||||||
|  |     path: component, | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | const generateRoutes = (to, from, next) => { | ||||||
|  |   if (router.options.routes[2].children.length > 0) { | ||||||
|  |     goto(to, next) | ||||||
|  |   } else { | ||||||
|  |     Promise.all([getUserInfo(), loadApps()]).then(() => { | ||||||
|  |       //初始化默认工作台 | ||||||
|  |       let homePage = {name: "工作台", path: "console", style: "iconfont iconNav_Dashborad", component: () => import('../views/console')} | ||||||
|  |       addHome(homePage) | ||||||
|  |       const mods = user.info.menuSet?.filter(e => !!e.component)?.map(e => ({route: e.id, ...e})) | ||||||
|  |       mods?.map(({route: name, path, component}) => { | ||||||
|  |         if (!!Vue.component(component) && path && !existRoute({name})) { | ||||||
|  |           let search = path.split("?") | ||||||
|  |           path = search?.[0] || path | ||||||
|  |           const route = {name, path, component: () => import('../views/mainEntry'), meta: component} | ||||||
|  |           router.addRoute('Home', route) | ||||||
|  |           router.options.routes[2].children.push(route) | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |       to.name == "Home" ? next({name: homePage.name, replace: true}) : next({...to, replace: true}) | ||||||
|  |     }).then(() => commit("setRoutes", router.options.routes[2].children)) | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | export const routes = [ | ||||||
|  |   {path: "/login", name: "登录", component: () => import('../views/sign')}, | ||||||
|  |   {path: '/dv', name: '数据大屏入口', component: () => import('../views/dvIndex')}, | ||||||
|  |   {path: '/v', name: 'Home', component: () => import('../views/home'), children: []}, | ||||||
|  |   {path: '/', name: "init"}, | ||||||
|  | ] | ||||||
|  | export default { | ||||||
|  |   init: () => { | ||||||
|  |     router.beforeEach((to, from, next) => { | ||||||
|  |       console.log('%s=>%s', from.name, to.name) | ||||||
|  |       if (to.hash == "#pddv") { | ||||||
|  |         const {query} = to | ||||||
|  |         dispatch("getToken", { | ||||||
|  |           username: "18971406276", | ||||||
|  |           password: "admin321!" | ||||||
|  |         }).then(() => next({name: "数据大屏入口", query, hash: "#dv"})) | ||||||
|  |       } else if (["数据大屏入口", "登录"].includes(to.name)) { | ||||||
|  |         next() | ||||||
|  |       } else if (to.hash == "#dv") { | ||||||
|  |         //数据大屏进行的独立页面跳转 | ||||||
|  |         let {query, hash} = to | ||||||
|  |         next({name: "数据大屏入口", query, hash}) | ||||||
|  |       } else if (user.token) { | ||||||
|  |         to.name == "init" ? next({name: "Home"}) : generateRoutes(to, from, next) | ||||||
|  |       } else { | ||||||
|  |         signOut() | ||||||
|  |       } | ||||||
|  |     }) | ||||||
|  |     router.onError(err => { | ||||||
|  |       console.error(err) | ||||||
|  |     }) | ||||||
|  |     return Promise.resolve() | ||||||
|  |   } | ||||||
|  | } | ||||||
| @@ -11,7 +11,7 @@ instance.defaults.baseURL = baseURLs[process.env.NODE_ENV] | |||||||
| instance.interceptors.request.use(config => { | instance.interceptors.request.use(config => { | ||||||
|   config.timeout = 300000 |   config.timeout = 300000 | ||||||
|   if (extra?.isSingleService) { |   if (extra?.isSingleService) { | ||||||
|     config.url = config.url.replace(/^\/(app|auth|admin)\//, "/api/") |     config.url = config.url.replace(/(app|auth|admin)\//, "api/") | ||||||
|   } |   } | ||||||
|   if (config.url.startsWith("/node")) { |   if (config.url.startsWith("/node")) { | ||||||
|     config.baseURL = "/ns" |     config.baseURL = "/ns" | ||||||
|   | |||||||
| @@ -1,13 +1,10 @@ | |||||||
| import Vue from 'vue' | import Vue from 'vue' | ||||||
| import VueRouter from 'vue-router' | import VueRouter from 'vue-router' | ||||||
| import routes from "./apps.js" | import {routes} from "./autoRoutes" | ||||||
| import config from "../config.json" | import config from "../config.json" | ||||||
| import store from "@/utils/store"; |  | ||||||
|  |  | ||||||
| const {state: {user}, commit, dispatch} = store |  | ||||||
| const signOut = () => commit("signOut") |  | ||||||
| Vue.use(VueRouter) | Vue.use(VueRouter) | ||||||
| const router = new VueRouter({ | export default new VueRouter({ | ||||||
|   base: config.base || '/', |   base: config.base || '/', | ||||||
|   mode: 'history', |   mode: 'history', | ||||||
|   hashbang: false, |   hashbang: false, | ||||||
| @@ -20,31 +17,3 @@ const router = new VueRouter({ | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
| }) | }) | ||||||
|  |  | ||||||
| router.beforeEach((to, from, next) => { |  | ||||||
|   console.log('%s=>%s', from.name, to.name) |  | ||||||
|   if (to.hash == "#pddv") { |  | ||||||
|     const {query} = to |  | ||||||
|     dispatch("getToken", { |  | ||||||
|       username: "18971406276", |  | ||||||
|       password: "admin321!" |  | ||||||
|     }).then(() => next({name: "数据大屏入口", query, hash: "#dv"})) |  | ||||||
|   } else if (["数据大屏入口", "登录"].includes(to.name)) { |  | ||||||
|     next() |  | ||||||
|   } else if (to.hash == "#dv") { |  | ||||||
|     //数据大屏进行的独立页面跳转 |  | ||||||
|     let {query, hash} = to |  | ||||||
|     next({name: "数据大屏入口", query, hash}) |  | ||||||
|   } else if (to.name == "Home" && user.token && !user.info?.id) { |  | ||||||
|     dispatch("getUserInfo").then(() => next()) |  | ||||||
|   } else if (user.token) { |  | ||||||
|     to.name == "init" ? next({name: "Home"}) : next() |  | ||||||
|   } else { |  | ||||||
|     signOut() |  | ||||||
|   } |  | ||||||
| }) |  | ||||||
| router.onError(err => { |  | ||||||
|   console.error(err) |  | ||||||
| }) |  | ||||||
|  |  | ||||||
| export default router |  | ||||||
|   | |||||||
| @@ -8,22 +8,34 @@ import extra from "../config.json" | |||||||
| Vue.use(Vuex) | Vue.use(Vuex) | ||||||
|  |  | ||||||
| export default new Vuex.Store({ | export default new Vuex.Store({ | ||||||
|   state: {}, |   state: { | ||||||
|  |     homePage: {} | ||||||
|  |   }, | ||||||
|   mutations: { |   mutations: { | ||||||
|  |     setHomePage(state, home) { | ||||||
|  |       state.homePage = home | ||||||
|  |     }, | ||||||
|     signOut(state, flag) { |     signOut(state, flag) { | ||||||
|       const base = extra.base || "" |       const base = extra.base || "" | ||||||
|       new Promise(resolve => { |       if (flag) { | ||||||
|         flag ? resolve() : axios.delete('/auth/token/logout').then(resolve) |         state.user.token = null; | ||||||
|       }).then(() => { |         state.user.info = {} | ||||||
|         localStorage.removeItem("vuex"); |  | ||||||
|         sessionStorage.clear(); |         sessionStorage.clear(); | ||||||
|         location.href = [base, '/login', location.hash].join(''); |         location.href = base + '/login' + location.hash; | ||||||
|       }) |       } else { | ||||||
|  |         axios.delete('/auth/token/logout').then(() => { | ||||||
|  |           state.user.token = null; | ||||||
|  |           sessionStorage.clear(); | ||||||
|  |           state.user.info = {} | ||||||
|  |           location.href = base + '/login'; | ||||||
|  |         }); | ||||||
|  |       } | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   getters: { |   getters: { | ||||||
|     //后台数据库中的应用集合,在本工程中不一定存在 |     //后台数据库中的应用集合,在本工程中不一定存在 | ||||||
|     mods: state => [ |     mods: state => [ | ||||||
|  |       state.homePage, | ||||||
|       state.user.info?.menuSet?.map(e => ({route: e.id, ...e, label: e.name})) |       state.user.info?.menuSet?.map(e => ({route: e.id, ...e, label: e.name})) | ||||||
|     ].flat().filter(Boolean) |     ].flat().filter(Boolean) | ||||||
|   }, |   }, | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ | |||||||
|         <ai-intro :id="currentApp.guideId" :instance="$request" @start="handleStartUse"/> |         <ai-intro :id="currentApp.guideId" :instance="$request" @start="handleStartUse"/> | ||||||
|       </template> |       </template> | ||||||
|     </ai-detail> |     </ai-detail> | ||||||
|     <router-view v-else :instance="$request" :dict="$dict" :permissions="$permissions" :menuName="currentApp.name"/> |     <component v-else :is="app" :instance="$request" :dict="$dict" :permissions="$permissions" :menuName="currentApp.name"/> | ||||||
|   </section> |   </section> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -9,9 +9,8 @@ import CryptoJs from "crypto-js"; | |||||||
| export const $encryption = (params, c = 0) => { | export const $encryption = (params, c = 0) => { | ||||||
|   if (CryptoJs) { |   if (CryptoJs) { | ||||||
|     const key = "thanks,villcloud" |     const key = "thanks,villcloud" | ||||||
|     let password = typeof params == "object" ? params.password : params |  | ||||||
|     let iv = CryptoJs.enc.Latin1.parse(key) |     let iv = CryptoJs.enc.Latin1.parse(key) | ||||||
|     let encrypted = CryptoJs.AES.encrypt(password, iv, { |     let encrypted = CryptoJs.AES.encrypt(params.password, iv, { | ||||||
|       iv, |       iv, | ||||||
|       mode: CryptoJs.mode.CBC, |       mode: CryptoJs.mode.CBC, | ||||||
|       padding: CryptoJs.pad.ZeroPadding |       padding: CryptoJs.pad.ZeroPadding | ||||||
|   | |||||||
| @@ -15,12 +15,12 @@ import $reg from "./regular" | |||||||
|  */ |  */ | ||||||
| const addChild = (parent, pending, config) => { | const addChild = (parent, pending, config) => { | ||||||
|   let conf = { |   let conf = { | ||||||
|       key: 'id', |         key: 'id', | ||||||
|       parent: 'parentId', |         parent: 'parentId', | ||||||
|       children: 'children', |         children: 'children', | ||||||
|       ...config |         ...config | ||||||
|     }, |       }, | ||||||
|     doBeforeCount = pending.length |       doBeforeCount = pending.length | ||||||
|   for (let i = pending.length - 1; i >= 0; i--) { |   for (let i = pending.length - 1; i >= 0; i--) { | ||||||
|     let e = pending[i] |     let e = pending[i] | ||||||
|     if (e[conf.parent] == parent[conf.key]) { |     if (e[conf.parent] == parent[conf.key]) { | ||||||
| @@ -58,7 +58,7 @@ const $decimalCalc = (...arr) => { | |||||||
|     return ('' + e).length - index |     return ('' + e).length - index | ||||||
|   }) |   }) | ||||||
|   let maxDecimal = Math.max(...decimalLengthes), |   let maxDecimal = Math.max(...decimalLengthes), | ||||||
|     precision = Math.pow(10, maxDecimal) |       precision = Math.pow(10, maxDecimal) | ||||||
|   // 计算 |   // 计算 | ||||||
|   let intArr = arr.map(e => (Number(e) || 0) * precision) |   let intArr = arr.map(e => (Number(e) || 0) * precision) | ||||||
|   // 返回计算值 |   // 返回计算值 | ||||||
| @@ -86,10 +86,10 @@ const $colorUtils = { | |||||||
|       if (color.length == 4) { |       if (color.length == 4) { | ||||||
|         // 检测诸如#FFF简写格式 |         // 检测诸如#FFF简写格式 | ||||||
|         color = |         color = | ||||||
|           '#' + |             '#' + | ||||||
|           color.charAt(1).repeat(2) + |             color.charAt(1).repeat(2) + | ||||||
|           color.charAt(2).repeat(2) + |             color.charAt(2).repeat(2) + | ||||||
|           color.charAt(3).repeat(2) |             color.charAt(3).repeat(2) | ||||||
|       } |       } | ||||||
|       hex = parseInt(color.slice(1), 16) |       hex = parseInt(color.slice(1), 16) | ||||||
|     } |     } | ||||||
| @@ -170,8 +170,8 @@ export default { | |||||||
|   }, |   }, | ||||||
|   $dateFormat: (time, format) => { |   $dateFormat: (time, format) => { | ||||||
|     return $moment(time) |     return $moment(time) | ||||||
|       .format(format || 'YYYY-MM-DD') |         .format(format || 'YYYY-MM-DD') | ||||||
|       .replace('Invalid Date', '') |         .replace('Invalid Date', '') | ||||||
|   }, |   }, | ||||||
|   $copy, |   $copy, | ||||||
|   $download: (url, name) => { |   $download: (url, name) => { | ||||||
| @@ -190,7 +190,7 @@ export default { | |||||||
|   $arr2tree: (list, config = {}) => { |   $arr2tree: (list, config = {}) => { | ||||||
|     let result = [] |     let result = [] | ||||||
|     const {key = 'id', parent = 'parentId', children = 'children'} = config, itemMap = {}, |     const {key = 'id', parent = 'parentId', children = 'children'} = config, itemMap = {}, | ||||||
|       ids = list?.map(e => `#${e[key]}#`)?.toString() |         ids = list?.map(e => `#${e[key]}#`)?.toString() | ||||||
|     for (const e of list) { |     for (const e of list) { | ||||||
|       const id = e[key], pid = e[parent] |       const id = e[key], pid = e[parent] | ||||||
|       itemMap[id] = {...e, [children]: [itemMap[id]?.[children]].flat().filter(Boolean)} |       itemMap[id] = {...e, [children]: [itemMap[id]?.[children]].flat().filter(Boolean)} | ||||||
| @@ -230,11 +230,5 @@ export default { | |||||||
|       } |       } | ||||||
|       return max |       return max | ||||||
|     } else return 0 |     } else return 0 | ||||||
|   }, |  | ||||||
|   $isEmpty(obj) { |  | ||||||
|     if (obj === null || obj === undefined) return true; |  | ||||||
|     if (typeof obj === 'string' && obj.trim() === '') return true; |  | ||||||
|     if (Array.isArray(obj) && obj.length === 0) return true; |  | ||||||
|     return typeof obj === 'object' && Object.keys(obj).length === 0; |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ | |||||||
| @import "ckeditor"; | @import "ckeditor"; | ||||||
| @import "vars"; | @import "vars"; | ||||||
|  |  | ||||||
| $cdn: "https://cdn.sinoecare.com/"; | $cdn: "https://cdn.cunwuyun.cn/"; | ||||||
| $--color-primary: $primaryColor; | $--color-primary: $primaryColor; | ||||||
| $--color-text-placeholder: $placeholderColor; | $--color-text-placeholder: $placeholderColor; | ||||||
| $--border-color-base: $borderColor; | $--border-color-base: $borderColor; | ||||||
| @@ -80,24 +80,12 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts'; | |||||||
| /** | /** | ||||||
|   不换行文本 |   不换行文本 | ||||||
|  */ |  */ | ||||||
| .nowrap-text, .t-nowrap { | .nowrap-text { | ||||||
|   white-space: nowrap; |   white-space: nowrap; | ||||||
|   overflow: hidden; |   overflow: hidden; | ||||||
|   text-overflow: ellipsis; |   text-overflow: ellipsis; | ||||||
| } | } | ||||||
|  |  | ||||||
| .t-center { |  | ||||||
|   text-align: center; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .t-bold { |  | ||||||
|   font-weight: bold; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .t-right { |  | ||||||
|   text-align: right; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
|   表头式样 |   表头式样 | ||||||
|  */ |  */ | ||||||
| @@ -164,7 +152,7 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts'; | |||||||
|   缺省页相关样式 |   缺省页相关样式 | ||||||
|  */ |  */ | ||||||
| .no-data { | .no-data { | ||||||
|   background: url("https://cdn.sinoecare.com/ui/svg/NoData.svg") no-repeat center; |   background: url("https://cdn.cunwuyun.cn/ui/svg/NoData.svg") no-repeat center; | ||||||
|   background-size: 120px 120px; |   background-size: 120px 120px; | ||||||
|   height: 120px; |   height: 120px; | ||||||
|   margin: 48px auto 10px; |   margin: 48px auto 10px; | ||||||
| @@ -174,28 +162,28 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts'; | |||||||
|   缺省页相关样式 |   缺省页相关样式 | ||||||
|  */ |  */ | ||||||
| .ai-empty__bg { | .ai-empty__bg { | ||||||
|   background: url("https://cdn.sinoecare.com/ui/svg/empty.svg") no-repeat center; |   background: url("https://cdn.cunwuyun.cn/ui/svg/empty.svg") no-repeat center; | ||||||
|   background-size: 120px 120px; |   background-size: 120px 120px; | ||||||
|   height: 120px; |   height: 120px; | ||||||
|   margin: 48px auto 0; |   margin: 48px auto 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| .no-permission { | .no-permission { | ||||||
|   background: url("https://cdn.sinoecare.com/ui/svg/NoAuthority.svg") no-repeat center; |   background: url("https://cdn.cunwuyun.cn/ui/svg/NoAuthority.svg") no-repeat center; | ||||||
|   background-size: 120px 120px; |   background-size: 120px 120px; | ||||||
|   height: 120px; |   height: 120px; | ||||||
|   margin-top: 48px; |   margin-top: 48px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .no-message { | .no-message { | ||||||
|   background: url("https://cdn.sinoecare.com/ui/svg/NoMessage.svg") no-repeat center; |   background: url("https://cdn.cunwuyun.cn/ui/svg/NoMessage.svg") no-repeat center; | ||||||
|   background-size: 120px 120px; |   background-size: 120px 120px; | ||||||
|   height: 120px; |   height: 120px; | ||||||
|   margin-top: 48px; |   margin-top: 48px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .done-success { | .done-success { | ||||||
|   background: url("https://cdn.sinoecare.com/ui/svg/Success.svg") no-repeat center; |   background: url("https://cdn.cunwuyun.cn/ui/svg/Success.svg") no-repeat center; | ||||||
|   background-size: 120px 120px; |   background-size: 120px 120px; | ||||||
|   height: 120px; |   height: 120px; | ||||||
| } | } | ||||||
| @@ -207,7 +195,7 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts'; | |||||||
| } | } | ||||||
|  |  | ||||||
| .developing { | .developing { | ||||||
|   background: url("https://cdn.sinoecare.com/ui/svg/developing.svg") no-repeat center; |   background: url("https://cdn.cunwuyun.cn/ui/svg/developing.svg") no-repeat center; | ||||||
|   background-size: 400px 320px; |   background-size: 400px 320px; | ||||||
|   width: 100%; |   width: 100%; | ||||||
|   height: 100%; |   height: 100%; | ||||||
| @@ -327,12 +315,6 @@ div[flex], .flex { | |||||||
|     gap: 20px; |     gap: 20px; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @for $i from 2 through 50 { |  | ||||||
|     &.gap-#{$i} { |  | ||||||
|       gap: #{$i}px; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   &.center { |   &.center { | ||||||
|     justify-content: center; |     justify-content: center; | ||||||
|   } |   } | ||||||
| @@ -366,29 +348,10 @@ div[flex], .flex { | |||||||
|   display: grid; |   display: grid; | ||||||
|   gap: 8px; |   gap: 8px; | ||||||
|   grid-template-columns: repeat(2, 1fr); |   grid-template-columns: repeat(2, 1fr); | ||||||
|   @for $i from 2 through 10 { |   @for $i from 2 through 5 { | ||||||
|     &.c-#{$i} { |     &.c-#{$i} { | ||||||
|       grid-template-columns: repeat($i, 1fr); |       grid-template-columns: repeat($i, 1fr); | ||||||
|     } |     } | ||||||
|     &.r-#{$i} { |  | ||||||
|       grid-template-rows: repeat($i, 1fr); |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|   @for $i from 2 through 10 { |  | ||||||
|     .sr-#{$i} { |  | ||||||
|       grid-column: span #{$i}; |  | ||||||
|     } |  | ||||||
|     .sc-#{$i} { |  | ||||||
|       grid-row: span #{$i}; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   .row { |  | ||||||
|     grid-column: 1/-1; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   .column { |  | ||||||
|     grid-row: 1/-1; |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -425,10 +388,8 @@ div[flex], .flex { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   .el-message-box__content { |   .el-message-box__content { | ||||||
|  |     padding-left: 77px; | ||||||
|     padding-top: 4px; |     padding-top: 4px; | ||||||
|     min-height: 60px; |  | ||||||
|     padding-left: 40px; |  | ||||||
|     padding-right: 40px; |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   .el-message-box__title { |   .el-message-box__title { | ||||||
| @@ -449,6 +410,7 @@ div[flex], .flex { | |||||||
|     font-size: 16px; |     font-size: 16px; | ||||||
|     color: #333; |     color: #333; | ||||||
|     font-weight: bold; |     font-weight: bold; | ||||||
|  |     min-height: 60px; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   .el-message-box__btns { |   .el-message-box__btns { | ||||||
| @@ -657,11 +619,11 @@ h1, h2, h3, p { | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| .signLeftBg { | .signLeftBg { | ||||||
|   background-image: url('#{$cdn}ui/background/#{$theme}/loginLeft.png'); |   background-image: url('#{$cdn}/ui/background/#{$theme}/loginLeft.png'); | ||||||
| } | } | ||||||
|  |  | ||||||
| .navBg { | .navBg { | ||||||
|   background-image: url('#{$cdn}ui/background/#{$theme}/nav_bg.png'); |   background-image: url('#{$cdn}/ui/background/#{$theme}/nav_bg.png'); | ||||||
| } | } | ||||||
|  |  | ||||||
| /** | /** | ||||||
|   | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user