Commit a42d8c8a by wangweidong

Merge remote-tracking branch 'origin/dev' into dev

parents c03fe201 ba7b80fc
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
...@@ -34,5 +34,9 @@ export default { ...@@ -34,5 +34,9 @@ export default {
expItemSave: data => http.post('soil/v1/exp_item/', data).then(res => res), expItemSave: data => http.post('soil/v1/exp_item/', data).then(res => res),
expItemEdit: data => expItemEdit: data =>
http.put('soil/v1/exp_item/' + data.id, data.obj).then(res => res), http.put('soil/v1/exp_item/' + data.id, data.obj).then(res => res),
expItemGetById: data => http.get('soil/v1/exp_item/' + data).then(res => res) expItemGetById: data => http.get('soil/v1/exp_item/' + data).then(res => res),
getStandardList: data =>
http.post('soil/v1/standard/list', data).then(res => res),
getGroupList: data =>
http.post('/res/v1/user_group/list', data).then(res => res)
} }
...@@ -81,5 +81,8 @@ export default { ...@@ -81,5 +81,8 @@ export default {
.post('soil/v1/sample/prepare_ok', JSON.stringify(data)) .post('soil/v1/sample/prepare_ok', JSON.stringify(data))
.then(res => res), .then(res => res),
// 试验室按样品分页列表 // 试验室按样品分页列表
pageTake: data => http.post('soil/v1/sample/page_take', data).then(res => res) pageTake: data =>
http.post('soil/v1/sample/page_take', data).then(res => res),
testType: data =>
http.post('res/v1/dict/dict_query?type=' + data).then(res => res)
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</Spin> </Spin>
</div> </div>
<div> <div>
<Button v-if="hideDownloadBtn===undefined" size="large" @click="_download">下载模板</Button> <Button v-if="hideDownloadBtn===undefined" @click="_download" size="large">下载模板</Button>
</div> </div>
<div slot="footer" class="btn-width"> <div slot="footer" class="btn-width">
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
}, },
errorMessage: '', errorMessage: '',
successMessage: '', successMessage: '',
format: ['xlsx', 'xls'], format: ['xlsx', 'xls', 'doc', 'docx'],
importUrl: '', importUrl: '',
downloadUrl: '', downloadUrl: '',
// 500的提示语 // 500的提示语
...@@ -130,7 +130,9 @@ export default { ...@@ -130,7 +130,9 @@ export default {
title: '文件格式不正确', title: '文件格式不正确',
duration: 10, duration: 10,
desc: desc:
'文件 ' + file.name + ' 格式不正确,请上传格式为 .xlsx、xls 的文件!' '文件 ' +
file.name +
' 格式不正确,请上传格式为 .xlsx、xls、doc、docx 的文件!'
}) })
this.isLoad = false this.isLoad = false
} }
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
"precommit": "npm run lint" "precommit": "npm run lint"
}, },
"dependencies": { "dependencies": {
"@fullcalendar/core": "^4.4.2",
"@fullcalendar/daygrid": "^4.4.2",
"@fullcalendar/interaction": "^4.4.2",
"@fullcalendar/vue": "^4.4.2",
"@nuxtjs/axios": "^5.3.6", "@nuxtjs/axios": "^5.3.6",
"@nuxtjs/dotenv": "^1.3.0", "@nuxtjs/dotenv": "^1.3.0",
"@nuxtjs/pwa": "^2.6.0", "@nuxtjs/pwa": "^2.6.0",
...@@ -67,6 +71,7 @@ ...@@ -67,6 +71,7 @@
"eslint-plugin-vue": "^5.2.2", "eslint-plugin-vue": "^5.2.2",
"less": "~3.9.0", "less": "~3.9.0",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"vue-style-loader": "3.1.2",
"nodemon": "^1.18.9", "nodemon": "^1.18.9",
"prettier": "1.14.3", "prettier": "1.14.3",
"uglifyjs-webpack-plugin": "^1.3.0" "uglifyjs-webpack-plugin": "^1.3.0"
......
...@@ -8,11 +8,31 @@ ...@@ -8,11 +8,31 @@
<Form-item label="试验名称" prop="name" class="width-48"> <Form-item label="试验名称" prop="name" class="width-48">
<Input v-model="formObj.name" name="name" placeholder="请输入试验名称"/> <Input v-model="formObj.name" name="name" placeholder="请输入试验名称"/>
</Form-item> </Form-item>
<Form-item label="检测科室" prop="groupName" class="width-48"> <!-- <Form-item label="检测科室" prop="groupName" class="width-48">-->
<Input v-model="formObj.groupName" name="groupName" placeholder="请输入试验名称"/> <!-- <Input v-model="formObj.groupName" name="groupName" placeholder="请输入试验名称"/>-->
<!-- </Form-item>-->
<Form-item label="检测科室:" prop="groupName" class="width-48">
<el-select @change="_selGroup" v-model="formObj.groupName" placeholder="请选择" name="groupName" style="width: 100%">
<el-option
v-for="(item,index) in groupoptions"
:key="index"
:label="item.name"
:value="item.id"
/>
</el-select>
</Form-item> </Form-item>
<Form-item label="检测依据" prop="testBasis" class="width-48"> <!-- <Form-item label="检测依据" prop="testBasis" class="width-48">-->
<Input v-model="formObj.testBasis" name="testBasis" placeholder="请输入试验名称"/> <!-- <Input v-model="formObj.testBasis" name="testBasis" placeholder="请输入试验名称"/>-->
<!-- </Form-item>-->
<Form-item label="检测依据:" prop="testBasis" class="width-48">
<el-select v-model="formObj.testBasis" placeholder="请选择" name="testBasis" style="width: 100%">
<el-option
v-for="(item,index) in options"
:key="index"
:label="item.name"
:value="item.id"
/>
</el-select>
</Form-item> </Form-item>
<Form-item label="英文名称" prop="elName" class="width-48"> <Form-item label="英文名称" prop="elName" class="width-48">
<Input v-model="formObj.elName" name="elName" <Input v-model="formObj.elName" name="elName"
...@@ -65,11 +85,14 @@ export default { ...@@ -65,11 +85,14 @@ export default {
smallType: '', smallType: '',
testMethod: '', testMethod: '',
groupName: '', groupName: '',
groupId: '',
testBasis: '' testBasis: ''
}, },
ruleValidate: { ruleValidate: {
name: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }] name: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }]
}, },
options: [],
groupoptions: [],
showModal: false, showModal: false,
footerList: [ footerList: [
{ name: '取消', type: '' }, { name: '取消', type: '' },
...@@ -120,6 +143,14 @@ export default { ...@@ -120,6 +143,14 @@ export default {
} }
}) })
}, },
groupSelect(data) {
console.log(data)
// this.formObj.groupId = da
},
_selGroup(data) {
console.log(data)
this.formObj.groupId = data
},
_testBasisChange(msg, data) { _testBasisChange(msg, data) {
switch (msg) { switch (msg) {
case 'select': case 'select':
...@@ -168,6 +199,8 @@ export default { ...@@ -168,6 +199,8 @@ export default {
_open(formObj) { _open(formObj) {
this.formId = 'index-edit-form' this.formId = 'index-edit-form'
this._hideLoading() this._hideLoading()
this._getStandardList()
this._getGroupList()
this.$refs.formObj.resetFields() this.$refs.formObj.resetFields()
if (this.$string(formObj).isEmpty()) { if (this.$string(formObj).isEmpty()) {
this.id = '' this.id = ''
...@@ -180,6 +213,19 @@ export default { ...@@ -180,6 +213,19 @@ export default {
} }
this.showModal = true this.showModal = true
}, },
// 获取检测依据
_getStandardList: async function() {
const result = await soilAptitude.getStandardList()
if (result) {
this.options = result
}
},
_getGroupList: async function() {
const result = await soilAptitude.getGroupList()
if (result) {
this.groupoptions = result
}
},
// 获取检测项目 // 获取检测项目
_getItemList(value) { _getItemList(value) {
const data = {} const data = {}
...@@ -325,6 +371,7 @@ export default { ...@@ -325,6 +371,7 @@ export default {
this.$refs.formObj.validate(valid => { this.$refs.formObj.validate(valid => {
if (valid) { if (valid) {
const data = this.$serialize('index-edit-form') const data = this.$serialize('index-edit-form')
data.groupId = this.formObj.groupId
if (this.$string(this.id).isEmpty()) { if (this.$string(this.id).isEmpty()) {
// 添加 // 添加
this._save(data) this._save(data)
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<Input v-model="formObj.longitude" name="longitude" placeholder="请输入经度"/> <Input v-model="formObj.longitude" name="longitude" placeholder="请输入经度"/>
</Form-item> </Form-item>
<Form-item label="水深(米)" prop="waterDepth" class="width-48"> <Form-item label="水深(米)" prop="waterDepth" class="width-48">
<Input v-model="formObj.waterDepth" name="waterDepth" placeholder="请输入名称"/> <Input v-model="formObj.waterDepth" name="waterDepth" placeholder="请输入深度"/>
</Form-item> </Form-item>
<Form-item label="制单日期:" prop="tabulateDate" class="width-48"> <Form-item label="制单日期:" prop="tabulateDate" class="width-48">
<Date-picker v-model="formObj.tabulateDate" @on-change="_tabulateChange" name="tabulateDate" type="date" split-panels style="width:100%;" <Date-picker v-model="formObj.tabulateDate" @on-change="_tabulateChange" name="tabulateDate" type="date" split-panels style="width:100%;"
...@@ -35,8 +35,18 @@ ...@@ -35,8 +35,18 @@
<Form-item label="制表人" prop="tabulater" class="width-48"> <Form-item label="制表人" prop="tabulater" class="width-48">
<Input v-model="formObj.tabulater" name="tabulater" placeholder="请输入名称"/> <Input v-model="formObj.tabulater" name="tabulater" placeholder="请输入名称"/>
</Form-item> </Form-item>
<Form-item label="检验类别" prop="testType" class="width-48"> <!-- <Form-item label="检验类别" prop="testType" class="width-48">-->
<Input v-model="formObj.testType" name="testType" placeholder="请输入名称"/> <!-- <Input v-model="formObj.testType" name="testType" placeholder="请输入名称"/>-->
<!-- </Form-item>-->
<Form-item label="检验类别:" prop="testType" class="width-48">
<el-select v-model="formObj.testType" placeholder="请选择" name="testType" style="width: 100%">
<el-option
v-for="(item,index) in typeoptions"
:key="index"
:label="item.name"
:value="item.key"
/>
</el-select>
</Form-item> </Form-item>
</Form> </Form>
</div> </div>
...@@ -130,6 +140,13 @@ export default { ...@@ -130,6 +140,13 @@ export default {
callback() callback()
} }
} }
const validwaterdepth = (rule, value, callback) => {
if (this.formObj.waterDepth === '') {
callback(new Error('水深不能为空'))
} else {
callback()
}
}
const validateRemark = (rule, value, callback) => { const validateRemark = (rule, value, callback) => {
if (this.testedCityData.length === 0) { if (this.testedCityData.length === 0) {
callback(new Error('内容不能为空')) callback(new Error('内容不能为空'))
...@@ -214,6 +231,7 @@ export default { ...@@ -214,6 +231,7 @@ export default {
name: '外观检查' name: '外观检查'
} }
], ],
typeoptions: [],
id: '', id: '',
modalTitle: '', modalTitle: '',
subcontractorId: '', subcontractorId: '',
...@@ -230,6 +248,28 @@ export default { ...@@ -230,6 +248,28 @@ export default {
trigger: ['blur', 'change'] trigger: ['blur', 'change']
} }
], ],
boreholeName: [
{
required: true,
message: '钻孔名称不能为空',
trigger: 'blur'
}
],
boreholeLocation: [
{
required: true,
message: '钻孔位置不能为空',
trigger: 'blur'
}
],
waterDepth: [
{
required: true,
validator: validwaterdepth,
message: '水深不能为空',
trigger: 'blur'
}
],
entrustDate: [ entrustDate: [
{ {
required: true, required: true,
...@@ -692,6 +732,7 @@ export default { ...@@ -692,6 +732,7 @@ export default {
}, },
_open(formObj) { _open(formObj) {
this._getList() this._getList()
this._getTestType()
this.showBtn = true this.showBtn = true
this.showModal = true this.showModal = true
this.$refs.formObj.resetFields() this.$refs.formObj.resetFields()
...@@ -709,7 +750,9 @@ export default { ...@@ -709,7 +750,9 @@ export default {
} }
}, },
_openEdit(formObj) { _openEdit(formObj) {
console.log(formObj)
this._getList() this._getList()
this._getTestType()
this.showBtn = false this.showBtn = false
this.showModal = true this.showModal = true
this.$refs.formObj.resetFields() this.$refs.formObj.resetFields()
...@@ -731,6 +774,14 @@ export default { ...@@ -731,6 +774,14 @@ export default {
// } // }
// } // }
}, },
_getTestType: async function() {
const result = await soilEntrust.testType('检验类别')
console.log(result)
if (result) {
console.log(result)
this.typeoptions = result
}
},
_showTime(formObj) { _showTime(formObj) {
if (this.formObj.entrustDate === undefined) { if (this.formObj.entrustDate === undefined) {
this.formObj.entrustDate = '' this.formObj.entrustDate = ''
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</div> </div>
</div> </div>
<div class="chartBox clearfix"> <div class="chartBox clearfix">
<div class="barChartBox" style="width: 700px;height: 240px;margin-top: 20px;border: 1px solid lightgray;float: left"> <div class="barChartBox" style="width: 700px;height: 240px;margin-top: 20px;border: 1px solid lightgray;float: left;margin-right: 10px;">
<div class="barChartTitle" style="height: 32px;background-color: #f8f8f9;line-height: 32px;border-bottom: 1px solid lightgray"> <div class="barChartTitle" style="height: 32px;background-color: #f8f8f9;line-height: 32px;border-bottom: 1px solid lightgray">
<span style="font-size: 14px;color: #333333;font-weight: bold;">年度委托量统计</span> <span style="font-size: 14px;color: #333333;font-weight: bold;">年度委托量统计</span>
</div> </div>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<div id="barChart" style="width: 100%;height: 180px;" /> <div id="barChart" style="width: 100%;height: 180px;" />
</div> </div>
</div> </div>
<div class="pieChartBox" style="width: 350px;height: 240px;margin-top: 20px;border: 1px solid lightgray;float: left"> <div class="pieChartBox" style="width: 330px;height: 240px;margin-top: 20px;border: 1px solid lightgray;float: left">
<div class="pieChartTitle" style="height: 32px;background-color: #f8f8f9;line-height: 32px;border-bottom: 1px solid lightgray"> <div class="pieChartTitle" style="height: 32px;background-color: #f8f8f9;line-height: 32px;border-bottom: 1px solid lightgray">
<span style="font-size: 14px;color: #333333;font-weight: bold;">年度委托量统计</span> <span style="font-size: 14px;color: #333333;font-weight: bold;">年度委托量统计</span>
</div> </div>
......
<template>
<div>
<Card style="width:100%">
<div class="config_meta">
<p class="fl">审批待办</p>
<div class="fr">
<Tooltip content="刷新" placement="left-start">
<Icon @click="_request" type="ios-refresh" size="30" color="#2d8cf0" style="cursor:pointer;"></Icon>
</Tooltip>
<Tooltip content="查看更多" placement="left-start" style="margin-left: 5px">
<Icon @click="_detail" type="ios-more" size="30" color="#2d8cf0" style="cursor:pointer;"></Icon>
</Tooltip>
</div>
<div class="clear"></div>
</div>
<div style="width: 100%;">
<element-table ref="pageTable" :pageColumns="pageColumns" :table-height="tableHeight"
@on-result-change="_tableResultChange" :hide-page="true" :getPage="tableData" opt-col-width="100">
<el-table-column
:prop="item.key"
:label="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key"
show-overflow-tooltip sortable>
<template slot-scope="scope">
<span v-if="item.dateTime">{{$dateformat(scope.row['flowInfo'].applyTime,'yyyy-mm-dd HH:MM')}}</span>
<span v-else-if="item.flowName" class="blue-color">{{scope.row['flowInfo'].flowName}}</span>
<span v-else-if="item.remark">{{scope.row['flowInfo'].remark}}</span>
<span v-else-if="item.applyName">{{scope.row['flowInfo'].applyName}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</el-table-column>
</element-table>
</div>
</Card>
<!-- &lt;!&ndash; 流程图 &ndash;&gt;-->
<!-- <FlowDiagram ref="flowDiagramModal"/>-->
<!-- &lt;!&ndash; 详情 &ndash;&gt;-->
<!-- <FlowDetail ref="flowDetailModal"/>-->
</div>
</template>
<script>
/**
* 待办任务
*/
export default {
components: {
// FlowDiagram: () => import('../../workflow/FlowDiagram'),
// FlowDetail: () => import('../../workflow/FlowDetail')
},
data() {
return {
tableData: { records: [] },
pageColumns: [
{ title: '流程名称', key: 'display', width: 170, flowName: true },
{ title: '申请原因', key: 'remark', remark: true },
{ title: '申请人', key: 'userName', width: 130, applyName: true },
{ title: '申请时间', key: 'applyTime', width: 140, dateTime: true }
]
}
},
mounted() {
// this._request()
},
computed: {
tableHeight() {
return this.$tableHeight('tableModal')
}
},
methods: {
_request() {
// 食品报告借阅审批、食品样品处理申请审批(目前)两种审批加起来最多展示7条数据
this.tableData.records = []
this.$store
.dispatch(
'FlowProcess/pageTask',
this._searchParam('食品报告借阅评审', 7)
)
.then(() => {
// 没有数据可能会返回undefined的情况
const records = this.$store.state.FlowProcess.page.records
const taskByReport = records || []
const taskByReportLen = taskByReport ? taskByReport.length : 0
let taskBySample = []
// 首先查询【食品报告借阅评审】
if (taskByReportLen < 7) {
// ①数量小于7,则继续查询【食品样品处理申请审批】
const rows = Number(7 - taskByReportLen) // 还需要查询多少条数据
this.$store
.dispatch(
'FlowProcess/pageTask',
this._searchParam('食品样品处理申请审批', rows)
)
.then(() => {
// eslint-disable-next-line camelcase
const records_sample = this.$store.state.FlowProcess.page
.records
// eslint-disable-next-line camelcase
taskBySample = records_sample || []
// 数组合并
this.tableData.records = taskByReport.concat(taskBySample)
})
} else {
// ②数量等于7,则不用再查询了
this.tableData.records = taskByReport
}
})
},
// 查询条件
_searchParam(name, rows) {
const data = {
page: 1,
rows: rows
}
if (name) {
data.name = name
}
return data
},
_detail() {
this.$emit('on-result-change', 'FoodMyTask')
},
_claimTask(taskId) {
this.$Modal.confirm({
title: '提示',
content: '确定要认领该任务?',
onOk: () => {
this.$store.dispatch('FlowProcess/claimTask', taskId).then(() => {
if (this.$store.state.FlowProcess.success) {
this.$Message.success('认领成功!')
this._request()
} else {
this.$Message.error('该任务已被其他人员认领!')
}
})
}
})
},
_flowDiagramModal(taskId) {
this.$refs.flowDiagramModal._open(taskId)
},
_flowDetailModal(taskId) {
this.$refs.flowDetailModal._open(taskId)
},
_iconClick(res, data) {
switch (res) {
case '详情':
this._flowDetailModal(data.taskId)
break
case '认领':
this._claimTask(data.taskId)
break
case '流程图':
this._flowDiagramModal(data.taskId)
break
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
default:
this._request()
}
}
}
}
</script>
<template>
<div>
<Card style="width:100%">
<div class="config_meta">
<p class="fl">业务流程</p>
<div class="fr">
<Tooltip content="刷新" placement="left-start">
<Icon @click="_request" type="ios-refresh" size="30" color="#2d8cf0" style="cursor:pointer;"></Icon>
</Tooltip>
</div>
<div class="clear"></div>
</div>
<div style="width: 100%;height: 300px">
<div class="flow-box">
<div v-for="(item,index) in flowList" :key=index class="flow-item">
<div>{{item.title+' '+ item.num}}</div>
</div>
</div>
</div>
</Card>
</div>
</template>
<script>
export default {
data() {
return {
flowList: [
{
title: '试验委托登记',
num: 1
}
]
}
},
mounted() {
// this._request()
},
methods: {
_request() {
this.$store.dispatch('FoodContract/flowNum').then(() => {
this.flowList = this.$store.state.FoodContract.list
})
}
}
}
</script>
<style scoped>
.flow-box {
display: flex;
flex-wrap: wrap;
font-size: 12px;
}
.flow-item {
width: 120px;
text-align: center;
padding-left: 10px;
margin-bottom: 15px;
}
.flow-item > div {
background: #00a0e9;
position: relative;
padding: 5px 0 5px 12px;
line-height: 20px;
white-space: nowrap;
color: #ffffff;
}
.flow-item > div:before,
.flow-item > div:after {
content: ' ';
display: block;
width: 0;
height: 0;
border-style: solid;
border-width: 15px 0 15px 15px;
border-color: transparent transparent transparent #90a4ae;
position: absolute;
left: 0;
top: 0;
}
.flow-item > div:before {
border-left-color: #fff;
z-index: 1;
}
.flow-item > div:after {
border-left-color: #00a0e9;
left: auto;
right: -14px;
z-index: 2;
}
.flow-item-reverse {
width: 120px;
text-align: center;
padding-right: 5px;
margin-bottom: 10px;
justify-content: right;
}
.flow-item-reverse > div {
background: #00a0e9;
position: relative;
padding: 5px 12px 5px 0;
line-height: 20px;
white-space: nowrap;
color: #ffffff;
}
.flow-item-reverse > div:before,
.flow-item-reverse > div:after {
content: ' ';
display: block;
width: 0;
height: 0;
border-style: solid;
border-width: 15px 15px 15px 0;
border-color: transparent transparent transparent #90a4ae;
position: absolute;
right: 0;
top: 0;
}
.flow-item-reverse > div:before {
border-right-color: #fff;
z-index: 1;
}
.flow-item-reverse > div:after {
border-right-color: #00a0e9;
left: -14px;
right: auto;
z-index: 2;
}
</style>
<template>
<div>
<Card style="width:100%">
<div class="config_meta">
<p class="fl">待办任务</p>
<div class="fr">
<Tooltip content="刷新" placement="left-start">
<Icon @click="_request" type="ios-refresh" size="30" color="#2d8cf0" style="cursor:pointer;"></Icon>
</Tooltip>
</div>
<div class="clear"></div>
</div>
<div style="width: 100%;">
<element-table ref="pageTable" :pageColumns="pageColumns" :tableHeight="280"
@on-result-change="_tableResultChange" :hide-page="true" :getPage="getPage">
<el-table-column
:prop="item.key"
:label="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.key"
show-overflow-tooltip sortable>
<template slot-scope="scope">
<span v-if="item.key==='index'">{{scope.$index+1}}</span>
<a v-else-if="item.key==='title'" @click="_goto(scope.row.url)">{{scope.row[item.key]}}</a>
<span v-else-if="item.key==='num'">{{scope.row[item.key]}}</span>
<span v-else-if="item.key==='overNum'">{{scope.row[item.key]}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</el-table-column>
</element-table>
</div>
</Card>
</div>
</template>
<script>
export default {
components: {},
data() {
return {
getPage: { records: [] },
pageColumns: [
{ title: '序号', key: 'index', width: 140 },
{ title: '任务名称', key: 'title', width: 140 },
{ title: '任务数量', key: 'num', width: 140 },
{ title: '超期数量', key: 'overNum', width: 140 }
]
}
},
mounted() {
// this._request()
},
methods: {
_request() {
this.$store.dispatch('FoodContract/todoList').then(() => {
this.getPage.records = this.$store.state.FoodContract.list
})
},
_goto(url) {
this.$router.push(url)
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<Modal v-model="showModal" v-drag width="1000" class="modal-footer-none">
<p slot="header">报告任务详情</p>
<Form :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.code" @on-enter="_formSearch" placeholder="请输入委托编号" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
<element-table ref="pageTable" :table-height="400" :getPage="getPage"
@on-result-change="_tableResultChange" hide-checkbox>
<el-table-column
:prop="item.key"
:label="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.id"
show-overflow-tooltip sortable>
<template slot-scope="scope">
<span
v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</el-table-column>
</element-table>
</Modal>
</div>
</template>
<script>
export default {
data() {
return {
showModal: false,
formObj: {
code: '',
day: '',
queryPersonal: false
},
getPage: {
records: []
},
pageColumns: [
{ title: '委托单位', key: 'cusName', width: 140 },
{ title: '委托编号', key: 'code', width: 180 },
{ title: '报告数量', key: 'reportCount', width: 160 },
{ title: '应出报告日期', key: 'dueDate', width: 140 }
]
}
},
methods: {
_open(day, queryPersonal) {
this.showModal = true
this.getPage.records = []
this.formObj = this.$resetFields(this.formObj)
this.formObj.day = this.$dateformat(day, 'yyyy-mm-dd')
this.formObj.queryPersonal = queryPersonal || false
this._page()
},
_page() {
this.$refs.pageTable._page(
'',
'FoodSampleReport/reportTask',
this.$serializeFormSearch(this.formObj)
)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSampleReport.page
break
default:
this._page()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<Card style="width:100%;position: relative">
<!--左侧图例-->
<div class="legend-task-box legend-task-box-left">
<div>
<div class="legend-task" style="background-color: #257e4a"></div>
<div>检测任务</div>
</div>
<div>
<div class="legend-task" style="background-color: #f29836"></div>
<div>报告任务</div>
</div>
</div>
<!--右侧-->
<div class="legend-task-box legend-task-box-right" style="top: 5px;right: 10px;display: flex">
<Tooltip content="刷新" placement="left-start">
<Icon @click="_request" type="refresh" size="20" style="cursor:pointer;"></Icon>
</Tooltip>
<Tooltip content="放大" placement="left-start" style="margin-left: 10px">
<i @click="_fullScreen" class="pt-ivu-icon pt-enlarge"></i>
</Tooltip>
</div>
<!--自定义日历头部-->
<div class="calendar-title">
<!--<div @click="_prev">-->
<!--<Icon type="chevron-left"></Icon>-->
<!--</div>-->
<div>{{$dateformat(currentDate,'yyyy年mm月')+'待办'}}</div>
<!--<div @click="_next">-->
<!--<Icon type="chevron-right"></Icon>-->
<!--</div>-->
</div>
<!--日历-->
<div style="width: 100%;">
<FullCalendar
ref="fullCalendar"
:height="275"
:plugins="calendarPlugins"
:header="false"
:events="calendarEvents"
@dateClick="_handleDateClick"
@eventClick="_handleEventClick"
default-view="dayGridMonth"
locale="zh-cn"
event-order="order"
></FullCalendar>
</div>
</Card>
<TestTaskDetail ref="testTask"></TestTaskDetail>
<ReportTaskDetail ref="reportTask"></ReportTaskDetail>
<TaskCalendarFullScreen ref="fullScreen"></TaskCalendarFullScreen>
<!-- <component ref="refModal" :is="currentComponent"></component>-->
<!-- <TestTaskDetail></TestTaskDetail>-->
<!-- <ReportTaskDetail></ReportTaskDetail>-->
<!-- <TaskCalendarFullScreen></TaskCalendarFullScreen>-->
</div>
</template>
<script>
import FullCalendar from '@fullcalendar/vue'
import dayGridPlugin from '@fullcalendar/daygrid'
import interactionPlugin from '@fullcalendar/interaction'
import TaskCalendarFullScreen from './TaskCalendarFullScreen'
import TestTaskDetail from './TestTaskDetail'
import ReportTaskDetail from './ReportTaskDetail'
export default {
components: {
TestTaskDetail,
ReportTaskDetail,
TaskCalendarFullScreen,
FullCalendar // make the <FullCalendar> tag available
},
data() {
return {
currentComponent: '',
currentDate: new Date(),
calendarPlugins: [
// plugins must be defined in the JS
dayGridPlugin,
interactionPlugin // needed for dateClick
],
calendarHeader: {
left: '',
center: 'title',
right: ''
},
calendarEvents: []
}
},
mounted() {
// this._request()
},
methods: {
_fullScreen() {
this.$refs.fullScreen._open()
// this.currentComponent = 'TaskCalendarFullScreen'
// this.$nextTick(function() {
// this.$refs.fullScreen._open()
// })
},
_request() {
this.$store
.dispatch('FoodContract/getTaskMonth', {
searchDate: this.$dateformat(this.currentDate, 'yyyy-mm-dd')
})
.then(() => {
const result = this.$store.state.FoodContract.list
const event = []
if (result) {
for (let i = 0; i < result.length; i++) {
if (result[i].testCount) {
event.push({
title: '检测任务:' + result[i].testCount,
start: result[i].day,
color: '#257e4a'
})
}
if (result[i].reportCount) {
event.push({
title: '报告任务:' + result[i].reportCount,
start: result[i].day,
color: '#f29836'
})
}
}
}
this.calendarEvents = event
})
},
_handleDateClick(arg) {
// 点击的当前日期
console.log('date', arg)
},
_handleEventClick(arg) {
// 开始和结束时间
console.log('event', arg)
const title = arg.event.title
let total = ''
if (title.indexOf('检测') !== -1) {
this.currentComponent = 'TestTaskDetail'
total = title.split(':')[1]
} else if (title.indexOf('报告') !== -1) {
this.currentComponent = 'ReportTaskDetail'
}
this.$nextTick(function() {
if (this.currentComponent === 'TestTaskDetail') {
this.$refs.refModal._open(
this.$dateformat(arg.event.start, 'yyyy-mm-dd'),
true,
total
)
} else {
this.$refs.refModal._open(
this.$dateformat(arg.event.start, 'yyyy-mm-dd'),
true
)
}
})
}
}
}
</script>
<style lang='css' scoped>
@import "~@fullcalendar/core/main.min.css";
@import "~@fullcalendar/daygrid/main.min.css";
</style>
<template>
<div>
<Modal v-model="showModal" width="100" class="full-screen modal-header-none modal-footer-none">
<!--左侧图例-->
<div class="legend-task-box legend-task-box-left">
<div>
<div class="legend-task" style="background-color: #257e4a"></div>
<div>检测任务</div>
</div>
<div>
<div class="legend-task" style="background-color: #f29836"></div>
<div>报告任务</div>
</div>
</div>
<!--右侧-->
<div @click="showModal=false" class="legend-task-box" style="left: auto;right: 15px;">
<i class="pt-ivu-icon pt-narrow"></i>
</div>
<!--自定义日历头部-->
<div class="calendar-title">
<!--<div @click="_prev">-->
<!--<Icon type="chevron-left"></Icon>-->
<!--</div>-->
<div>{{$dateformat(currentDate,'yyyy年mm月')+'待办'}}</div>
<!--<div @click="_next">-->
<!--<Icon type="chevron-right"></Icon>-->
<!--</div>-->
</div>
<!--日历-->
<div style="margin-top: 20px">
<FullCalendar
ref="fullCalendar"
v-if="showModal"
:height="calendarHeight"
:plugins="calendarPlugins"
:header="false"
:events="calendarEvents"
@dateClick="_handleDateClick"
@eventClick="_handleEventClick"
default-view="dayGridMonth"
locale="zh-cn"
event-order="order"
></FullCalendar>
</div>
</Modal>
<TestTaskDetail ref="testTask"></TestTaskDetail>
<ReportTaskDetail ref="reportTask"></ReportTaskDetail>
<!-- <component ref="refModal" :is="currentComponent"></component>-->
</div>
</template>
<script>
import FullCalendar from '@fullcalendar/vue'
import dayGridPlugin from '@fullcalendar/daygrid'
import interactionPlugin from '@fullcalendar/interaction'
import TestTaskDetail from './TestTaskDetail'
import ReportTaskDetail from './ReportTaskDetail'
export default {
components: {
TestTaskDetail,
ReportTaskDetail,
FullCalendar // make the <FullCalendar> tag available
},
data() {
return {
currentComponent: '',
showModal: false,
currentDate: new Date(),
calendarHeight: this.$tableHeight('', 90),
calendarPlugins: [
// plugins must be defined in the JS
dayGridPlugin,
interactionPlugin // needed for dateClick
],
calendarHeader: {
left: '',
center: 'title',
right: ''
},
calendarEvents: []
}
},
methods: {
_open() {
this.showModal = true
this._request()
},
_request() {
this.$store
.dispatch('FoodContract/getTaskMonth', {
searchDate: this.$dateformat(this.currentDate, 'yyyy-mm-dd')
})
.then(() => {
const result = this.$store.state.FoodContract.list
const event = []
if (result) {
for (let i = 0; i < result.length; i++) {
if (result[i].testCount) {
event.push({
title: '检测任务:' + result[i].testCount,
start: result[i].day,
color: '#257e4a'
})
}
if (result[i].reportCount) {
event.push({
title: '报告任务:' + result[i].reportCount,
start: result[i].day,
color: '#f29836'
})
}
}
}
this.calendarEvents = event
})
},
_handleDateClick(arg) {
// 点击的当前日期
console.log('date', arg)
},
_handleEventClick(arg) {
// 开始和结束时间
console.log('event', arg)
const title = arg.event.title
let total = ''
if (title.indexOf('检测') !== -1) {
this.currentComponent = 'TestTaskDetail'
total = title.split(':')[1]
} else if (title.indexOf('报告') !== -1) {
this.currentComponent = 'ReportTaskDetail'
}
this.$nextTick(function() {
if (this.currentComponent === 'TestTaskDetail') {
this.$refs.refModal._open(
this.$dateformat(arg.event.start, 'yyyy-mm-dd'),
true,
total
)
} else {
this.$refs.refModal._open(
this.$dateformat(arg.event.start, 'yyyy-mm-dd'),
true
)
}
})
}
}
}
</script>
<style lang="css" scoped>
@import "~@fullcalendar/core/main.css";
@import "~@fullcalendar/daygrid/main.css";
.legend-task-box {
position: absolute;
left: 15px;
top: 15px;
}
.legend-task-box > div {
display: flex;
line-height: 20px;
}
.legend-task {
width: 15px;
height: 10px;
margin: 5px 5px 5px 0;
border-radius: 2px;
}
</style>
<template>
<div>
<Modal v-model="showModal" v-drag width="1000" class="modal-footer-none">
<p slot="header">检测任务详情 (检测任务:<span class="red-color">{{total}}</span>)</p>
<Form :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="检测人:">
<Input v-model="formObj.tester" @on-enter="_formSearch" placeholder="请输入检测人" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
<element-table ref="pageTable" :table-height="400" :getPage="getPage"
@on-result-change="_tableResultChange" hide-checkbox>
<el-table-column
:prop="item.key"
:label="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns"
:key="item.id"
show-overflow-tooltip sortable>
<template slot-scope="scope">
<span
v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</el-table-column>
</element-table>
</Modal>
</div>
</template>
<script>
export default {
data() {
return {
showModal: false,
formObj: {
tester: '',
day: '',
queryPersonal: false
},
getPage: {
records: []
},
pageColumns: [
{ title: '委托编号', key: 'code', width: 180 },
{ title: '项目名称', key: 'itemName', width: 160 },
{ title: '数量', key: 'itemTotal', width: 140 },
{ title: '计划完成时间', key: 'planEndDate', width: 140, date: true },
{ title: '检测人', key: 'testers', width: 140 }
],
total: ''
}
},
methods: {
_open(day, queryPersonal, total) {
this.showModal = true
this.getPage.records = []
this.total = total
this.formObj = this.$resetFields(this.formObj)
this.formObj.day = this.$dateformat(day, 'yyyy-mm-dd')
this.formObj.queryPersonal = queryPersonal || false
this._page()
},
_page() {
this.$refs.pageTable._page(
'',
'FoodItem/testTask',
this.$serializeFormSearch(this.formObj)
)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodItem.page
break
default:
this._page()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
}
}
}
</script>
<style scoped>
</style>
...@@ -14,14 +14,26 @@ ...@@ -14,14 +14,26 @@
<div class="layout-content-padding"> <div class="layout-content-padding">
<div class="layout-content-main"> <div class="layout-content-main">
<div class="config_home"> <div class="config_home">
<Row> <Row :gutter="16">
<!--title--> <!--title-->
<Col span="24"> <Col span="24">
<statisticalPanel /> <statisticalPanel />
</Col> </Col>
<Col span="24"> <Col span="12" style="margin-bottom: 10px">
<messagePanel /> <messagePanel />
</Col> </Col>
<Col span="12" style="margin-bottom: 10px">
<toDoTask />
</Col>
<Col span="12" style="margin-bottom: 10px">
<myTask />
</Col>
<Col span="12" style="margin-bottom: 10px">
<taskFlow />
</Col>
<Col span="12" style="margin-bottom: 10px">
<!-- <taskCalendar />-->
</Col>
</Row> </Row>
</div> </div>
</div> </div>
...@@ -31,9 +43,20 @@ ...@@ -31,9 +43,20 @@
<script> <script>
import statisticalPanel from './statisticalPanel' import statisticalPanel from './statisticalPanel'
import messagePanel from './messagePanel' import messagePanel from './messagePanel'
import toDoTask from './ToDoTask'
import myTask from './MyTask'
import taskFlow from './TaskFlow'
// import taskCalendar from './task-calendar/TaskCalendar'
export default { export default {
name: 'Workbench', name: 'Workbench',
components: { statisticalPanel, messagePanel } components: {
statisticalPanel,
messagePanel,
myTask,
toDoTask,
taskFlow
// taskCalendar
}
} }
</script> </script>
......
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