Commit 5977ce38 by zhuxiaomei

项目初始化

parents
NODE_ENV=development
VUE_APP_BASE_URL=http://api.dev.patzn.com:7000
NODE_ENV=production
VUE_APP_BASE_URL=http://api.patzn.com
NODE_ENV=test
VUE_APP_BASE_URL=http://api.pertest.patzn.com
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# my-app
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Run your tests
```
npm run test
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --mode development",
"build": "vue-cli-service build --mode production",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.20.0",
"core-js": "^3.6.5",
"dateformat": "^3.0.3",
"vant": "^2.10.9",
"vue": "^2.6.11",
"vue-navigation": "^1.1.4",
"vue-router": "^3.4.6",
"vue2-touch-events": "^2.3.2",
"vuex": "^3.5.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.0",
"@vue/cli-plugin-eslint": "^4.5.0",
"@vue/cli-service": "^4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"less": "^3.12.2",
"less-loader": "^7.0.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"globals": {
"BMap": true
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"
/>
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'App',
components: {
}
}
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</style>
/**
* 系统相关
*/
import http from '../http'
export default {
//意见反馈
advise: data => http.post('/base/v1/advise/', data).then(res => res),
}
/**
* 系统相关
*/
import http from '../http'
import Global from '../config'
export default {
//检测版本,自动更新
version: data => http.post('/base/v1/app_version/' + data.name + '_' + data.device + '?version=' + Global.version()).then(res => res),
}
/**
* 城市
*/
import http from '../http'
export default {
// 地址
list: () => http.post('/base/v1/country/list').then(res => res)
}
/**
* 系统相关
*/
import http from '../http'
export default {
//获取邮箱验证码
getEmailCode: data => http.post('/base/v1/email/send/', data).then(res => res),
//绑定邮箱
bindEmail: data => http.post('/base/v1/email/bind_' + data.code).then(res => res),
}
/**
* 系统相关
*/
import http from '../http'
export default {
submitExperience: data => http.post('/base/v1/experience/' + data.code, data).then(res => res),
}
/**
* 报告模板
*/
import http from '../http'
export default {
page: data => http.post('/base/v1/file_template/page', data).then(res => res)
}
/**
* 工作流相关
*/
import http from '../http'
export default {
//任务
listTask: data => http.post('/base/v1/flow_process/list_task', data).then(res => res),
//认领
claimTask: data => http.post('/base/v1/flow_process/claim_task/' + data).then(res => res),
fromKey: data => http.post('/base/v1/flow_process/fromKey', {taskId: data}).then(res => res),
}
/**
* 系统相关
*/
import http from '../http'
export default {
appMenu: data => http.post('/base/v1/resource/app_menu', data).then(res => res),
}
/**
* 系统相关
*/
import http from '../http'
export default {
getCode: data => http.post('/base/v1/sms/send_' + data.module + '/' + data.mobile).then(res => res),
//修改手机号
changeBindMobile: data => http.post('/base/v1/sms/change_bind_' + data).then(res => res),
}
/**
* sso
*/
import http from '../http'
export default {
//登录
login: data => http.post('/base/v1/sso/app_login', data).then(res => res),
//验证码登录
loginByCode: data => http.post('/base/v1/sso/ajax_login_back', data).then(res => res),
//注册
register: data => http.post('/base/v1/sso/register', data).then(res => res),
//修改密码
changPwd: data => http.post('/base/v1/sso/change_password', data).then(res => res),
//退出
logout: () => http.get('/base/v1/sso/logout').then(res => res),
}
/**
* 系统相关
*/
import http from '../http'
import httpJson from '../httpJson'
export default {
//个人模块-save
userRelResourceAdd: data => httpJson.post('/base/v1/user_rel_resource/', JSON.stringify(data)).then(res => res),
//个人模块-list
userRelResource: () => http.post('/base/v1/user_rel_resource/my_list').then(res => res),
}
/**
* 系统相关
*/
import http from '../http'
export default {
//用户修改密码
editPsd: data => http.put('/base/v1/user/password', data).then(res => res),
//获取用户信息
getUserInfo: () => http.get('/base/v1/user/info').then(res => res),
userEdit: data => http.put('/base/v1/user/' + data.id, data.obj).then(res => res),
// 人员查询
orginTreeList: () => http.post('/base/v1/org/org_tree').then(res => res),
userSelect: data => http.post('/base/v1/user/list_org/' + data.orgId).then(res => res),
userSelectByKeyword: data => http.post('/base/v1/user/list?realname=' + data).then(res => res),
}
/**
* 全局相关配置
*/
// 对外暴露全局常量及函数
export default {
//localStorage
setLogin: function (user) {
localStorage.setItem('fLoginUser', JSON.stringify(user));
},
//clear
logout: function () {
localStorage.removeItem('fLoginUser');
localStorage.removeItem('accessToken');
},
getLogin: function () {
return JSON.parse(localStorage.getItem('fLoginUser'));
},
//token
setToken: function (data) {
localStorage.setItem('accessToken', data);
},
//获取token
getToken: function () {
return localStorage.getItem('accessToken');
},
baseURL: process.env.VUE_APP_BASE_URL,
//version
version: function () {
return '0.0.0'
},
}
/**
* 抽样计划表相关
*/
import http from '../http'
export default {
page: data => http.post('/drs/v1/sampling_plan/page', data).then(res => res),
getById: id => http.get('/drs/v1/sampling_plan/' + id).then(res => res),
}
/**
* HTTP 请求 axios 封装
*/
import Qs from "qs";
import axios from 'axios'
import global from './config'
import loading from './loading'
// Axios 全局配置
const http = axios.create()
http.defaults.baseURL = process.env.VUE_APP_BASE_URL
http.defaults.withCredentials = true
// 添加请求拦截器
http.interceptors.request.use(
config => {
let tk = localStorage.getItem('accessToken');
if (tk) {
config.headers = {
'Content-Type': 'application/x-www-form-urlencoded'
};
config.headers.accessToken = tk;
}
config.transformRequest = [
// 后面数组中的函数必须返回一个字符串,或 ArrayBuffer,或 Stream
function (data) {
return Qs.stringify(data);
}
]
return config
},
error => {
return Promise.reject(error)
}
)
// 返回数据处理
// 返回格式 {code:业务码 , data: 内容 , msg: 描述}
http.interceptors.response.use(
response => {
switch (response.data.code) {
case '-2':
global.logout()
// location.reload()
break
case '1':
return response.data.data
default:
loading.toast.show(response.data.code, response.data.msg)
}
},
error => {
return Promise.reject(error)
}
)
export default http
/**
* HTTP 请求 axios dto封装
*/
import axios from 'axios'
import global from './config'
import loading from './loading'
// Axios 全局配置
const httpJson = axios.create()
httpJson.defaults.baseURL = process.env.VUE_APP_BASE_URL
httpJson.defaults.withCredentials = true
// 添加请求拦截器
httpJson.interceptors.request.use(
config => {
let tk = localStorage.getItem('accessToken');
if (tk) {
config.headers = {
'Content-Type': 'application/json'
};
config.headers.accessToken = tk;
}
return config
},
error => {
return Promise.reject(error)
}
)
// 返回数据处理
// 返回格式 {code:业务码 , data: 内容 , msg: 描述}
httpJson.interceptors.response.use(
response => {
switch (response.data.code) {
case '-2':
global.logout()
location.reload();
break
case '1':
return response.data.data
default:
loading.toast.show(response.data.code, response.data.msg)
}
},
error => {
if (error.response.status === 401) {
console.log('unauthorized, logging out ...')
}
return Promise.reject(error)
}
)
export default httpJson
/**
* base
*/
export {default as sso} from './base/sso'
// export {default as resource} from './base/resource'
// export {default as userRelResource} from './base/user-rel-resource'
export {default as sysUser} from './base/user'
// export {default as appVersion} from './base/app-version'
// export {default as flowProcess} from './base/flow-process'
// export {default as email} from './base/email'
export {default as sms} from './base/sms'
export {default as advise} from './base/advise'
// export {default as country} from './base/country'
// export {default as fileTemplate} from './base/file-template'
/**
* res
*/
// export {default as customer} from './res/customer'
// export {default as dict} from './res/dict'
// export {default as serviceType} from './res/service-type'
// export {default as car} from './res/car'
/**
* message
*/
export {default as message} from './message/message'
/**
* drs
*/
export {default as samplingPlan} from './drs/sampling-plan'
/**
* 加载
*/
import Vue from 'vue'
function toasts(message) {
/*todo 请求接口之后的反馈*/
console.log(message, Vue)
}
var toast = {
show: function (type, message) {
console.log('===message==' + message);
var finalMessage = message;
if (!finalMessage) {
switch (type) {
case 1000:
finalMessage = '没有权限';
break;
case -201:
finalMessage = '没有用户';
break;
case -1:
finalMessage = '没有权限';
break;
case 500:
finalMessage = '网络错误';
break;
default:
finalMessage = '网络错误';
break;
}
finalMessage += type;
}
if (message === 'inactivate') {
//未激活状态
localStorage.setItem('inactivate', message);
} else {
toasts(finalMessage);
}
},
// showMessage: function (message) {
// toasts(message);
// },
//
// showLoading: function (show) {
// if (show) {
// // iView.LoadingBar.start();
// } else {
// // iView.LoadingBar.finish();
// }
// }
};
export default {
toast
}
/**
* 系统消息表相关
*/
import http from '../http'
export default {
deleteByIds: ids => http.delete('/message/v1/message/?ids=' + ids).then(res => res),
getById: id => http.get('/message/v1/message/' + id).then(res => res),
myPage: data => http.post('/message/v1/message/page_my', data).then(res => res),
read: ids => http.post('/message/v1/message/read?relIds=' + ids).then(res => res),
}
/**
* 资源-客户
*/
import http from '../http'
export default {
//客户
list: data => http.get('/res/v1/customer/list?cname=' + data).then(res => res)
}
/**
* 资源-字典
*/
import http from '../http'
export default {
// 多个字典查询
listDict: data => http.post('/res/v1/dict/list_dict', {'classTypeList': data.join(',')}).then(res => res),
// 单个字典查询
getItem: data => http.get('/res/v1/dict/dict_class_item?classType=' + data).then(res => res)
}
/**
* 资源-服务类型
*/
import http from '../http'
export default {
list: data => {
let obj = ''
if (data) {
obj = http.get('/res/v1/service_type/list?name=' + data).then(res => res)
} else {
obj = http.get('/res/v1/service_type/list', data).then(res => res)
}
return obj
}
}
/**
* 资源-用户编组
*/
import http from '../http'
export default {
//用户编组
userGroupList: () => http.post('/res/v1/user_group/list').then(res => res),
//编组关联用户(默认500条)
groupUserPage: data => http.post('/res/v1/user_group/page_rel_user', data).then(res => res),
}
<template>
<van-popup v-model="showPopup" round :style="{ width:'75%'}">
<div>
{{title}}
</div>
<div style="margin: 20px 10px">
<slot></slot>
</div>
<div>
<van-button type="primary" @click="onCancel">取消</van-button>
<van-button type="info" @click="onConfirm">确定</van-button>
</div>
</van-popup>
</template>
<script>
export default {
name: "ConfirmDialog",
props: {
title: String,
},
data() {
return {
showPopup: true
}
},
methods: {
onCancel() {
this.$emit('close')
},
onConfirm() {
this.$emit('confirm')
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<!--https://youzan.github.io/vant/#/zh-CN/form#biao-dan-xiang-lei-xing---shi-jian-xuan-ze-qi-->
<van-field
readonly
clickable
v-model="dateValue"
:label="label"
:placeholder="'点击选择'+label"
@click="showPicker = true"
></van-field>
<van-popup v-model="showPicker" position="bottom"
:safe-area-inset-bottom="true"
:close-on-popstate="true">
<van-datetime-picker
:type="type"
v-model="currentDate"
@confirm="onConfirm"
@cancel="showPicker = false"
></van-datetime-picker>
</van-popup>
</div>
</template>
<script>
export default {
name: "DateTimeField",
props: {
label: String,
value: {type: String, default: ''}, //默认值
type: {type: String, default: 'date'},
format: {type: String, default: 'yyyy-mm-dd'}
},
data() {
return {
showPicker: false,
currentDate: new Date()
}
},
computed: {
dateValue: {
get() {
return this.value
},
set(val) {
this.$emit('input', val)
}
}
},
watch: {
showPicker: function (newVal) {
if (newVal) {
this.currentDate = new Date()
}
}
},
methods: {
onConfirm(date) {
this.dateValue = this.$dateformat(date, this.format)
this.showPicker = false
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<datetime-field label="计划日期" v-model="planDate"></datetime-field>
<van-button type="info" @click="_clear">
清空
</van-button>
</div>
</template>
<script>
import DatetimeField from './DatetimeField'
export default {
name: "Search",
components: {
DatetimeField
},
data() {
return {
planDate: ''
}
},
methods: {
_clear() {
this.planDate = ''
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="field-box">
<div class="label">
<span>抽样单编号</span>
</div>
<div class="value">
<input class="van-field__control cus-input-class">
</div>
</div>
</template>
<script>
/**
*自定义 Field
*/
export default {
name: "FieldCustomer"
}
</script>
<style lang="less" scoped>
.field-box {
width: 100%;
height: 100%;
display: flex;
.label {
width: 50%;
display: flex;
vertical-align: middle;
align-items: center;
justify-content: center;
}
.value {
flex: 1;
vertical-align: middle;
}
.cus-input-class {
height: 100%;
padding-left: 12px;
}
}
</style>
<template>
<!--https://youzan.github.io/vant/#/zh-CN/tabbar-->
<van-tabbar route fixed>
<van-tabbar-item replace to="/home" icon="home-o">
首页
</van-tabbar-item>
<van-tabbar-item replace to="/mine/mine" icon="friends-o">
个人中心
</van-tabbar-item>
</van-tabbar>
</template>
<script>
export default {
name: "FooterBar"
}
</script>
<style scoped>
</style>
<template>
<!--https://youzan.github.io/vant/#/zh-CN/search-->
<div class="search-bar-box">
<van-search
v-model="searchValue"
show-action
:placeholder="'请输入搜索'+labelText"
@search="onSearch"
>
<template #action>
<div @click="onSearch">搜索</div>
</template>
</van-search>
<div @click="showHighSearch = true" v-if="highSearch" class="high-search-text">高级查询</div>
<div class="high-search-cont" v-if="showHighSearch">
<van-nav-bar title="高级搜索"
:left-arrow="true"
@click-left="showHighSearch=false"></van-nav-bar>
<slot name="highSearch"></slot>
<div class="btn-box">
<van-button block type="info" @click="onHighSearch">搜索</van-button>
<van-button block type="default" @click="onReset" style="margin-top: 10px">清空</van-button>
</div>
</div>
</div>
</template>
<script>
export default {
name: "SearchBar",
props: {
label: String,
//是否展示高级查询按钮
highSearch: {type: Boolean, default: false}
},
data() {
return {
showHighSearch: false,
searchValue: '',
labelText: this.label ? this.label : '关键字'
}
},
methods: {
onSearch() {
this.$emit('search', this.searchValue)
},
onHighSearch() {
this.showHighSearch = false
this.searchValue = ''
this.$emit('high-search')
},
onReset() {
this.$emit('clear-high')
}
}
}
</script>
<style scoped>
</style>
/**
* 配置文件
*/
export default {
service:'double-sampling',
webURL: process.env.process.env.VUE_APP_WEB_URL,
baseURL: process.env.process.env.VUE_APP_BASE_URL,
ssoURL: process.env.process.env.VUE_APP_SSO_URL,
}
<template>
<div>
<slot name="navBar"></slot>
<div class="main-layout-cont">
<div>
<slot name="content"></slot>
</div>
</div>
<!--其他使用的组件等-->
<slot></slot>
</div>
</template>
<script>
/**
* 自定义标题栏布局
*/
export default {
name: "NavBarLayout"
}
</script>
<style scoped>
</style>
// 加载百度地图js
const map = {
init: function () {
const AK = '7aLLv8GDWaDFLiBlCrctGnq3vTFsHEWf'
const BMapURL = 'http://api.map.baidu.com/api?v=2.0' + AK + '&s=1&callback=onBMapCallback'
return new Promise((resolve) => {
// 如果已加载直接返回
if (typeof BMap !== 'undefined') {
resolve(BMap)
return true
}
// 百度地图异步加载回调处理
window.onBMapCallback = function () {
// console.log('百度地图脚本初始化成功...')
resolve(BMap)
};
// 插入script脚本
let scriptNode = document.createElement('script')
scriptNode.setAttribute('type', 'text/javascript')
scriptNode.setAttribute('src', BMapURL)
document.body.appendChild(scriptNode)
})
}
}
export default map
import dateformat from 'dateformat';
import global from '../api/config';
export default {
install(Vue) {
/**
* 日期格式化
* https://www.npmjs.com/package/dateformat
*/
Vue.prototype.$dateformat = function (date, format) {
return date ? dateformat(date, format) : ''
};
/**
* 重置数据
* */
Vue.prototype.$resetFields = function (formObj) {
let newFormObj = {}
for (let key in formObj) {
newFormObj[key] = ''
}
return newFormObj;
};
/**
* 序列化formObj 只返回有值的
* @param formObj
*/
Vue.prototype.$serializeForm = function (formObj) {
const newFormObj = {}
for (const key in formObj) {
// 不为空的时候传值
if (formObj[key] !== '') {
newFormObj[key] = formObj[key]
}
}
return newFormObj
}
/**
* 全局的配置
* @type {{getLogin, logout, baseURL, setToken, setLogin, getToken, version}}
*/
Vue.prototype.$global = global
},
}
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import plugins from './lib/plugins'
Vue.use(plugins)
// import Navigation from 'vue-navigation'
// Vue.use(Navigation, {router});
import Vue2TouchEvents from 'vue2-touch-events'
Vue.use(Vue2TouchEvents)
import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);
import '@/styles/main.less'
import SearchBar from '@/components/SearchBar.vue'
import DatetimeField from '@/components/DatetimeField.vue'
import ConfirmDialog from '@/components/ConfirmDialog.vue'
import CustomerNavBarLayout from '@/layout/CustomerNavBarLayout.vue'
Vue.component('search-bar', SearchBar)
Vue.component('datetime-field', DatetimeField)
Vue.component('confirm-dialog', ConfirmDialog)
Vue.component('customer-navBar-layout', CustomerNavBarLayout)
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App),
}).$mount('#app')
<template>
<div class="login-cont">
<div class="login-main login-main-forget">
<div class="logo-text">
<img src="@/assets/forgetPwd.png" height="40">
</div>
<van-form @submit="onSubmit">
<div class="field-input">
<van-field
v-model="formObj.mobile"
:left-icon="require('../assets/user.png')"
label-width="4.2em"
name="mobile"
label="手机号"
placeholder="请输入您的手机号"
clearable
:rules="[{ required: true, message: '' }]"
></van-field>
</div>
<div class="field-input">
<van-field
v-model="formObj.code"
center
:left-icon="require('../assets/code.png')"
label-width="4.2em"
name="code"
label="验证码"
placeholder="请输入验证码"
:rules="[{ required: true, message: '' }]">
<template #button>
<!--native-type="button" 阻止触发表单提交-->
<van-button size="small" type="info" native-type="button" @click="_getCode">
发送验证码
</van-button>
</template>
</van-field>
</div>
<div class="field-input">
<van-field
v-model="formObj.password"
:left-icon="require('../assets/psd.png')"
label-width="4.2em"
type="password"
name="password"
label="新密码"
placeholder="请输入新密码"
clearable
:rules="[{ required: true, message: '' }]"
></van-field>
</div>
<div class="field-input">
<van-field
v-model="confirmPwd"
:left-icon="require('../assets/psd.png')"
label-width="4.2em"
type="password"
name="confirmPwd"
label="确认密码"
placeholder="请确认密码"
clearable
:rules="[{ required: true, message: '' }]"
></van-field>
</div>
<div class="btn-box" style="margin-top: 30px">
<van-button block type="info" native-type="submit">
确认并登录
</van-button>
</div>
</van-form>
</div>
</div>
</template>
<script>
import {sms, sso} from '@/api'
export default {
name: "ForgetPwd",
data() {
return {
confirmPwd: '',
formObj: {
mobile: '',
password: '',
code: ''
},
}
},
methods: {
_getCode: async function () {
if (this.formObj.mobile === '') {
this.$toast('请输入手机号');
} else {
if (!/^((1[3,5,8][0-9])|(14[5,7])|(17[0,6,7,8])|(19[7]))\d{8}$/.test(this.formObj.mobile)) {
this.$toast('手机号格式不正确');
} else {
let result = await sms.getCode({
module: 'changePasswordByMobile',
mobile: this.formObj.mobile
})
if (result) {
this.$toast.success('发送成功!');
}
}
}
},
onSubmit() {
if (this.formObj.password !== this.confirmPwd) {
this.$toast('两次填写的密码不一致');
} else {
this._save()
}
},
_save: async function () {
let result = await sso.changPwd(this.formObj)
if (result) {
this.$toast.success('密码修改成功!');
setTimeout(() => {
this._toLogin();
}, 1000)
}
},
//跳到注册界面
_toLogin() {
// this.$navigation.cleanRoutes();
this.$router.replace('/login');
},
}
}
</script>
<style scoped>
</style>
<template>
<div>
<!--https://youzan.github.io/vant/#/zh-CN/grid-->
<div class="layout-cont home-cont">
<van-grid :gutter="10" :column-num="3" :icon-size="40">
<!--1、icon参数引入使用,否则不显示-->
<van-grid-item v-for="item in menuList" :key="item.title" :icon="item.img"
:text="item.title" @click="_goto(item)"></van-grid-item>
<!--2、require使用 详见:https://youzan.github.io/vant/#/zh-CN/image#chang-jian-wen-ti-->
<!--<van-grid-item v-for="item in menuList" :key="item.title" :icon="require('../assets/index/1.png')"-->
<!--:text="item.title" ></van-grid-item>-->
<!--3、使用该组件的icon插槽 详见:https://youzan.github.io/vant/#/zh-CN/grid#api-->
</van-grid>
</div>
<FooterBar></FooterBar>
</div>
</template>
<script>
import indexImg10 from '../assets/index/10.png'
import indexImg1 from '../assets/index/1.png'
import indexImg11 from '../assets/index/11.png'
import FooterBar from '@/components/FooterBar.vue'
export default {
name: "Home",
components: {
FooterBar
},
data() {
return {
menuList: [
{img: indexImg10, title: '抽样任务', uri: '/sampling_task/sampling_task'},
{img: indexImg1, title: '抽样单管理', uri: '/sampling_list/sampling_task'},
{img: indexImg11, title: '历史抽样单', uri: '/history_sampling/sampling_list'},
],
}
},
methods: {
_goto(item) {
this.$router.push(item.uri)
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="main-content-con">
<!--https://youzan.github.io/vant/#/zh-CN/nav-bar-->
<van-nav-bar :title="$route.meta.title"
:left-arrow="$route.meta.leftArrow!==false"
v-if="$route.meta.hideNavBar!==true"
@click-left="_back"></van-nav-bar>
<div class="main-layout-cont" :class="[{'main-layout-cont-hide-navbar':$route.meta.hideNavBar===true}]">
<router-view></router-view>
</div>
</div>
</template>
<script>
export default {
name: "Index",
components: {},
methods: {
_back() {
this.$router.go(-1)
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="login-cont">
<div class="login-main">
<h1>欢迎登录</h1>
<van-form @submit="onSubmit">
<div class="field-input">
<van-field
v-model="formObj.username"
:left-icon="require('../assets/user.png')"
label-width="4.2em"
name="username"
label="用户名"
placeholder="请填写用户名"
clearable
:rules="[{ required: true, message: '' }]"
></van-field>
</div>
<div class="field-input">
<!--todo form表单回车提交-->
<van-field
v-model="formObj.password"
:left-icon="require('../assets/psd.png')"
label-width="4.2em"
type="password"
name="password"
label="密码"
placeholder="请填写密码"
clearable
:rules="[{ required: true, message: '' }]"
></van-field>
</div>
<div class="forget-text">
<div>
<van-checkbox shape="square" v-model="checked" icon-size="18px">记住密码</van-checkbox>
</div>
<div @click="_forgetPwd">忘记密码?</div>
</div>
<div class="btn-box">
<van-button block type="info" native-type="submit">
立即登录
</van-button>
</div>
</van-form>
</div>
<confirm-dialog v-if="showPopup" title="请输入您的新密码" @confirm="_toLogin" @close="showPopup=false">
<van-field v-model="formObj.newPwd" label="密码" placeholder="请输入您的新密码"></van-field>
</confirm-dialog>
</div>
</template>
<script>
import {sso, sysUser} from '../api'
export default {
name: "Login",
data() {
return {
formObj: {
username: '',
password: '',
newPwd: ''
},
checked: false,
showPopup: false
}
},
mounted() {
this._inactivate()
},
methods: {
onSubmit(res) {
console.log(res, 'login-info')
this._login(res)
},
_login: async function (res) {
let token = await sso.login(res)
if (token) {
this.$global.setToken(token)
if (this.checked) {
localStorage.setItem('username', this.formObj.username);
if (localStorage.getItem('inactivate')) {
//第一次激活后保存密码
localStorage.setItem('password', this.formObj.newPwd);
} else {
//已经激活状态保存密码
localStorage.setItem('password', this.formObj.password);
}
} else {
localStorage.removeItem('username');
localStorage.removeItem('password');
}
this._getUserInfo();
} else {
//激活
this._inactivate();
}
},
//获取用户信息
async _getUserInfo() {
let user = await sysUser.getUserInfo();
if (user) {
this.$global.setLogin(user);
this.$router.replace('/home');
//todo 清空路由 报错问题 需要降低vue-router版本
// this.$navigation.cleanRoutes();
}
},
_forgetPwd() {
this.$router.push('/forget_pwd')
},
//激活
_inactivate() {
if (localStorage.getItem('inactivate') === 'inactivate') {
this.formObj.newPwd = ''
this.showPopup = true
}
},
_toLogin() {
if (this.formObj.newPwd === '') {
this.$toast('请输入新密码!');
return
}
let data = {
username: this.formObj.username,
password: this.formObj.newPwd
}
this._login(data)
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<search-bar label="计划名称"
highSearch
@search="_search"
@high-search="_highSearch"
@clear-high="_clearHigh">
<template #highSearch>
<van-field v-model="formObj.name" label="抽样单编号" placeholder="请输入抽样单编号"></van-field>
<datetime-field label="抽样日期" v-model="formObj.planDate"></datetime-field>
<van-field v-model="formObj.name" label="任务名称" placeholder="请输入任务名称"></van-field>
<van-field v-model="formObj.name" label="被抽样单位" placeholder="请输入被抽样单位名称"></van-field>
</template>
</search-bar>
<div class="layout-cont-sh">
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad">
<van-swipe-cell v-for="item in resultList" :key="item.name">
<div class="result-item" @click="_goto(item)">
<div>抽样单编号:</div>
<div>抽样日期:</div>
<div>任务名称:</div>
<div>任务编号:</div>
<div>生产名称:</div>
<div>样品名称:</div>
<div>被抽样单位名称:</div>
</div>
</van-swipe-cell>
</van-list>
</div>
</div>
</template>
<script>
export default {
name: "SamplingList",
data() {
return {
formObj: {
name: '',
planDate: '',
uname: '',
ctime: ''
},
resultList: [
{name: '计划名称', status: 1},
{name: '计划名称2', status: 2}, {name: '计划名称', status: 1},
{name: '计划名称2', status: 2}, {name: '计划名称', status: 1},
{name: '计划名称2', status: 2}, {name: '计划名称', status: 1},
{name: '计划名称2', status: 2}, {name: '计划名称', status: 1},
{name: '计划名称2', status: 2}, {name: '计划名称', status: 1},
{name: '计划名称2', status: 2}, {name: '计划名称', status: 1},
{name: '计划名称2', status: 2},
]
}
},
methods: {
_search(value) {
this.formObj = this.$resetFields(this.formObj)
console.log('search', value)
},
_highSearch() {
console.log('high-search')
console.log(this.formObj, 'formObj')
},
_clearHigh() {
this.formObj = this.$resetFields(this.formObj)
console.log(this.formObj, 123)
},
_goto(){
this.$router.push('/sampling_list/sampling_list_detail')
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<van-field
v-model="content"
rows="5"
autosize
label="留言"
label-width="50px"
type="textarea"
maxlength="200"
placeholder="请输入您的宝贵建议与意见(200字以内)"
show-word-limit
></van-field>
<div style="height: 44px;width: 80%;margin: 20px auto 0">
<van-button block type="info" @click="_ok">保存</van-button>
</div>
</div>
</template>
<script>
import {advise} from '../../api'
export default {
name: "FeedBack",
data() {
return {
content: ''
}
},
methods: {
async _ok() {
if (this.content === '') {
this.$toast('请输入内容');
} else {
let result = await advise.advise({content: this.content})
if (result) {
this.content = '';
this.$toast.success('提交成功!您的意见我们会慎重考虑!')
setTimeout(() => {
this.$router.go(-1)
}, 2000)
}
}
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="personal-cont">
<div class="layout-cont">
<div class="personal-top-img">
<img src="@/assets/touxiang2.png" @click="_goto">
</div>
<div>
<van-cell-group>
<van-cell title="账号信息" icon="user-o" is-link to="/mine/user_info"></van-cell>
</van-cell-group>
</div>
<div style="margin-top: 10px">
<van-cell-group>
<van-cell title="服务热线:0532-67760070 / 13335043671" icon="phone-o"></van-cell>
</van-cell-group>
</div>
<div style="margin-top: 10px">
<van-cell-group>
<van-cell title="意见反馈" icon="edit" is-link to="/mine/feed_back"></van-cell>
</van-cell-group>
</div>
<div style="margin: 20px 20px 0">
<van-button block type="info" @click="_exit">
安全退出当前账户
</van-button>
</div>
</div>
<FooterBar></FooterBar>
</div>
</template>
<script>
import FooterBar from '@/components/FooterBar.vue'
export default {
name: "Mine",
components:{
FooterBar
},
methods: {
_goto() {
this.$router.push('/mine/user_info')
},
_exit() {
this.$global.logout();
// this.$navigation.cleanRoutes();
this.$router.replace('/login');
},
}
}
</script>
<style scoped>
</style>
<template>
<div>
<div style="margin-top: 20px">
<van-cell title="用户名" :value="userInfo.username"></van-cell>
<van-cell title="真实姓名" :value="userInfo.realname"></van-cell>
<van-cell title="性别" :value="userInfo.sex"></van-cell>
</div>
<div style="margin-top: 20px">
<van-cell title="所属部门" :value="userInfo.orgNames"></van-cell>
<van-cell title="所属角色" :value="userInfo.roleNames"></van-cell>
</div>
<div style="margin-top: 20px">
<van-cell title="手机号" :value="userInfo.mobile"></van-cell>
<van-cell title="个人邮箱" :value="userInfo.email"></van-cell>
<van-cell title="联系QQ" :value="userInfo.qq"></van-cell>
</div>
<div style="margin: 40px auto 0;width: 80%;">
<van-button icon="edit" block type="info" @click="_editPwd">修改密码</van-button>
</div>
</div>
</template>
<script>
import {sysUser} from '../../api'
export default {
data() {
return {
userInfo: {},
id: '',
}
},
mounted() {
this._getUserInfo()
},
methods: {
//跳转
_editPwd() {
this.$router.push('/mine/pwd_edit');
},
//用户信息
async _getUserInfo() {
//重新获取用户信息
let user = await sysUser.getUserInfo();
if (user) {
this.$global.setLogin(user);
this.userInfo = user;
this.id = user.id;
}
},
//退出
_exit() {
this.$global.logout();
// this.$navigation.cleanRoutes(); //清空路由了,但是浏览器中的路由仍在
this.$router.replace('/login')
},
}
}
</script>
<style scoped>
.header-top-title {
margin: 65px auto 10px auto;
text-align: center;
}
</style>
<template>
<div>
<!--标题-->
<ToPBarNormal :title="title"></ToPBarNormal>
<!--提示信息-->
<div class="result-cont">
<p style="padding:10px;text-align: center">更改邮箱需要短信验证。</p>
<div class="phone_edit">
<group>
<x-input title="邮箱" v-model="email" placeholder="请输入邮箱" is-type="email"></x-input>
</group>
</div>
<div style="margin-top: 20px" class="login-exit" @click="_next">下一步</div>
</div>
</div>
</template>
<script>
import ToPBarNormal from '../../../components/topBar/TopBarNormal'
import {XInput, Group} from 'vux'
export default {
components: {
ToPBarNormal,
XInput,
Group,
},
data() {
return {
title: '邮箱',
email: ''
}
},
methods: {
//获取验证码
_next() {
if (this.email) {
let myReg = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
if (myReg.test(this.email)) {
this._ok();
} else {
this._msg('邮箱填写错误');
}
} else {
this._msg('请输入邮箱');
}
},
_ok() {
let data = {
email: this.email,
};
this.$store.dispatch('SystemManage/getEmailCode', data).then(() => {
if (this.$store.state.SystemManage.success) {
this.$router.push({path: '/sys/email_sms', query: {email: this.email}});
} else {
this._msg('验证码发送失败');
}
});
},
//提示
_msg(msg) {
this.$vux.toast.show({
type: 'text',
width: '10em',
text: msg,
time: 1000
});
},
}
}
</script>
<template>
<div>
<!--标题-->
<ToPBarNormal :title="title"></ToPBarNormal>
<!--提示信息-->
<div class="result-cont">
<p style="padding:10px">我们已经给您的邮箱<a> {{email}} </a>发送了一条验证码,请及时查看邮件。</p>
<div class="phone_edit">
<group>
<x-input placeholder="请输入验证码" v-model="code">
<span slot="right" v-show="selected" class="phone_vcode" @click="_getCode"><a>重新发送</a></span>
<span slot="right" v-show="!selected" class="phone_vcode">重新发送({{second}}s)</span>
</x-input>
</group>
</div>
<div style="margin-top: 20px;background: #ccc" class="login-exit" v-show="!code">完成</div>
<div style="margin-top: 20px" class="login-exit" @click="_ok" v-show="code">完成</div>
</div>
</div>
</template>
<script>
import ToPBarNormal from '../../../components/topBar/TopBarNormal'
import {XInput, Group} from 'vux'
export default {
components: {
ToPBarNormal,
XInput,
Group
},
data() {
return {
title: '请输入验证码',
code: '',
email: '',
second: 59,
selected: false,
id: '',
obj: {}
}
},
mounted() {
this._getQuery();
},
methods: {
_getQuery() {
this.email = this.$route.query.email;
this.obj = JSON.parse(localStorage.getItem('fLoginUser'));
this.id = this.obj.id;
this.selected = false;
this.second = 59;
this._count();
},
//提示
_msg(msg) {
this.$vux.toast.show({
type: 'text',
width: '10em',
text: msg,
time: 1000
});
},
//完成
_ok() {
this.$store.dispatch('SystemManage/bindEmail', {code: this.code}).then(() => {
if (this.$store.state.SystemManage.model) {
this._msg('修改成功');
this.$router.go(-2);
}
});
},
//发送验证码
_getCode() {
this.selected = false;
this.second = 59;
let data = {
email: this.email,
};
this.$store.dispatch('SystemManage/getEmailCode', data).then(() => {
if (this.$store.state.SystemManage.success) {
this._count();
} else {
this._msg('验证码发送失败');
}
});
},
//计数
_count() {
let second = this.second;
if (second === 0) {
this.selected = true;
this.second = 59;
return;
}
setTimeout(() => {
this.second = second - 1;
this._count();
}, 1000)
},
}
}
</script>
<template>
<div>
<!--标题-->
<ToPBarNormal :title="title"></ToPBarNormal>
<!--提示信息-->
<div class="result-cont">
<p style="padding:10px;text-align: center">更改手机号码需要短信验证。</p>
<div class="phone_edit">
<group>
<x-input title="+86" v-model="mobile" :max="11" is-type="china-mobile" keyboard="number"
placeholder="请输入手机号"></x-input>
</group>
</div>
<div style="margin-top: 20px" class="login-exit" @click="_next">下一步</div>
</div>
</div>
</template>
<script>
import ToPBarNormal from '../../../components/topBar/TopBarNormal'
import {XInput, Group} from 'vux'
export default {
components: {
ToPBarNormal,
XInput,
Group,
},
name: "phone-edit",
data() {
return {
title: '手机号码',
mobile: ''
}
},
methods: {
//获取验证码
_next() {
if (this.mobile) {
let myReg = /^1\d{10}$/;
if (myReg.test(this.mobile)) {
this._ok();
} else {
this._msg('号码填写错误');
}
} else {
this._msg('请输入手机号');
}
},
_ok() {
let data = {
mobile: this.mobile,
module: 'bindChangeMobile'
};
this.$store.dispatch('SystemManage/getCode', data).then(() => {
if (this.$store.state.SystemManage.model) {
this.$router.push({path: '/sys/sms', query: {mobile: this.mobile}});
} else {
this._msg('验证码发送失败');
}
});
},
//提示
_msg(msg) {
this.$vux.toast.show({
type: 'text',
width: '10em',
text: msg,
time: 1000
});
},
}
}
</script>
<template>
<div>
<!--标题-->
<ToPBarNormal :title="title"></ToPBarNormal>
<!--提示信息-->
<div class="result-cont">
<p style="padding:10px">我们已经给您的手机号<a> +86 {{mobile}} </a>发送了一条验证短信,请及时查看。</p>
<div class="phone_edit">
<group>
<x-input placeholder="请输入短信验证码" v-model="code">
<span slot="right" v-show="selected" class="phone_vcode" @click="_getCode"><a>重新发送</a></span>
<span slot="right" v-show="!selected" class="phone_vcode">重新发送({{second}}s)</span>
</x-input>
</group>
</div>
<div style="margin-top: 20px;background: #ccc" class="login-exit" v-show="!code">完成</div>
<div style="margin-top: 20px" class="login-exit" @click="_ok" v-show="code">完成</div>
</div>
</div>
</template>
<script>
import ToPBarNormal from '../../../components/topBar/TopBarNormal'
import {XInput, Group} from 'vux'
export default {
components: {
ToPBarNormal,
XInput,
Group
},
name: "sms",
data() {
return {
title: '请输入短信验证码',
code: '',
mobile: '',
second: 59,
selected: false
}
},
mounted() {
this._getQuery();
},
methods: {
_getQuery() {
this.mobile = this.$route.query.mobile;
this.selected = false;
this.second = 59;
this._count();
},
//提示
_msg(msg) {
this.$vux.toast.show({
type: 'text',
width: '10em',
text: msg,
time: 1000
});
},
//完成
_ok() {
this.$store.dispatch('SystemManage/changeBindMobile', this.code).then(() => {
if (this.$store.state.SystemManage.model) {
this._msg('修改成功');
this.$router.go(-2);
}
});
},
//发送验证码
_getCode() {
this.selected = false;
this.second = 59;
let data = {
mobile: this.mobile,
module: 'bindChangeMobile'
};
this.$store.dispatch('SystemManage/getCode', data).then(() => {
if (this.$store.state.SystemManage.model) {
this._count();
} else {
this._msg('验证码发送失败');
}
});
},
//计数
_count() {
let second = this.second;
if (second === 0) {
this.selected = true;
this.second = 59;
return;
}
setTimeout(() => {
this.second = second - 1;
this._count();
}, 1000)
},
}
}
</script>
<template>
<div>
<van-form @submit="onSubmit">
<div style="margin-top: 20px">
<van-field v-model="oldPwd" label="旧密码" placeholder="请输入旧密码"
:rules="[{ required: true, message: '' }]"></van-field>
</div>
<div style="margin-top: 20px">
<van-field v-model="newPwd" label="新密码" placeholder="请输入新密码"
:rules="[{ required: true, message: '' }]"></van-field>
</div>
<div style="margin-top: 20px">
<van-field v-model="newPwds" label="确认密码" placeholder="请确认密码"
:rules="[{ required: true, message: '' }]"></van-field>
</div>
<div style="margin: 40px 16px;">
<van-button block type="info" native-type="submit">
保存
</van-button>
</div>
</van-form>
</div>
</template>
<script>
import {sysUser} from '@/api'
export default {
name: "pwd-edit",
data() {
return {
title: '修改密码',
oldPwd: '',
newPwd: '',
newPwds: '',
}
},
methods: {
onSubmit() {
if (this.newPwds !== this.newPwd) {
this.$toast('两次填写的密码不一致');
} else {
this._save()
}
},
_save: async function () {
let data = {
oldPwd: this.oldPwd,
newPwd: this.newPwd
};
let result = await sysUser.editPsd(data)
if (result) {
let that = this;
this.$dialog.confirm({
title: '提示',
message: '登录密码已被修改,请重新登录!',
}).then(() => {
that._exit(); //退出重新登录
}).catch(() => {
// on cancel
});
}
},
//退出
_exit() {
this.$global.logout();
localStorage.removeItem('password'); //清空密码
// this.$navigation.cleanRoutes();
this.$router.replace('/login');
},
}
}
</script>
<template>
<div>
<!--标题-->
<div class="top-bar">
<div @click="_back">
<img src="../../../../static/image/back.png">
</div>
<div>{{title}}</div>
<div @click="_save">完成</div>
</div>
<!--提示信息-->
<div class="result-cont" style="margin-top: 60px">
<div class="phone_edit">
<group>
<x-input title="联系QQ" v-model="qq" placeholder="请输入联系QQ"></x-input>
</group>
</div>
</div>
</div>
</template>
<script>
import {XInput, Group} from 'vux'
import Global from '../../../api/config'
export default {
components: {
XInput,
Group,
},
data() {
return {
title: '修改联系QQ',
id: this.$route.query.id,
qq: this.$route.query.data.qq,
}
},
methods: {
//保存信息
_save() {
if (this.qq) {
let data = {
qq: this.qq
};
this.$store.dispatch('SystemManage/userEdit', {id: this.id, obj: data}).then(() => {
if (this.$store.state.SystemManage.success) {
this._back();
}
});
} else {
this._msg('QQ不能为空!');
}
},
//提示
_msg(msg) {
this.$vux.toast.show({
type: 'text',
width: '10em',
text: msg,
time: 1000
});
},
_back() {
this.$router.go(-1);
},
}
}
</script>
<template>
<div>
<!--标题-->
<div class="top-bar">
<div @click="_back">
<img src="../../../../static/image/back.png">
</div>
<div>{{title}}</div>
<div @click="_save">完成</div>
</div>
<!--提示信息-->
<div class="result-cont" style="margin-top: 60px">
<div class="phone_edit">
<group>
<x-input title="真实姓名" v-model="realname" placeholder="请输入真实姓名"></x-input>
</group>
</div>
</div>
</div>
</template>
<script>
import {XInput, Group} from 'vux'
import Global from '../../../api/config'
export default {
components: {
XInput,
Group,
},
data() {
return {
title: '修改真实姓名',
id: this.$route.query.id,
realname: this.$route.query.data.realname,
}
},
methods: {
//保存信息
_save() {
if (this.realname) {
let data = {
realname: this.realname
};
this.$store.dispatch('SystemManage/userEdit', {id: this.id, obj: data}).then(() => {
if (this.$store.state.SystemManage.success) {
this._back();
}
});
} else {
this._msg('真实姓名不能为空!');
}
},
//提示
_msg(msg) {
this.$vux.toast.show({
type: 'text',
width: '10em',
text: msg,
time: 1000
});
},
_back() {
this.$router.go(-1);
},
}
}
</script>
<template>
<div>
<!--标题-->
<div class="top-bar">
<div @click="_back">
<img src="../../../../static/image/back.png">
</div>
<div>{{title}}</div>
<div @click="_save">完成</div>
</div>
<!--提示信息-->
<div class="result-cont" style="margin-top: 60px">
<div class="phone_edit">
<group>
<x-input title="用户名" v-model="username" placeholder="请输入用户名称"></x-input>
</group>
</div>
</div>
</div>
</template>
<script>
import {XInput, Group} from 'vux'
import Global from '../../../api/config'
export default {
components: {
XInput,
Group,
},
data() {
return {
title: '修改用户名',
id: this.$route.query.id,
username: this.$route.query.data.username,
}
},
methods: {
_ok() {
let that = this;
this.$vux.confirm.show({
title: '提示',
content: '用户名已被修改成 ' + this.username + ' ,请重新登录!',
theme: 'ios',
showCancelButton: false,
onConfirm() {
that._exit(); //退出重新登录
}
});
},
//保存信息
_save() {
if (this.username) {
let data = {
username: this.username
};
this.$store.dispatch('SystemManage/userEdit', {id: this.id, obj: data}).then(() => {
if (this.$store.state.SystemManage.success) {
this._ok();
}
});
} else {
this._msg('用户名不能为空!');
}
},
//提示
_msg(msg) {
this.$vux.toast.show({
type: 'text',
width: '10em',
text: msg,
time: 1000
});
},
//退出
_exit() {
Global.logout();
localStorage.setItem('username', this.username); //设置用户名
this.$navigation.cleanRoutes(); //清空路由了,但是浏览器中的路由仍在
this.$router.replace('/login');
},
_back() {
this.$router.go(-1);
},
}
}
</script>
<template>
<customer-navBar-layout>
<template #navBar>
<van-nav-bar v-if="showCheck"
:title="$route.meta.title"
right-text="取消"
left-arrow
@click-left="_back"
@click-right="_hideCheck">
</van-nav-bar>
<van-nav-bar
v-else
:title="$route.meta.title"
right-text="添加"
left-arrow
@click-left="_back"
@click-right="_add"
></van-nav-bar>
<!--todo 批量打印、删除-->
</template>
<template #content>
<search-bar label="抽样单编号" highSearch @search="_search" @high-search="_highSearch"
@clear-high="_clearHigh">
<template #highSearch>
<van-field v-model="formObj.name" label="抽样单编号" placeholder="请输入抽样单编号"></van-field>
<!--<datetime-field label="计划日期" v-model="formObj.planDate"></datetime-field>-->
<!--<van-field v-model="formObj.uname" label="登记人" placeholder="请输入登记人"></van-field>-->
<!--<datetime-field label="登记日期" v-model="formObj.ctime"></datetime-field>-->
</template>
</search-bar>
<div class="layout-cont-sh" :class="{'layout-cont-sh-btn':showCheck}">
<!--下拉刷新 https://vant-contrib.gitee.io/vant/#/zh-CN/pull-refresh-->
<van-pull-refresh v-model="refreshing" @refresh="_refresh">
<!--上拉加载 https://vant-contrib.gitee.io/vant/#/zh-CN/list-->
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="_load">
<van-checkbox-group v-model="checkListValue" ref="checkboxGroup">
<van-swipe-cell v-for="item in resultList" :key="item.id">
<div class="result-item" @click="_tapItem(item)" v-touch:longtap="_longtapHandler">
<van-checkbox :name="item.id" shape="square" v-if="showCheck"></van-checkbox>
<div>计划名称:{{item.name}}</div>
<div>抽样进度:已填抽样单/抽样数</div>
<div>状态:{{item.status}}</div>
<p>附件:</p>
</div>
<template #right>
<van-button square type="info" text="编辑" class="swipe-cell-btn"
@click="_edit"></van-button>
<van-button square type="primary" text="打印" class="swipe-cell-btn"
@click="_print"></van-button>
<van-button square type="danger" text="删除" class="swipe-cell-btn"
@click="_del"></van-button>
</template>
</van-swipe-cell>
</van-checkbox-group>
</van-list>
</van-pull-refresh>
</div>
<div class="bottom-btn">
<div v-if="showCheck" @click="_checkAll">{{checkAll?'取消全选':'全选'}}</div>
</div>
</template>
<SelectShelves ref="shelvesSelect" @on-select="_shelvesResult"></SelectShelves>
</customer-navBar-layout>
</template>
<script>
import {message} from '@/api'
import SelectShelves from './components/SelectShelves'
export default {
name: "SamplingList",
components: {
SelectShelves
},
data() {
return {
formObj: {
name: ''
},
showPopup: true,
showCheck: false,
checkListValue: [],
resultList: [],
page: 1,
rows: 10,
refreshing: false,//刷新中...
loading: false,//加载中...
finished: false,//没有更多数据
}
},
watch: {
checkListValue: function (oldVal, newVal) {
console.log(oldVal, newVal)
}
},
computed: {
checkAll: function () {
if (this.resultList.length) {
return this.checkListValue.length === this.resultList.length;
} else {
return false
}
}
},
mounted() {
this._page()
},
methods: {
_search(value) {
this.formObj = this.$resetFields(this.formObj)
this._refresh()
console.log('search', value)
},
_highSearch() {
console.log('high-search')
console.log(this.formObj, 'formObj')
},
_clearHigh() {
this.formObj = this.$resetFields(this.formObj)
console.log(this.formObj, 123)
},
_searchParams() {
let data = {
page: this.page,
rows: this.rows,
...this.formObj//todo 简单查询的关键字
};
return this.$serializeForm(data)
},
_page: async function () {
let result = await message.myPage(this._searchParams())
this.resultList = [...(this.page === 1 ? [] : this.resultList), ...result.records]
this.refreshing = false
this.loading = false
if (this.resultList.length === result.total) {
this.finished = true
}
},
_refresh() {
this.page = 1;
this._page()
},
_load() {
this.page = this.page + 1;
this._page()
},
_back() {
this.$router.go(-1)
},
_add() {
this.$refs.shelvesSelect._open()
},
_shelvesResult(res) {
if (res === '1') {
this.$router.push('/sampling_list/sampling_list_add_net')
} else {
this.$router.push('/sampling_list/sampling_list_add')
}
},
_longtapHandler() {
console.log(1)
this.showCheck = true
},
_hideCheck() {
this.showCheck = false
this.checkListValue = []
},
_checkAll() {
if (this.checkAll) {
this.$refs.checkboxGroup.toggleAll();
} else {
this.$refs.checkboxGroup.toggleAll(true);
}
},
_tapItem(item) {
if (this.showCheck) {
if (this.checkListValue.indexOf(item.id) === -1) {
this.checkListValue.push(item.id);
} else {
this.checkListValue.splice(this.checkListValue.indexOf(item.id), 1);
}
} else {
if (item.type === 1) {
this.$router.push('/sampling_list/sampling_list_detail_net')
} else {
this.$router.push('/sampling_list/sampling_list_detail')
}
}
},
_edit() {
},
_print() {
/*todo 蓝牙打印*/
},
_del() {
},
}
}
</script>
<style scoped>
</style>
<template>
<div>
<add-table>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="抽样单编号"
:rules="[{ required: true, message: '请填写抽样单编号' }]"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="No."
:rules="[{ required: true, message: '请填写' }]"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="任务来源"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="checkboxGroup"
label="任务类别">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">监督抽检</van-checkbox>
<van-checkbox name="2" shape="square">风险监测</van-checkbox>
<van-checkbox name="3" shape="square">评价性抽检</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
被抽样单位信息
</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="单位名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="单位地址"
placeholder="如证照与许可证不一致,以许可证为准"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="区域类型">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">景点</van-checkbox>
<van-checkbox name="2" shape="square">城市</van-checkbox>
<van-checkbox name="3" shape="square">乡镇</van-checkbox>
<van-checkbox name="3" shape="square">学校周边</van-checkbox>
<van-checkbox name="3" shape="square">其他</van-checkbox>
</van-checkbox-group>
<div>(____)</div>
</template>
</van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">经营许可证号</van-checkbox>
<van-checkbox name="2" shape="square">生产许可证号</van-checkbox>
</van-checkbox-group>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="法人代表"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="联系人"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="营业执照号/社会信用代码"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="联系电话"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
抽样地点
</table-col>
<table-col>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<div>
<div style="display: flex;padding: 5px 10px;flex-wrap: wrap">
<div style="align-self: center">生产环节:</div>
<van-checkbox name="1" shape="square">原辅料库</van-checkbox>
<van-checkbox name="1" shape="square">生产线</van-checkbox>
<van-checkbox name="1" shape="square">半成品库</van-checkbox>
<van-checkbox name="1" shape="square">成品库待检区</van-checkbox>
<van-checkbox name="2" shape="square">成品库已检区</van-checkbox>
<van-checkbox name="2" shape="square">其他</van-checkbox>
</div>
<div style="display: flex;padding: 5px 10px;flex-wrap: wrap">
<div style="align-self: center">流通环节:</div>
<van-checkbox name="1" shape="square">农贸市场</van-checkbox>
<van-checkbox name="1" shape="square">菜市场</van-checkbox>
<van-checkbox name="1" shape="square">批发市场</van-checkbox>
<van-checkbox name="1" shape="square">商场</van-checkbox>
<van-checkbox name="2" shape="square">超市</van-checkbox>
<van-checkbox name="2" shape="square">小食杂店</van-checkbox>
<van-checkbox name="2" shape="square">其他</van-checkbox>
</div>
<div style="display: flex;padding: 5px 10px;flex-wrap: wrap">
<div style="align-self: center;">餐饮环节:</div>
<van-checkbox name="1" shape="square">餐馆</van-checkbox>
<van-checkbox name="1" shape="square">特大型餐馆</van-checkbox>
<van-checkbox name="1" shape="square">大型餐馆</van-checkbox>
<van-checkbox name="1" shape="square">中型餐馆</van-checkbox>
<van-checkbox name="2" shape="square">小型餐馆</van-checkbox>
</div>
<div style="display: flex;padding: 5px 10px;flex-wrap: wrap">
<div style="align-self: center;width:72px"></div>
<van-checkbox name="2" shape="square">食堂</van-checkbox>
<van-checkbox name="2" shape="square">机关食堂</van-checkbox>
<van-checkbox name="2" shape="square">学校/托幼食堂</van-checkbox>
<van-checkbox name="2" shape="square">企事业单位食堂</van-checkbox>
<van-checkbox name="2" shape="square">建筑工地食堂</van-checkbox>
</div>
<div style="display: flex;padding: 5px 10px;flex-wrap: wrap">
<div style="align-self: center;width:72px"></div>
<van-checkbox name="2" shape="square">小吃店</van-checkbox>
<van-checkbox name="2" shape="square">快餐店</van-checkbox>
<van-checkbox name="2" shape="square">饮品店集体用餐配送单位</van-checkbox>
<van-checkbox name="2" shape="square">中央厨房</van-checkbox>
<van-checkbox name="2" shape="square">其他</van-checkbox>
</div>
</div>
</van-checkbox-group>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
样品信息
</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="样品名称"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="商标"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="条形码"
></van-field>
</table-col>
</table-row>
<table-row>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="样品类型">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">食用农产品</van-checkbox>
<van-checkbox name="2" shape="square">工业加工食品</van-checkbox>
<van-checkbox name="3" shape="square">餐饮加工食品</van-checkbox>
<van-checkbox name="3" shape="square">食品添加剂</van-checkbox>
<van-checkbox name="3" shape="square">食品相关产品</van-checkbox>
<van-checkbox name="3" shape="square">其他</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="样品来源">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">加工/自制</van-checkbox>
<van-checkbox name="2" shape="square">委托生产</van-checkbox>
<van-checkbox name="3" shape="square">外购</van-checkbox>
<van-checkbox name="3" shape="square">其他</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="样品属性">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">普通食品</van-checkbox>
<van-checkbox name="2" shape="square">特殊食品</van-checkbox>
<van-checkbox name="3" shape="square">节令食品</van-checkbox>
<van-checkbox name="3" shape="square">重大活动保障食品</van-checkbox>
<van-checkbox name="3" shape="square">其他</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">生产日期</van-checkbox>
<van-checkbox name="1" shape="square">购进日期</van-checkbox>
<van-checkbox name="2" shape="square">加工日期</van-checkbox>
<van-checkbox name="1" shape="square">检疫日期</van-checkbox>
</van-checkbox-group>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="执行标准/技术文档"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="样品批号"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="规格型号"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="质量等级"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="保质期"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="单价"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="抽样基数"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="抽样数量"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="备样数量"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="checkboxGroup"
label="抽样方式">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">无菌抽样</van-checkbox>
<van-checkbox name="2" shape="square">非无菌抽样</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="checkboxGroup"
label="是否进口">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square"></van-checkbox>
<van-checkbox name="2" shape="square"></van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="原产地"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="包装分类">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">预包装</van-checkbox>
<van-checkbox name="2" shape="square">非定量包装</van-checkbox>
<van-checkbox name="2" shape="square">无包装</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="储存条件">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">常温</van-checkbox>
<van-checkbox name="2" shape="square">冷藏</van-checkbox>
<van-checkbox name="2" shape="square">冷冻</van-checkbox>
<van-checkbox name="2" shape="square">避光</van-checkbox>
<van-checkbox name="2" shape="square">密闭</van-checkbox>
<van-checkbox name="2" shape="square">阴凉</van-checkbox>
<van-checkbox name="2" shape="square">通风</van-checkbox>
<van-checkbox name="2" shape="square">干燥</van-checkbox>
<van-checkbox name="2" shape="square">其他</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>(标称)生产者信息</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="生产者名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="生产者地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="生产许可证号"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="联系电话"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>(标称)第三方企业信息</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="企业名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="企业地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="企业性质">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">委托</van-checkbox>
<van-checkbox name="2" shape="square">代理</van-checkbox>
<van-checkbox name="3" shape="square">经销</van-checkbox>
<van-checkbox name="3" shape="square">进口</van-checkbox>
<van-checkbox name="3" shape="square">其他</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="企业许可证号"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="联系电话"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>抽样单位信息</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="单位名称"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="联系人"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="电话"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="传真"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="100px"
label-align="center"
name="num"
label="备注"
></van-field>
</table-col>
</table-row>
</add-table>
<div class="bottom-btn">
<!--<van-button square type="default" color="#7232dd" @click="_cancel">取消</van-button>-->
<van-button block type="info" @click="_ok">保存</van-button>
</div>
</div>
</template>
<script>
import SamplingListAddTable from './components/SamplingListAddTable'
import TableRow from './components/TableRow'
import TableCol from './components/TableCol'
export default {
name: "SamplingListAdd",
components: {
"add-table": SamplingListAddTable,
"table-row": TableRow,
"table-col": TableCol
},
methods: {
_ok() {
},
}
}
</script>
<style lang="less">
@import "../../styles/sampling-list-add.less";
</style>
<template>
<div>
<add-table>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="抽样单编号"
:rules="[{ required: true, message: '请填写抽样单编号' }]"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="No."
:rules="[{ required: true, message: '请填写' }]"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="任务来源"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="checkboxGroup"
label="任务类别">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">监督抽检</van-checkbox>
<van-checkbox name="2" shape="square">风险监测</van-checkbox>
<van-checkbox name="3" shape="square">评价性抽检</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
网络食品交易第三方平台提供者信息
</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="平台名称"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="营业执照号/社会信用代码"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="平台网址"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="电信业务经营许可证"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="平台地址"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="法人代表"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
被抽样单位信息(入网经营者信息)
</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="单位名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="单位地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="网店商铺名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="样品网址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">经营许可证号</van-checkbox>
<van-checkbox name="2" shape="square">生产许可证号</van-checkbox>
</van-checkbox-group>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="联系人"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="营业执照号/社会信用代码"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="联系电话"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
抽样地点
</table-col>
<table-col>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">流通环节:网购</van-checkbox>
<van-checkbox name="2" shape="square">餐饮环节:外卖餐饮</van-checkbox>
</van-checkbox-group>
</table-col>
</table-row>
<table-row flex-none>
<table-col>
样品信息
</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="样品名称"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="商标"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="订单编号"
></van-field>
</table-col>
</table-row>
<table-row>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="样品类型">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">食用农产品</van-checkbox>
<van-checkbox name="2" shape="square">工业加工食品</van-checkbox>
<van-checkbox name="3" shape="square">餐饮加工食品</van-checkbox>
<van-checkbox name="3" shape="square">食品添加剂</van-checkbox>
<van-checkbox name="3" shape="square">食品相关产品</van-checkbox>
<van-checkbox name="3" shape="square">其他</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="样品来源">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">加工/自制</van-checkbox>
<van-checkbox name="2" shape="square">委托生产</van-checkbox>
<van-checkbox name="3" shape="square">外购</van-checkbox>
<van-checkbox name="3" shape="square">其他</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="样品属性">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">普通食品</van-checkbox>
<van-checkbox name="2" shape="square">特殊食品</van-checkbox>
<van-checkbox name="3" shape="square">节令食品</van-checkbox>
<van-checkbox name="3" shape="square">重大活动保障食品</van-checkbox>
<van-checkbox name="3" shape="square">其他</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">生产日期</van-checkbox>
<van-checkbox name="2" shape="square">加工日期</van-checkbox>
</van-checkbox-group>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="保质期"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="生产批号"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="执行标准/技术文件"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="质量等级"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="规格型号"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="抽样数量"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="备样数量"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="checkboxGroup"
label="抽样方式">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">无菌抽样</van-checkbox>
<van-checkbox name="2" shape="square">非无菌抽样</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="条形码"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="单价"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="checkboxGroup"
label="是否进口">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square"></van-checkbox>
<van-checkbox name="2" shape="square"></van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="原产地"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="包装分类">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">预包装</van-checkbox>
<van-checkbox name="2" shape="square">非定量包装</van-checkbox>
<van-checkbox name="2" shape="square">无包装</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="储存条件">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">常温</van-checkbox>
<van-checkbox name="2" shape="square">冷藏</van-checkbox>
<van-checkbox name="2" shape="square">冷冻</van-checkbox>
<van-checkbox name="2" shape="square">避光</van-checkbox>
<van-checkbox name="2" shape="square">密闭</van-checkbox>
<van-checkbox name="2" shape="square">阴凉</van-checkbox>
<van-checkbox name="2" shape="square">通风</van-checkbox>
<van-checkbox name="2" shape="square">干燥</van-checkbox>
<van-checkbox name="2" shape="square">其他</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>(标称)生产者信息</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="生产者名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="生产者地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="生产许可证号"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="联系电话"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>(标称)第三方企业信息</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="企业名称"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="企业地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="checkboxGroup"
label="企业性质">
<template #input>
<van-checkbox-group v-model="checkboxGroup" direction="horizontal">
<van-checkbox name="1" shape="square">委托</van-checkbox>
<van-checkbox name="2" shape="square">代理</van-checkbox>
<van-checkbox name="3" shape="square">经销</van-checkbox>
<van-checkbox name="3" shape="square">进口</van-checkbox>
<van-checkbox name="3" shape="square">其他</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="企业许可证号"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="联系电话"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row flex-none>
<table-col>抽样单位信息</table-col>
<table-col flex-none>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="单位名称"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-align="center"
name="num"
label="地址"
></van-field>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="联系人"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="电话"
></van-field>
</table-col>
<table-col>
<van-field
label-class="cus-field-class"
label-width="25%"
label-align="center"
name="num"
label="传真"
></van-field>
</table-col>
</table-row>
</table-col>
</table-row>
<table-row>
<table-col>
<van-field
label-class="cus-field-class"
label-width="100px"
label-align="center"
name="num"
label="备注"
></van-field>
</table-col>
</table-row>
</add-table>
<div class="bottom-btn">
<!--<van-button square type="default" color="#7232dd" @click="_cancel">取消</van-button>-->
<van-button block type="info" @click="_ok">保存</van-button>
</div>
</div>
</template>
<script>
import SamplingListAddTable from './components/SamplingListAddTable'
import TableRow from './components/TableRow'
import TableCol from './components/TableCol'
export default {
name: "SamplingListAddNet",
components: {
"add-table": SamplingListAddTable,
"table-row": TableRow,
"table-col": TableCol
}
}
</script>
<style lang="less">
@import "../../styles/sampling-list-add.less";
</style>
<template>
<div>
详情
</div>
</template>
<script>
export default {
name: "SamplingListDetail"
}
</script>
<style scoped>
</style>
<template>
<div>
详情网络
</div>
</template>
<script>
export default {
name: "SamplingListDetail"
}
</script>
<style scoped>
</style>
<template>
<div>
<search-bar label="计划名称"
highSearch
@search="_search"
@high-search="_highSearch"
@clear-high="_clearHigh">
<template #highSearch>
<van-field v-model="formObj.name" label="计划名称" placeholder="请输入计划名称"></van-field>
<datetime-field label="计划开始日期" v-model="formObj.planDateBegin"></datetime-field>
<datetime-field label="计划结束日期" v-model="formObj.planDateEnd"></datetime-field>
<van-field v-model="formObj.uname" label="登记人" placeholder="请输入登记人"></van-field>
<datetime-field label="登记开始日期" v-model="formObj.ctimeBegin"></datetime-field>
<datetime-field label="登记结束日期" v-model="formObj.ctimeEnd"></datetime-field>
</template>
</search-bar>
<div class="layout-cont-sh">
<!--下拉刷新 https://vant-contrib.gitee.io/vant/#/zh-CN/pull-refresh-->
<van-pull-refresh v-model="refreshing" @refresh="_refresh">
<!--上拉加载 https://vant-contrib.gitee.io/vant/#/zh-CN/list-->
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="_load">
<div class="result-item" v-for="item in resultList" :key="item.name" @click="_goto(item)">
<div>计划名称:{{item.name}}</div>
<div>抽样进度:{{item.completionRatio}}</div>
<div>状态:{{item.progress}}</div>
</div>
</van-list>
</van-pull-refresh>
</div>
</div>
</template>
<script>
import {samplingPlan} from '../../api'
export default {
components: {},
data() {
return {
formObj: {
name: '',
planDateBegin: '',
planDateEnd: '',
uname: '',
ctimeBegin: '',
ctimeEnd: '',
flag: 0
},
key: '',
resultList: [],
page: 1,
rows: 10,
refreshing: false,//刷新中...
loading: false,//加载中...
finished: false,//没有更多数据
}
},
mounted() {
this._getData()
},
methods: {
//简单查询 清空高级查询条件 赋值简单查询数据
_search(value) {
this.key = value
this.formObj = this.$resetFields(this.formObj)
this.formObj.flag = 0
this._refresh()
},
//高级搜索 清空key 查询
_highSearch() {
this.key = ''
this._refresh()
},
_clearHigh() {
this.formObj = this.$resetFields(this.formObj)
this.formObj.flag = 0
},
_searchParams() {
let data = {
page: this.page,
rows: this.rows,
...this.formObj
};
if (this.key) {
data.name = this.key
}
return this.$serializeForm(data)
},
_getData: async function () {
let result = await samplingPlan.page(this._searchParams())
this.resultList = [...(this.page === 1 ? [] : this.resultList), ...result.records]
this.refreshing = false
this.loading = false
if (this.resultList.length === result.total) {
this.finished = true
}
},
_refresh() {
this.page = 1;
this._getData()
},
_load() {
this.page = this.page + 1;
this._getData()
},
_goto() {
this.$router.push('/sampling_list/sampling_list')
},
}
}
</script>
<style scoped>
</style>
<template>
<div class="list-table-box">
<div class="table">
<slot></slot>
</div>
</div>
</template>
<script>
export default {
name: "SamplingAddLayout"
}
</script>
<style scoped>
</style>
<template>
<div>
<!--https://youzan.github.io/vant/#/zh-CN/popup#dai-ma-yan-shi-->
<!--https://youzan.github.io/vant/#/zh-CN/form#biao-dan-xiang-lei-xing---dan-xuan-kuang-->
<!--https://youzan.github.io/vant/#/zh-CN/radio-->
<!--https://youzan.github.io/vant/#/zh-CN/tree-select-->
<!--https://youzan.github.io/vant/#/zh-CN/button-->
<van-popup v-model="showPopup" position="bottom"
:safe-area-inset-bottom="true"
:close-on-popstate="true"
:style="{ height: '70%' }">
<!--<van-tree-select height="100%"-->
<!--:items="items"-->
<!--:main-active-index.sync="active"-->
<!--@click-nav="_getShelves">-->
<!--<template #content>-->
<!--<div v-for="item in shelvesList" :key="item" style="height: 40px;background: bisque">{{item}}</div>-->
<!--</template>-->
<!--</van-tree-select>-->
<div class="popup-cont-btn popup-shelves">
<div>
<p>抽样单类型</p>
<van-radio-group v-model="radio" direction="horizontal">
<van-radio name="1">网络</van-radio>
<van-radio name="2">非网络</van-radio>
</van-radio-group>
</div>
<div>
<p>所属货架</p>
<van-tree-select
height="100%"
:items="items"
:active-id.sync="activeId"
:main-active-index.sync="activeIndex"
></van-tree-select>
</div>
</div>
<div class="bottom-btn bottom-btn-two">
<van-button square type="default" color="#f7f8fa" @click="_cancel">取消</van-button>
<van-button square type="info" @click="_ok">确定</van-button>
</div>
</van-popup>
</div>
</template>
<script>
export default {
name: "SelectShelves",
data() {
return {
showPopup: false,
// items: [{text: '地点 1'}, {text: '地点 2'}],
shelvesList: [],
radio: 0,
items: [
{
text: '地点1',
children: [
{
text: '货架1-1',
id: 1,
},
{
text: '货架1-2',
id: 2,
},
],
},
{
text: '地点2',
children: [
{
text: '货架2-1',
id: 23,
},
{
text: '货架2-2',
id: 24,
},
],
},
],
active: 0,
activeId: 0,
activeIndex: 0,
}
},
methods: {
_open() {
this.showPopup = true
},
_getShelves(item) {
if (item === 0) {
this.shelvesList = ['货架1']
} else {
this.shelvesList = ['货架2']
}
},
_selectResult(item) {
console.log(item, 123)
},
_cancel() {
this.showPopup = false
},
_ok() {
if (this.radio === 0) {
/*todo 修改toast默认配置 https://youzan.github.io/vant/#/zh-CN/toast#xiu-gai-mo-ren-pei-zhi*/
this.$toast('请选择抽样单类型!');
} else {
this.$emit('on-select', this.radio)
}
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="column-cus" :class="{'display-flex-none':flexNone}">
<slot></slot>
</div>
</template>
<script>
export default {
name: "TableCol",
props:{
flexNone:Boolean
}
}
</script>
<style scoped>
</style>
<template>
<div class="row-cus" :class="{'flex-column-1-width-none':flexNone}">
<slot></slot>
</div>
</template>
<script>
export default {
name: "TableRow",
props:{
flexNone:Boolean
}
}
</script>
<style scoped>
</style>
<template>
<div>
<div class="layout-cont-btn">
<!--下拉刷新 https://vant-contrib.gitee.io/vant/#/zh-CN/pull-refresh-->
<van-pull-refresh v-model="refreshing" @refresh="_request">
<van-swipe-cell v-for="item in resultList" :key="item.name">
<div class="result-item" @click="_goto(item)">
<div>货架名称:{{item.placeName}}</div>
</div>
<template #right>
<van-button square type="danger" text="删除" class="swipe-cell-btn"
@click="_del(item.id)"></van-button>
</template>
</van-swipe-cell>
</van-pull-refresh>
</div>
<div class="bottom-btn">
<van-button type="info" block @click="_add">添加货架</van-button>
</div>
</div>
</template>
<script>
export default {
name: "GoodsShelves",
data() {
return {
resultList: [{placeItem: 2322}],
locId: this.$route.locId,
refreshing: false
}
},
mounted() {
this._request()
},
methods: {
_request: async function () {
// let result = await samplingPlan.getShelves(this.locId)
// if (result) {
// this.resultList = result.records
// this.refreshing = false
//
// }
},
_del: async function () {
// let reuslt = await samplingPlan.delShelves(id)
// if (reuslt) {
// this.$toast('操作成功!')
// }
},
_add(){
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<div class="layout-cont-btn">
<van-pull-refresh v-model="refreshing" @refresh="_request">
<van-swipe-cell v-for="item in resultList" :key="item.name">
<div class="result-item" @click="_goto(item)">
<div>地点:{{item.placeName}}</div>
<div>地址:{{item.address}}</div>
<div>打卡时间:{{item.attendanceTime}}</div>
<div>打卡地点:{{item.attendanceAddress}}</div>
</div>
<template #right>
<van-button square type="info" text="打卡" class="swipe-cell-btn"
@click="_getWebLoc"></van-button>
<van-button square type="danger" text="删除" class="swipe-cell-btn"></van-button>
</template>
</van-swipe-cell>
</van-pull-refresh>
</div>
<div class="bottom-btn">
<van-button type="info" block @click="_add">添加地点</van-button>
</div>
</div>
</template>
<script>
import BaiduMap from "../../lib/map.js";
export default {
name: "SamplingLocation",
data() {
return {
resultList: [{placeName: '21'}],
refreshing: false,
planId: this.$route.planId
}
},
mounted() {
this._request()
},
methods: {
_request: async function () {
// let result = await samplingPlan.getLoc(this.planId)
// if(result){
// this.resultList = result.records
// this.refreshing =false
// }
},
_add() {
},
_getWebLoc() {
let that = this
that.$nextTick(() => {
BaiduMap.init().then(BMap => {
let geolocation = new BMap.Geolocation()
geolocation.getCurrentPosition(function (r) {
if (this.getStatus() === 'BMAP_STATUS_SUCCESS') {
that.longitude = that.$changeToDFM(r.point.lng, 'E');
that.latitude = that.$changeToDFM(r.point.lat, 'N');
that._action();
} else {
alert('获取不到位置信息')
}
}, {enableHighAccuracy: true})
})
})
},
// 打卡
_action() {
// this.action = Global.baseURL + '/env/v1/point_attachment/upload/?planId=' + this.planId
// + '&point=' + encodeURIComponent(this.point) + '&pointCode=' + encodeURIComponent(this.pointCode)
// + '&testType=' + encodeURIComponent(this.testType) + '&longitude=' + encodeURIComponent(this.longitude)
// + '&latitude=' + encodeURIComponent(this.latitude);
},
_goto(data) {
this.$router.push({path: '/sampling_task/goods_shelves', query: {id: data.id}})
},
}
}
</script>
<style scoped>
</style>
<template>
<div>
<search-bar label="计划名称"
highSearch
@search="_search"
@high-search="_highSearch"
@clear-high="_clearHigh">
<template #highSearch>
<van-field v-model="formObj.name" label="计划名称" placeholder="请输入计划名称"></van-field>
<datetime-field label="计划开始日期" v-model="formObj.planDateBegin"></datetime-field>
<datetime-field label="计划结束日期" v-model="formObj.planDateEnd"></datetime-field>
<van-field v-model="formObj.uname" label="登记人" placeholder="请输入登记人"></van-field>
<datetime-field label="登记开始日期" v-model="formObj.ctimeBegin"></datetime-field>
<datetime-field label="登记结束日期" v-model="formObj.ctimeEnd"></datetime-field>
</template>
</search-bar>
<div class="layout-cont-sh">
<!--下拉刷新 https://vant-contrib.gitee.io/vant/#/zh-CN/pull-refresh-->
<van-pull-refresh v-model="refreshing" @refresh="_refresh">
<!--上拉加载 https://vant-contrib.gitee.io/vant/#/zh-CN/list-->
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="_load">
<van-swipe-cell v-for="item in resultList" :key="item.name">
<div class="result-item" @click="_goto(item)">
<div>计划名称:{{item.name}}</div>
<div>抽样进度:{{item.completionRatio}}</div>
<div>状态:{{item.progress}}</div>
</div>
<template #right>
<van-button square type="info" text="认领" class="swipe-cell-btn"
v-if="item.progress==='审批通过'" @click="_receive(item.id)"></van-button>
<van-button square type="danger" text="结束" class="swipe-cell-btn" @click="_finish(item.id)"
v-else></van-button>
</template>
</van-swipe-cell>
</van-list>
</van-pull-refresh>
</div>
</div>
</template>
<script>
import {samplingPlan} from '../../api'
export default {
components: {},
data() {
return {
formObj: {
name: '',
planDateBegin: '',
planDateEnd: '',
uname: '',
ctimeBegin: '',
ctimeEnd: '',
flag: 0
},
key: '',
resultList: [],
page: 1,
rows: 10,
refreshing: false,//刷新中...
loading: false,//加载中...
finished: false,//没有更多数据
}
},
mounted() {
this._getData()
},
methods: {
//简单查询 清空高级查询条件 赋值简单查询数据
_search(value) {
this.key = value
this.formObj = this.$resetFields(this.formObj)
this.formObj.flag = 0
this._refresh()
},
//高级搜索 清空key 查询
_highSearch() {
this.key = ''
this._refresh()
},
_clearHigh() {
this.formObj = this.$resetFields(this.formObj)
this.formObj.flag = 0
},
_searchParams() {
let data = {
page: this.page,
rows: this.rows,
...this.formObj
};
if (this.key) {
data.name = this.key
}
return this.$serializeForm(data)
},
_getData: async function () {
let result = await samplingPlan.page(this._searchParams())
this.resultList = [...(this.page === 1 ? [] : this.resultList), ...result.records]
this.refreshing = false
this.loading = false
if (this.resultList.length === result.total) {
this.finished = true
}
},
_refresh() {
this.page = 1;
this._getData()
},
_load() {
this.page = this.page + 1;
this._getData()
},
_goto(item) {
if (item.progress === '审批通过') {
this.$router.push({path: '/sampling_task/sampling_task_detail', query: {planId: item.id}})
} else {
this.$router.push('/sampling_task/sampling_location')
}
},
_finish(id) {
//todo
this._finishOk(id)
},
_finishOk: async function (id) {
let result = await samplingPlan.finish(id)
if (result) {
this.$toast('操作成功!');
this._refresh()
}
},
_receive: async function (id) {
let result = await samplingPlan.receive(id)
if (result) {
this.$toast('操作成功!');
this._refresh()
}
},
}
}
</script>
<style scoped>
</style>
<template>
<div>
<van-cell-group>
<van-field label="计划名称" :value="obj.name" readonly></van-field>
<van-field label="计划日期" :value="obj.planDate?$dateformat(obj.planDate,'yyyy-mm-dd'):''"
readonly></van-field>
<van-field label="任务下达单位" :value="obj.issuingUnit" readonly></van-field>
<van-field label="任务来源" :value="obj.taskSource" readonly></van-field>
<van-field label="产品" :value="obj.product" readonly></van-field>
<van-field label="抽查依据标准" :value="obj.standard" readonly></van-field>
<van-field label="完成时间" :value="obj.finishDate?$dateformat(obj.finishDate,'yyyy-mm-dd'):''"
readonly></van-field>
<van-field label="抽样数量" :value="obj.samplingQuantity" readonly></van-field>
<van-field label="检测费用" :value="obj.testCost" readonly></van-field>
<van-field label="公告号" :value="obj.announcementNo" readonly></van-field>
<van-field label="公告日期" :value="obj.announcementDate?$dateformat(obj.announcementDate,'yyyy-mm-dd'):''"
readonly></van-field>
<van-field label="备注" :value="obj.remark" readonly></van-field>
</van-cell-group>
</div>
</template>
<script>
import {samplingPlan} from '../../api'
export default {
name: "SamplingTaskDetail",
data() {
return {
obj: {}
}
},
mounted() {
this._getDetail()
},
methods: {
_getDetail: async function () {
let result = await samplingPlan.getById(this.$route.query.planId)
if (result) {
this.obj = result
}
}
}
}
</script>
<style scoped>
</style>
import SamplingList from '@/page/history-sampling/SamplingList.vue'
export default [
{path: 'sampling_list', component: SamplingList, meta: {title: '历史抽样单'}}
]
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
import global from '@/api/config'
Vue.use(VueRouter)
const router = new VueRouter({
routes // (缩写) 相当于 routes: routes
})
router.beforeEach((to, _from, next) => {
if(to.path === '/login'){
next()
}else{
if(global.getToken()){
next()
}else{
next({path: '/login'})
}
}
})
router.afterEach(() => {
// console.log(to, from)
// LoadingBar.finish();
})
export default router
import Mine from '@/page/mine/Mine.vue'
import FeedBack from '@/page/mine/FeedBack.vue'
import UserInfo from '@/page/mine/UserInfo.vue'
import PwdEdit from '@/page/mine/psd/PwdEdit.vue'
export default [
{
path: "mine",
name: "mine",
component: Mine,
meta: {title: "个人中心", leftArrow: false},
},
{
path: "feed_back",
name: "feedBack",
component: FeedBack,
meta: {title: "意见反馈"},
},
{
path: "user_info",
name: "userInfo",
component: UserInfo,
meta: {title: "个人信息"},
},
{
path: "pwd_edit",
name: "pwdEdit",
component: PwdEdit,
meta: {title: "修改密码"},
},
]
import Index from '@/page/Index'
import Home from '@/page/Home'
import Login from '@/page/Login'
import ForgetPwd from '@/page/ForgetPwd'
import SamplingTaskRoutes from './sampling-task-routes'
import SamplingListRoutes from './sampling-list-routes'
import HistorySamplingRoutes from './history-sampling-routes'
import MineRoutes from './mine-routes'
import DebugComponent from '@/components/DebugComponent.vue'
export default [
{
path: '/', component: Index, redirect: '/home', children: [
{
path: "/home",
name: "home",
component: Home,
meta: {title: "双随机抽样", leftArrow: false},
},
{
path: "/login",
name: "login",
component: Login,
meta: {title: "登录", hideNavBar: true},
}, {
path: "/forget_pwd",
name: "forgetPwd",
component: ForgetPwd,
meta: {title: "找回密码", hideNavBar: true},
},{
path: "/debug",
name: "debug",
component: DebugComponent,
meta: {title: "调试组件页面", hideNavBar: true},
},
],
}, {
path: '/mine',
component: Index,
children: MineRoutes,
mata: {title: '个人中心'}
},
{
path: '/sampling_task',
component: Index,
children: SamplingTaskRoutes,
mata: {title: '抽样任务'}
}, {
path: '/sampling_list',
component: Index,
children: SamplingListRoutes,
mata: {title: '抽样单管理'}
}, {
path: '/history_sampling',
component: Index,
children: HistorySamplingRoutes,
mata: {title: '历史抽样单'}
}
]
import SamplingTask from '@/page/sampling-list/SamplingTask.vue'
import SamplingList from '@/page/sampling-list/SamplingList.vue'
import SamplingListAddNet from '@/page/sampling-list/SamplingListAddNet.vue'
import SamplingListAdd from '@/page/sampling-list/SamplingListAdd.vue'
import SamplingListDetail from '@/page/sampling-list/SamplingListDetail.vue'
import SamplingListDetailNet from '@/page/sampling-list/SamplingListDetailNet.vue'
export default [
{path: 'sampling_task', component: SamplingTask, meta: {title: '抽样任务'}},
{path: 'sampling_list', component: SamplingList, meta: {title: '抽样单', hideNavBar: true}},
{path: 'sampling_list_add', component: SamplingListAdd, meta: {title: '抽样单添加-非网络'}},
{path: 'sampling_list_add_net', component: SamplingListAddNet, meta: {title: '抽样单添加-网络'}},
{path: 'sampling_list_detail', component: SamplingListDetail, meta: {title: '抽样单详情-非网络'}},
{path: 'sampling_list_detail_net', component: SamplingListDetailNet, meta: {title: '抽样单详情-网络'}},
]
import SamplingTask from '@/page/sampling-task/SamplingTask.vue'
import SamplingTaskDetail from '@/page/sampling-task/SamplingTaskDetail.vue'
import SamplingLocation from '@/page/sampling-task/SamplingLocation.vue'
import GoodsShelves from '@/page/sampling-task/GoodsShelves.vue'
export default [
{path: 'sampling_task', component: SamplingTask, meta: {title: '抽样任务'}},
{path: 'sampling_task_detail', component: SamplingTaskDetail, meta: {title: '抽样任务详情'}},
{path: 'sampling_location', component: SamplingLocation, meta: {title: '抽样地点'}},
{path: 'goods_shelves', component: GoodsShelves, meta: {title: '货架'}}
]
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
count: 0
},
mutations: {
increment (state) {
state.count++
}
}
})
export default store
@background-color-gray: #f7f8fa;
@background-color-white: #ffffff;
@background-color-blue: #1989fa;
@background-color-cs: bisque;
@border-color: #eeeeee;
@border-color-black: #000000;
@text-color-blue: #1989fa;
@text-color-black: #323233;
@text-color-white: #ffffff;
* {
box-sizing: border-box;
}
p, h1, h2, h3, h4, h5, h6 {
margin: 0;
padding: 0;
}
html, body, #app, .main-content-con {
width: 100%;
height: 100%;
overflow: hidden;
color: @text-color-black;
}
.main-layout-cont {
width: 100%;
height: calc(100% - 46px);
overflow: hidden;
background: @background-color-gray;
> div {
width: 100%;
height: 100%;
}
}
.main-layout-cont-hide-navbar {
width: 100%;
height: 100%;
}
.layout-cont {
width: 100%;
height: calc(100% - 50px);
}
//有底部按钮
.layout-cont-btn {
width: 100%;
height: calc(100% - 44px);
}
//有search 54
.layout-cont-s {
width: 100%;
height: calc(100% - 54px);
overflow: auto;
}
//有search 54 底部按钮 44
.layout-cont-s-btn {
width: 100%;
height: calc(100% - 54px - 44px);
overflow: auto;
}
//有search 54、高级搜索 31
.layout-cont-sh {
width: 100%;
height: calc(100% - 54px - 31px);
margin-top: 85px;
overflow: auto;
}
//有search 54、高级搜索31 还有底部按钮 44
.layout-cont-sh-btn {
height: calc(100% - 54px - 31px - 44px);
}
.home-cont {
padding: 10px 0;
}
.bottom-btn {
width: 100%;
height: 44px;
}
.bottom-btn-two {
> button {
width: 50%
}
}
.personal-cont {
.personal-top-img {
width: 100%;
height: 150px;
background: url("../assets/banner.png") no-repeat;
background-size: 100% 100%;
margin-bottom: 10px;
text-align: center;
img {
width: 65px;
height: 65px;
border-radius: 50%;
margin-top: 60px;
}
}
}
.login-cont {
background: url("../assets/background.png") no-repeat;
background-size: 100% 100%;
.login-main {
width: 80%;
height: 280px;
position: fixed;
top: 50%;
left: 50%;
margin-top: -180px; //居中是height/2=140px
margin-left: -40%;
> h1 {
text-align: center;
letter-spacing: 5px;
margin-bottom: 20px;
color: @text-color-white;
}
.field-input {
background: #ffffff;
border-radius: 5px;
padding: 0 5px;
.van-cell {
padding-left: 5px;
padding-right: 5px;
}
}
.field-input + .field-input {
margin-top: 20px;
}
.forget-text {
padding: 10px 0;
text-align: right;
font-size: 12px;
color: @text-color-white;
display: flex;
justify-content: space-around;
> div {
width: 50%;
}
}
.btn-box {
margin: 10px 0;
}
.van-checkbox__icon {
background: @background-color-white;
}
.van-checkbox__label {
color: @text-color-white;
}
}
.login-main-forget {
height: 420px;
margin-top: -240px;
.logo-text {
text-align: center;
margin-bottom: 20px;
}
}
}
.result-item {
width: 100%;
height: auto;
background: @background-color-white;
margin-top: 10px;
padding: 10px;
border-top: 1px solid @border-color;
border-bottom: 1px solid @border-color;
font-size: 12px;
}
.swipe-cell-btn {
height: 100%;
}
.popup-cont-btn {
width: 100%;
height: calc(100% - 44px);
}
.popup-shelves {
> div {
width: 100%;
padding: 10px;
&:first-child {
p {
margin-bottom: 10px;
}
}
&:last-child {
width: 100%;
height: calc(100% - 90px);
}
}
}
/*search-bar begin */
.search-bar-box {
position: fixed;
width: 100%;
top: 45px;
z-index: 1;
}
.high-search-text {
border-top: 1px solid @border-color;
border-bottom: 1px solid @border-color;
text-align: center;
color: @text-color-blue;
background: @background-color-white;
line-height: 30px;
}
.high-search-cont {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 1;
background: @background-color-gray;
.btn-box {
margin: 10px 20px;
}
}
/*search-bar end*/
.van-nav-bar {
background: @background-color-blue;
.van-icon-arrow-left::before, .van-nav-bar__title, .van-nav-bar__text {
color: @text-color-white;
}
}
// Color Palette
@black: #000;
@white: #fff;
@gray-1: #f7f8fa;
@gray-2: #f2f3f5;
@gray-3: #ebedf0;
@gray-4: #dcdee0;
@gray-5: #c8c9cc;
@gray-6: #969799;
@gray-7: #646566;
@gray-8: #323233;
@red: #ee0a24;
@blue: #1989fa;
@orange: #ff976a;
@orange-dark: #ed6a0c;
@orange-light: #fffbe8;
@green: #07c160;
// Gradient Colors
@gradient-red: linear-gradient(to right, #ff6034, #ee0a24);
@gradient-orange: linear-gradient(to right, #ffd01e, #ff8917);
// Component Colors
@text-color: @gray-8;
@active-color: @gray-2;
@active-opacity: 0.7;
@disabled-opacity: 0.5;
@background-color: @gray-1;
@background-color-light: #fafafa;
@text-link-color: #576b95;
// Padding
@padding-base: 4px;
@padding-xs: @padding-base * 2;
@padding-sm: @padding-base * 3;
@padding-md: @padding-base * 4;
@padding-lg: @padding-base * 6;
@padding-xl: @padding-base * 8;
// Font
@font-size-xs: 10px;
@font-size-sm: 12px;
@font-size-md: 14px;
@font-size-lg: 16px;
@font-weight-bold: 500;
@line-height-xs: 14px;
@line-height-sm: 18px;
@line-height-md: 20px;
@line-height-lg: 22px;
@base-font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB',
'Microsoft Yahei', sans-serif;
@price-integer-font-family: Avenir-Heavy, PingFang SC, Helvetica Neue, Arial,
sans-serif;
// Animation
@animation-duration-base: 0.3s;
@animation-duration-fast: 0.2s;
@animation-timing-function-enter: ease-out;
@animation-timing-function-leave: ease-in;
// Border
@border-color: @gray-3;
@border-width-base: 1px;
@border-radius-sm: 2px;
@border-radius-md: 4px;
@border-radius-lg: 8px;
@border-radius-max: 999px;
// ActionSheet
@action-sheet-max-height: 80%;
@action-sheet-header-height: 48px;
@action-sheet-header-font-size: @font-size-lg;
@action-sheet-description-color: @gray-6;
@action-sheet-description-font-size: @font-size-md;
@action-sheet-description-line-height: @line-height-md;
@action-sheet-item-background: @white;
@action-sheet-item-font-size: @font-size-lg;
@action-sheet-item-line-height: @line-height-lg;
@action-sheet-item-text-color: @text-color;
@action-sheet-item-disabled-text-color: @gray-5;
@action-sheet-subname-color: @gray-6;
@action-sheet-subname-font-size: @font-size-sm;
@action-sheet-subname-line-height: @line-height-sm;
@action-sheet-close-icon-size: 22px;
@action-sheet-close-icon-color: @gray-5;
@action-sheet-close-icon-active-color: @gray-6;
@action-sheet-close-icon-padding: 0 @padding-md;
@action-sheet-cancel-text-color: @gray-7;
@action-sheet-cancel-padding-top: @padding-xs;
@action-sheet-cancel-padding-color: @background-color;
@action-sheet-loading-icon-size: 22px;
// AddressEdit
@address-edit-padding: @padding-sm;
@address-edit-buttons-padding: @padding-xl @padding-base;
@address-edit-button-margin-bottom: @padding-sm;
@address-edit-detail-finish-color: @blue;
@address-edit-detail-finish-font-size: @font-size-sm;
// AddressList
@address-list-padding: @padding-sm @padding-sm 80px;
@address-list-disabled-text-color: @gray-6;
@address-list-disabled-text-padding: @padding-base * 5 0 @padding-md;
@address-list-disabled-text-font-size: @font-size-md;
@address-list-disabled-text-line-height: @line-height-md;
@address-list-add-button-z-index: 999;
@address-list-item-padding: @padding-sm;
@address-list-item-text-color: @text-color;
@address-list-item-disabled-text-color: @gray-5;
@address-list-item-font-size: 13px;
@address-list-item-line-height: @line-height-sm;
@address-list-item-radio-icon-color: @red;
@address-list-edit-icon-size: 20px;
// Button
@button-mini-height: 24px;
@button-mini-font-size: @font-size-xs;
@button-small-height: 32px;
@button-small-font-size: @font-size-sm;
@button-normal-font-size: @font-size-md;
@button-large-height: 50px;
@button-default-height: 44px;
@button-default-line-height: 1.2;
@button-default-font-size: @font-size-lg;
@button-default-color: @text-color;
@button-default-background-color: @white;
@button-default-border-color: @border-color;
@button-primary-color: @white;
@button-primary-background-color: @green;
@button-primary-border-color: @green;
@button-info-color: @white;
@button-info-background-color: @blue;
@button-info-border-color: @blue;
@button-danger-color: @white;
@button-danger-background-color: @red;
@button-danger-border-color: @red;
@button-warning-color: @white;
@button-warning-background-color: @orange;
@button-warning-border-color: @orange;
@button-border-width: @border-width-base;
@button-border-radius: @border-radius-sm;
@button-round-border-radius: @border-radius-max;
@button-plain-background-color: @white;
@button-disabled-opacity: @disabled-opacity;
// Calendar
@calendar-background-color: @white;
@calendar-popup-height: 80%;
@calendar-header-box-shadow: 0 2px 10px rgba(125, 126, 128, 0.16);
@calendar-header-title-height: 44px;
@calendar-header-title-font-size: @font-size-lg;
@calendar-header-subtitle-font-size: @font-size-md;
@calendar-weekdays-height: 30px;
@calendar-weekdays-font-size: @font-size-sm;
@calendar-month-title-font-size: @font-size-md;
@calendar-month-mark-color: fade(@gray-2, 80%);
@calendar-month-mark-font-size: 160px;
@calendar-day-height: 64px;
@calendar-day-font-size: @font-size-lg;
@calendar-range-edge-color: @white;
@calendar-range-edge-background-color: @red;
@calendar-range-middle-color: @red;
@calendar-range-middle-background-opacity: 0.1;
@calendar-selected-day-size: 54px;
@calendar-selected-day-color: @white;
@calendar-info-font-size: @font-size-xs;
@calendar-info-line-height: @line-height-xs;
@calendar-selected-day-background-color: @red;
@calendar-day-disabled-color: @gray-5;
@calendar-confirm-button-height: 36px;
@calendar-confirm-button-margin: 7px 0;
// Card
@card-padding: @padding-xs @padding-md;
@card-font-size: @font-size-sm;
@card-text-color: @text-color;
@card-background-color: @background-color-light;
@card-thumb-size: 88px;
@card-thumb-border-radius: @border-radius-lg;
@card-title-line-height: 16px;
@card-desc-color: @gray-7;
@card-desc-line-height: @line-height-md;
@card-price-color: @gray-8;
@card-origin-price-color: @gray-6;
@card-num-color: @gray-6;
@card-origin-price-font-size: @font-size-xs;
@card-price-font-size: @font-size-sm;
@card-price-integer-font-size: @font-size-lg;
@card-price-font-family: @price-integer-font-family;
// Cell
@cell-font-size: @font-size-md;
@cell-line-height: 24px;
@cell-vertical-padding: 10px;
@cell-horizontal-padding: @padding-md;
@cell-text-color: @text-color;
@cell-background-color: @white;
@cell-border-color: @border-color;
@cell-active-color: @active-color;
@cell-required-color: @red;
@cell-label-color: @gray-6;
@cell-label-font-size: @font-size-sm;
@cell-label-line-height: @line-height-sm;
@cell-label-margin-top: @padding-base;
@cell-value-color: @gray-6;
@cell-icon-size: 16px;
@cell-right-icon-color: @gray-6;
@cell-large-vertical-padding: @padding-sm;
@cell-large-title-font-size: @font-size-lg;
@cell-large-label-font-size: @font-size-md;
// CellGroup
@cell-group-background-color: @white;
@cell-group-title-color: @gray-6;
@cell-group-title-padding: @padding-md @padding-md @padding-xs;
@cell-group-title-font-size: @font-size-md;
@cell-group-title-line-height: 16px;
// Checkbox
@checkbox-size: 20px;
@checkbox-border-color: @gray-5;
@checkbox-transition-duration: @animation-duration-fast;
@checkbox-label-margin: @padding-xs;
@checkbox-label-color: @text-color;
@checkbox-checked-icon-color: @blue;
@checkbox-disabled-icon-color: @gray-5;
@checkbox-disabled-label-color: @gray-5;
@checkbox-disabled-background-color: @border-color;
// Circle
@circle-text-color: @text-color;
@circle-text-font-weight: @font-weight-bold;
@circle-text-font-size: @font-size-md;
@circle-text-line-height: @line-height-md;
// Collapse
@collapse-item-transition-duration: @animation-duration-base;
@collapse-item-content-padding: @padding-sm @padding-md;
@collapse-item-content-font-size: @font-size-md;
@collapse-item-content-line-height: 1.5;
@collapse-item-content-text-color: @gray-6;
@collapse-item-content-background-color: @white;
@collapse-item-title-disabled-color: @gray-5;
// ContactCard
@contact-card-padding: @padding-md;
@contact-card-add-icon-size: 40px;
@contact-card-add-icon-color: @blue;
@contact-card-value-line-height: @line-height-md;
// ContactEdit
@contact-edit-padding: @padding-md;
@contact-edit-fields-radius: @border-radius-md;
@contact-edit-buttons-padding: @padding-xl 0;
@contact-edit-button-margin-bottom: @padding-sm;
@contact-edit-button-font-size: 16px;
@contact-edit-field-label-width: 4.1em;
// ContactList
@contact-list-edit-icon-size: 16px;
@contact-list-add-button-z-index: 999;
@contact-list-item-padding: @padding-md;
// CountDown
@count-down-text-color: @text-color;
@count-down-font-size: @font-size-md;
@count-down-line-height: @line-height-md;
// Coupon
@coupon-margin: 0 @padding-sm @padding-sm;
@coupon-content-height: 84px;
@coupon-content-padding: 14px 0;
@coupon-background-color: @white;
@coupon-active-background-color: @active-color;
@coupon-border-radius: @border-radius-lg;
@coupon-box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
@coupon-head-width: 96px;
@coupon-amount-color: @red;
@coupon-amount-font-size: 30px;
@coupon-currency-font-size: 40%;
@coupon-name-font-size: @font-size-md;
@coupon-disabled-text-color: @gray-6;
@coupon-description-padding: @padding-xs @padding-md;
@coupon-description-border-color: @border-color;
// CouponCell
@coupon-cell-selected-text-color: @text-color;
// CouponList
@coupon-list-background-color: @background-color;
@coupon-list-field-padding: 5px 0 5px @padding-md;
@coupon-list-exchange-button-height: 32px;
@coupon-list-close-button-height: 40px;
@coupon-list-empty-image-size: 200px;
@coupon-list-empty-tip-color: @gray-6;
@coupon-list-empty-tip-font-size: @font-size-md;
@coupon-list-empty-tip-line-height: @line-height-md;
// Dialog
@dialog-width: 320px;
@dialog-small-screen-width: 90%;
@dialog-font-size: @font-size-lg;
@dialog-transition: @animation-duration-base;
@dialog-border-radius: 16px;
@dialog-background-color: @white;
@dialog-header-font-weight: @font-weight-bold;
@dialog-header-line-height: 24px;
@dialog-header-padding-top: 26px;
@dialog-header-isolated-padding: @padding-lg 0;
@dialog-message-padding: @padding-lg;
@dialog-message-font-size: @font-size-md;
@dialog-message-line-height: @line-height-md;
@dialog-message-max-height: 60vh;
@dialog-has-title-message-text-color: @gray-7;
@dialog-has-title-message-padding-top: @padding-xs;
@dialog-button-height: 48px;
@dialog-round-button-height: 36px;
@dialog-confirm-button-text-color: @red;
// Divider
@divider-margin: @padding-md 0;
@divider-text-color: @gray-6;
@divider-font-size: @font-size-md;
@divider-line-height: 24px;
@divider-border-color: @border-color;
@divider-content-padding: @padding-md;
@divider-content-left-width: 10%;
@divider-content-right-width: 10%;
// DropdownMenu
@dropdown-menu-height: 48px;
@dropdown-menu-background-color: @white;
@dropdown-menu-box-shadow: 0 2px 12px fade(@gray-7, 12);
@dropdown-menu-title-font-size: 15px;
@dropdown-menu-title-text-color: @text-color;
@dropdown-menu-title-active-text-color: @red;
@dropdown-menu-title-disabled-text-color: @gray-6;
@dropdown-menu-title-padding: 0 @padding-xs;
@dropdown-menu-title-line-height: @line-height-lg;
@dropdown-menu-option-active-color: @red;
@dropdown-menu-content-max-height: 80%;
@dropdown-item-z-index: 10;
// Empty
@empty-padding: @padding-xl 0;
@empty-image-size: 160px;
@empty-description-margin-top: @padding-md;
@empty-description-padding: 0 60px;
@empty-description-color: @gray-6;
@empty-description-font-size: @font-size-md;
@empty-description-line-height: @line-height-md;
@empty-bottom-margin-top: 24px;
// Field
@field-label-width: 6.2em;
@field-label-color: @gray-7;
@field-label-margin-right: @padding-sm;
@field-input-text-color: @text-color;
@field-input-error-text-color: @red;
@field-input-disabled-text-color: @gray-5;
@field-placeholder-text-color: @gray-5;
@field-icon-size: 16px;
@field-clear-icon-size: 16px;
@field-clear-icon-color: @gray-5;
@field-right-icon-color: @gray-6;
@field-error-message-color: @red;
@field-error-message-text-color: 12px;
@field-text-area-min-height: 60px;
@field-word-limit-color: @gray-7;
@field-word-limit-font-size: @font-size-sm;
@field-word-limit-line-height: 16px;
@field-disabled-text-color: @gray-5;
// GridItem
@grid-item-content-padding: @padding-md @padding-xs;
@grid-item-content-background-color: @white;
@grid-item-content-active-color: @active-color;
@grid-item-icon-size: 28px;
@grid-item-text-color: @gray-7;
@grid-item-text-font-size: @font-size-sm;
// GoodsAction
@goods-action-background-color: @white;
@goods-action-height: 50px;
@goods-action-icon-width: 48px;
@goods-action-icon-height: 100%;
@goods-action-icon-color: @text-color;
@goods-action-icon-size: 18px;
@goods-action-icon-font-size: @font-size-xs;
@goods-action-icon-active-color: @active-color;
@goods-action-icon-text-color: @gray-7;
@goods-action-button-height: 40px;
@goods-action-button-warning-color: @gradient-orange;
@goods-action-button-danger-color: @gradient-red;
// IndexAnchor
@index-anchor-z-index: 1;
@index-anchor-padding: 0 @padding-md;
@index-anchor-text-color: @text-color;
@index-anchor-font-weight: @font-weight-bold;
@index-anchor-font-size: @font-size-md;
@index-anchor-line-height: 32px;
@index-anchor-background-color: transparent;
@index-anchor-sticky-text-color: @green;
@index-anchor-sticky-background-color: @white;
// IndexBar
@index-bar-sidebar-z-index: 2;
@index-bar-index-font-size: @font-size-xs;
@index-bar-index-line-height: @line-height-xs;
@index-bar-index-active-color: @green;
// Info
@info-size: 16px;
@info-color: @white;
@info-padding: 0 3px;
@info-font-size: @font-size-sm;
@info-font-weight: @font-weight-bold;
@info-border-width: @border-width-base;
@info-background-color: @red;
@info-dot-color: @red;
@info-dot-size: 8px;
@info-font-family: -apple-system-font, Helvetica Neue, Arial, sans-serif;
// Image
@image-placeholder-text-color: @gray-6;
@image-placeholder-font-size: @font-size-md;
@image-placeholder-background-color: @background-color;
@image-loading-icon-size: 32px;
@image-loading-icon-color: @gray-4;
@image-error-icon-size: 32px;
@image-error-icon-color: @gray-4;
// ImagePreview
@image-preview-index-text-color: @white;
@image-preview-index-font-size: @font-size-md;
@image-preview-index-line-height: @line-height-md;
@image-preview-index-text-shadow: 0 1px 1px @gray-8;
@image-preview-overlay-background-color: rgba(0, 0, 0, 0.9);
@image-preview-close-icon-size: 22px;
@image-preview-close-icon-color: @gray-5;
@image-preview-close-icon-active-color: @gray-6;
@image-preview-close-icon-margin: @padding-md;
@image-preview-close-icon-z-index: 1;
// List
@list-icon-margin-right: 5px;
@list-text-color: @gray-6;
@list-text-font-size: @font-size-md;
@list-text-line-height: 50px;
// Loading
@loading-text-color: @gray-6;
@loading-text-font-size: @font-size-md;
@loading-spinner-color: @gray-5;
@loading-spinner-size: 30px;
@loading-spinner-animation-duration: 0.8s;
// NavBar
@nav-bar-height: 46px;
@nav-bar-background-color: @white;
@nav-bar-arrow-size: 16px;
@nav-bar-icon-color: @blue;
@nav-bar-text-color: @blue;
@nav-bar-title-font-size: @font-size-lg;
@nav-bar-title-text-color: @text-color;
@nav-bar-z-index: 1;
// NoticeBar
@notice-bar-height: 40px;
@notice-bar-padding: 0 @padding-md;
@notice-bar-wrapable-padding: @padding-xs @padding-md;
@notice-bar-text-color: @orange-dark;
@notice-bar-font-size: @font-size-md;
@notice-bar-line-height: 24px;
@notice-bar-background-color: @orange-light;
@notice-bar-icon-size: 16px;
@notice-bar-icon-min-width: 24px;
// Notify
@notify-text-color: @white;
@notify-padding: @padding-xs @padding-md;
@notify-font-size: @font-size-md;
@notify-line-height: @line-height-md;
@notify-primary-background-color: @blue;
@notify-success-background-color: @green;
@notify-danger-background-color: @red;
@notify-warning-background-color: @orange;
// NumberKeyboard
@number-keyboard-background-color: @gray-2;
@number-keyboard-key-height: 48px;
@number-keyboard-key-font-size: 28px;
@number-keyboard-key-active-color: @gray-3;
@number-keyboard-delete-font-size: @font-size-lg;
@number-keyboard-title-color: @gray-7;
@number-keyboard-title-height: 34px;
@number-keyboard-title-font-size: @font-size-lg;
@number-keyboard-close-padding: 0 @padding-md;
@number-keyboard-close-color: @text-link-color;
@number-keyboard-close-font-size: @font-size-md;
@number-keyboard-button-text-color: @white;
@number-keyboard-button-background-color: @blue;
@number-keyboard-cursor-color: @text-color;
@number-keyboard-cursor-width: 1px;
@number-keyboard-cursor-height: 40%;
@number-keyboard-cursor-animation-duration: 1s;
@number-keyboard-z-index: 100;
// Overlay
@overlay-z-index: 1;
@overlay-background-color: rgba(0, 0, 0, 0.7);
// Pagination
@pagination-height: 40px;
@pagination-font-size: @font-size-md;
@pagination-item-width: 36px;
@pagination-item-default-color: @blue;
@pagination-item-disabled-color: @gray-7;
@pagination-item-disabled-background-color: @background-color;
@pagination-background-color: @white;
@pagination-desc-color: @gray-7;
@pagination-disabled-opacity: @disabled-opacity;
// Panel
@panel-background-color: @white;
@panel-header-value-color: @red;
@panel-footer-padding: @padding-xs @padding-md;
// PasswordInput
@password-input-height: 50px;
@password-input-margin: 0 @padding-md;
@password-input-font-size: 20px;
@password-input-border-radius: 6px;
@password-input-background-color: @white;
@password-input-info-color: @gray-6;
@password-input-info-font-size: @font-size-md;
@password-input-error-info-color: @red;
@password-input-dot-size: 10px;
@password-input-dot-color: @black;
// Picker
@picker-background-color: @white;
@picker-toolbar-height: 44px;
@picker-title-font-size: @font-size-lg;
@picker-title-line-height: @line-height-md;
@picker-action-padding: 0 @padding-md;
@picker-action-font-size: @font-size-md;
@picker-confirm-action-color: @text-link-color;
@picker-cancel-action-color: @gray-6;
@picker-option-font-size: @font-size-lg;
@picker-option-text-color: @black;
@picker-option-disabled-opacity: 0.3;
@picker-loading-icon-color: @blue;
@picker-loading-mask-color: rgba(255, 255, 255, 0.9);
// Popup
@popup-background-color: @white;
@popup-transition: transform @animation-duration-base;
@popup-round-border-radius: 20px;
@popup-close-icon-size: 22px;
@popup-close-icon-color: @gray-5;
@popup-close-icon-active-color: @gray-6;
@popup-close-icon-margin: 16px;
@popup-close-icon-z-index: 1;
// Progress
@progress-height: 4px;
@progress-color: @blue;
@progress-background-color: @gray-3;
@progress-pivot-padding: 0 5px;
@progress-pivot-text-color: @white;
@progress-pivot-font-size: @font-size-xs;
@progress-pivot-line-height: 1.6;
@progress-pivot-background-color: @blue;
// PullRefresh
@pull-refresh-head-height: 50px;
@pull-refresh-head-font-size: @font-size-md;
@pull-refresh-head-text-color: @gray-6;
// Radio
@radio-size: 20px;
@radio-border-color: @gray-5;
@radio-transition-duration: @animation-duration-fast;
@radio-label-margin: @padding-xs;
@radio-label-color: @text-color;
@radio-checked-icon-color: @blue;
@radio-disabled-icon-color: @gray-5;
@radio-disabled-label-color: @gray-5;
@radio-disabled-background-color: @border-color;
// Rate
@rate-icon-size: 20px;
@rate-icon-gutter: @padding-base;
@rate-icon-void-color: @gray-5;
@rate-icon-full-color: @red;
@rate-icon-disabled-color: @gray-5;
// ShareSheet
@share-sheet-header-padding: @padding-sm @padding-md @padding-base;
@share-sheet-title-color: @text-color;
@share-sheet-title-font-size: @font-size-md;
@share-sheet-title-line-height: @line-height-md;
@share-sheet-description-color: @gray-6;
@share-sheet-description-font-size: @font-size-sm;
@share-sheet-description-line-height: 16px;
@share-sheet-icon-size: 48px;
@share-sheet-option-name-color: @gray-7;
@share-sheet-option-name-font-size: @font-size-sm;
@share-sheet-option-description-color: @gray-5;
@share-sheet-option-description-font-size: @font-size-sm;
@share-sheet-cancel-button-font-size: @font-size-lg;
@share-sheet-cancel-button-height: 48px;
@share-sheet-cancel-button-background: @white;
// Search
@search-padding: 10px @padding-sm;
@search-background-color: @white;
@search-content-background-color: @gray-1;
@search-input-height: 34px;
@search-label-padding: 0 5px;
@search-label-color: @text-color;
@search-label-font-size: @font-size-md;
@search-left-icon-color: @gray-6;
@search-action-padding: 0 @padding-xs;
@search-action-text-color: @text-color;
@search-action-font-size: @font-size-md;
// Sidebar
@sidebar-width: 80px;
@sidebar-font-size: @font-size-md;
@sidebar-line-height: @line-height-md;
@sidebar-text-color: @text-color;
@sidebar-disabled-text-color: @gray-5;
@sidebar-padding: 20px @padding-sm;
@sidebar-active-color: @active-color;
@sidebar-background-color: @background-color;
@sidebar-selected-font-weight: @font-weight-bold;
@sidebar-selected-text-color: @text-color;
@sidebar-selected-border-width: 4px;
@sidebar-selected-border-height: 16px;
@sidebar-selected-border-color: @red;
@sidebar-selected-background-color: @white;
// Skeleton
@skeleton-row-height: 16px;
@skeleton-row-background-color: @active-color;
@skeleton-row-margin-top: @padding-sm;
@skeleton-avatar-background-color: @active-color;
@skeleton-animation-duration: 1.2s;
// Slider
@slider-active-background-color: @blue;
@slider-inactive-background-color: @gray-3;
@slider-disabled-opacity: @disabled-opacity;
@slider-bar-height: 2px;
@slider-button-width: 24px;
@slider-button-height: 24px;
@slider-button-border-radius: 50%;
@slider-button-background-color: @white;
@slider-button-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
// Step
@step-text-color: @gray-6;
@step-active-color: @green;
@step-process-text-color: @text-color;
@step-font-size: @font-size-md;
@step-line-color: @border-color;
@step-finish-line-color: @green;
@step-finish-text-color: @text-color;
@step-icon-size: 12px;
@step-circle-size: 5px;
@step-circle-color: @gray-6;
@step-horizontal-title-font-size: @font-size-sm;
// Steps
@steps-background-color: @white;
// Sticky
@sticky-z-index: 99;
// Stepper
@stepper-active-color: #e8e8e8;
@stepper-background-color: @active-color;
@stepper-button-icon-color: @text-color;
@stepper-button-disabled-color: @background-color;
@stepper-button-disabled-icon-color: @gray-5;
@stepper-button-round-theme-color: @red;
@stepper-input-width: 32px;
@stepper-input-height: 28px;
@stepper-input-font-size: @font-size-md;
@stepper-input-line-height: normal;
@stepper-input-text-color: @text-color;
@stepper-input-disabled-text-color: @gray-5;
@stepper-input-disabled-background-color: @active-color;
@stepper-border-radius: @border-radius-md;
// SubmitBar
@submit-bar-height: 50px;
@submit-bar-z-index: 100;
@submit-bar-background-color: @white;
@submit-bar-button-width: 110px;
@submit-bar-price-color: @red;
@submit-bar-price-font-size: @font-size-md;
@submit-bar-currency-font-size: @font-size-md;
@submit-bar-text-color: @text-color;
@submit-bar-text-font-size: @font-size-md;
@submit-bar-tip-padding: @padding-xs @padding-sm;
@submit-bar-tip-font-size: @font-size-sm;
@submit-bar-tip-line-height: 1.5;
@submit-bar-tip-color: #f56723;
@submit-bar-tip-background-color: #fff7cc;
@submit-bar-tip-icon-size: 12px;
@submit-bar-button-height: 40px;
@submit-bar-padding: 0 @padding-md;
@submit-bar-price-integer-font-size: 20px;
@submit-bar-price-font-family: @price-integer-font-family;
// Swipe
@swipe-indicator-size: 6px;
@swipe-indicator-margin: @padding-sm;
@swipe-indicator-active-opacity: 1;
@swipe-indicator-inactive-opacity: 0.3;
@swipe-indicator-active-background-color: @blue;
@swipe-indicator-inactive-background-color: @border-color;
// Switch
@switch-size: 30px;
@switch-width: 2em;
@switch-height: 1em;
@switch-node-size: 1em;
@switch-node-z-index: 1;
@switch-node-background-color: @white;
@switch-node-box-shadow: 0 3px 1px 0 rgba(0, 0, 0, 0.05),
0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 3px 3px 0 rgba(0, 0, 0, 0.05);
@switch-background-color: @white;
@switch-on-background-color: @blue;
@switch-transition-duration: @animation-duration-base;
@switch-disabled-opacity: @disabled-opacity;
@switch-border: @border-width-base solid rgba(0, 0, 0, 0.1);
// SwitchCell
@switch-cell-padding-top: @cell-vertical-padding - 1px;
@switch-cell-padding-bottom: @cell-vertical-padding - 1px;
@switch-cell-large-padding-top: @cell-large-vertical-padding - 1px;
@switch-cell-large-padding-bottom: @cell-large-vertical-padding - 1px;
// Tabbar
@tabbar-height: 50px;
@tabbar-z-index: 1;
@tabbar-background-color: @white;
// TabbarItem
@tabbar-item-font-size: @font-size-sm;
@tabbar-item-text-color: @gray-7;
@tabbar-item-active-color: @blue;
@tabbar-item-active-background-color: @tabbar-background-color;
@tabbar-item-line-height: 1;
@tabbar-item-icon-size: 22px;
@tabbar-item-margin-bottom: 4px;
// Tab
@tab-text-color: @gray-7;
@tab-active-text-color: @text-color;
@tab-disabled-text-color: @gray-5;
@tab-font-size: @font-size-md;
@tab-line-height: @line-height-md;
// Tabs
@tabs-default-color: @red;
@tabs-line-height: 44px;
@tabs-card-height: 30px;
@tabs-nav-background-color: @white;
@tabs-bottom-bar-width: 40px;
@tabs-bottom-bar-height: 3px;
@tabs-bottom-bar-color: @tabs-default-color;
// Tag
@tag-padding: 0 @padding-base;
@tag-text-color: @white;
@tag-font-size: @font-size-sm;
@tag-border-radius: 2px;
@tag-line-height: 16px;
@tag-medium-padding: 2px 6px;
@tag-large-padding: @padding-base @padding-xs;
@tag-large-border-radius: @border-radius-md;
@tag-large-font-size: @font-size-md;
@tag-round-border-radius: @border-radius-max;
@tag-danger-color: @red;
@tag-primary-color: @blue;
@tag-success-color: @green;
@tag-warning-color: @orange;
@tag-default-color: @gray-6;
@tag-plain-background-color: @white;
// Toast
@toast-max-width: 70%;
@toast-font-size: @font-size-md;
@toast-text-color: @white;
@toast-loading-icon-color: @white;
@toast-line-height: @line-height-md;
@toast-border-radius: @border-radius-lg;
@toast-background-color: fade(@black, 70%);
@toast-icon-size: 36px;
@toast-text-min-width: 96px;
@toast-text-padding: @padding-xs @padding-sm;
@toast-default-padding: @padding-md;
@toast-default-width: 88px;
@toast-default-min-height: 88px;
@toast-position-top-distance: 20%;
@toast-position-bottom-distance: 20%;
// TreeSelect
@tree-select-font-size: @font-size-md;
@tree-select-nav-background-color: @background-color;
@tree-select-content-background-color: @white;
@tree-select-nav-item-padding: 14px @padding-sm;
@tree-select-item-height: 48px;
@tree-select-item-active-color: @red;
@tree-select-item-disabled-color: @gray-5;
@tree-select-item-selected-size: 16px;
// Uploader
@uploader-size: 80px;
@uploader-icon-size: 24px;
@uploader-icon-color: @gray-4;
@uploader-text-color: @gray-6;
@uploader-text-font-size: @font-size-sm;
@uploader-upload-background-color: @gray-1;
@uploader-upload-active-color: @active-color;
@uploader-delete-color: @white;
@uploader-delete-icon-size: 14px;
@uploader-delete-background-color: rgba(0, 0, 0, 0.7);
@uploader-file-background-color: @background-color;
@uploader-file-icon-size: 20px;
@uploader-file-icon-color: @gray-7;
@uploader-file-name-padding: 0 @padding-base;
@uploader-file-name-margin-top: @padding-xs;
@uploader-file-name-font-size: @font-size-sm;
@uploader-file-name-text-color: @gray-7;
@uploader-mask-background-color: fade(@gray-8, 88%);
@uploader-mask-icon-size: 22px;
@uploader-mask-message-font-size: @font-size-sm;
@uploader-mask-message-line-height: @line-height-xs;
@uploader-loading-icon-size: 22px;
@uploader-loading-icon-color: @white;
@uploader-disabled-opacity: @disabled-opacity;
// Sku
@sku-item-background-color: @background-color;
@sku-icon-gray-color: @gray-4;
@sku-upload-mask-color: rgba(50, 50, 51, 0.8);
@border-color-black: #000000;
/*抽样单添加 begin*/
.list-table-box {
width: 100%;
padding: 10px;
background: #fff;
height: calc(100% - 44px);
overflow: auto;
.table {
width: 100%;
height: auto;
border: 1px solid @border-color-black;
text-align: center;
}
}
.list-table-box {
.row-cus {
display: flex;
width: 100%;
> div {
flex: 1;
}
}
.row-cus + .row-cus {
border-top: 1px solid @border-color-black;
}
}
.list-table-box {
.column-cus {
display: flex;
color: #646566;
font-size: 14px;
.van-cell {
padding: 0;
.cus-field-class {
border-right: 1px solid #000;
display: flex;
align-items: center;
justify-content: center;
}
.van-field__value .van-field__body {
height: 100%;
}
.van-cell__title, .van-cell__value {
padding: 10px;
}
}
}
.column-cus + .column-cus {
border-left: 1px solid @border-color-black;
}
}
.list-table-box {
.van-checkbox {
padding: 5px;
}
}
.flex-column-1-width-none {
> div:first-child {
width: 100px;
padding: 10px;
flex: none;
align-self: center;
}
.column-cus{
width: 50%;
}
}
.display-flex-none{
display: block !important;
}
/*抽样单添加 end*/
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: "./",
devServer: {
host: '0.0.0.0',
port: 8080,
open: false,
},
configureWebpack: {
externals: {
'BAmp': 'BMap'
}
},
css: {
loaderOptions: {
less: {
// 若使用 less-loader@5,请移除 lessOptions 这一级,直接配置选项。
lessOptions: {
modifyVars: {
// 直接覆盖变量 优先级最高
// 'text-color': '#00a0e9',
// 'border-color': '#00ff00',
// 'nav-bar-background-color': '#00a0e9',
// 'nav-bar-icon-color': '#ffffff',
// 'nav-bar-text-color': ' #ffffff',
// 或者可以通过 less 文件覆盖(文件路径为绝对路径)
// hack: `true; @import "${resolve('./src/styles/resetVar.less')}";`,
},
},
},
},
},
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment