Commit 12001bd8 by lichengming

修改了库房样品管理

parent d41a04d5
...@@ -21,5 +21,8 @@ export default { ...@@ -21,5 +21,8 @@ export default {
// 当前用户所在部门 // 当前用户所在部门
getOrg: () => http.get('/base/v1/org/current').then(res => res), getOrg: () => http.get('/base/v1/org/current').then(res => res),
// 首页模块 // 首页模块
getModulesList: () => http.post('/base/v1/module/list_user_module_soil') getModulesList: () => http.post('/base/v1/module/list_user_module_soil'),
// 根据用户id查菜单
getMenuByUserId: data =>
http.post('/base/v1/module/list_user_1304006677087891457').then(res => res)
} }
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
<!--搜索表单--> <!--搜索表单-->
<Form id="search-form" :label-width="90" v-show="searchOpen" inline onsubmit="return false"> <Form id="search-form" :label-width="90" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="钻孔名称:"> <Form-item class="search-item" label="委托编号:">
<Input @on-enter="_formSearch" v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入钻孔名称" clearable/> <Input @on-enter="_formSearch" v-model="formObj.entrustCode" name="entrustCode" placeholder="请输入委托编号" clearable/>
</Form-item> </Form-item>
<Form-item class="search-item" label="库房号:"> <Form-item class="search-item" label="样品编号:">
<Input @on-enter="_formSearch" v-model="formObj.warehouse" name="warehouse" placeholder="请输入库房号" clearable/> <Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入样品编号" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<!--表格 --> <!--表格 -->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :tableHeight="tableHeight" <PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :iconMsg="iconMsg"> @on-result-change="_tableResultChange" :getPage="getPage">
<vxe-table-column <vxe-table-column
:field="item.key" :field="item.key"
:title="item.title" :title="item.title"
...@@ -39,7 +39,9 @@ ...@@ -39,7 +39,9 @@
<div v-if="item.key==='status'">{{scope.row[item.key]===0?'现行':scope.row[item.key]===1?'即将实施': <div v-if="item.key==='status'">{{scope.row[item.key]===0?'现行':scope.row[item.key]===1?'即将实施':
scope.row[item.key]===2?'部分被代替':scope.row[item.key]===3?'被代替':scope.row[item.key]===4?'作废':''}} scope.row[item.key]===2?'部分被代替':scope.row[item.key]===3?'被代替':scope.row[item.key]===4?'作废':''}}
</div> </div>
<div v-else-if="item.key==='progress'">
{{scope.row[item.key].display}}
</div>
<div v-else-if="item.key==='classify'"> <div v-else-if="item.key==='classify'">
{{scope.row[item.key]===0?'判定依据':scope.row[item.key]===1?'检测依据':scope.row[item.key]===2?'其他':''}} {{scope.row[item.key]===0?'判定依据':scope.row[item.key]===1?'检测依据':scope.row[item.key]===2?'其他':''}}
</div> </div>
...@@ -90,25 +92,21 @@ export default { ...@@ -90,25 +92,21 @@ export default {
return { return {
currentComponent: '', currentComponent: '',
formObj: { formObj: {
code: undefined, entrustCode: undefined,
name: undefined sampleCode: undefined
}, },
btn: [ btn: [],
{
type: 'success',
id: '',
name: '提交'
},
{ type: 'success', id: '', name: '批量填写' }
],
// 表格 // 表格
pageColumns: [ pageColumns: [
{ title: '委托商', key: 'client' },
{ title: '委托编号', key: 'entrustCode' },
{ title: '钻孔名称', key: 'boreholeName' }, { title: '钻孔名称', key: 'boreholeName' },
{ title: '项目负责人', key: 'projectLeader' }, { title: '委托日期', key: 'entrustDate', date: true },
{ title: '入库日期', key: 'instockTime', date: true }, { title: '样品编号', key: 'sampleCode' },
{ title: '留存有效期', key: 'keepLimitTime', date: true }, { title: '现场编号', key: 'siteNo' },
{ title: '库房号', key: 'storehouse' }, { title: '库房号', key: 'warehouse' },
{ title: '架位号', key: 'shelfCode' } { title: '架位号', key: 'receiveLocation' },
{ title: '进度', key: 'progress' }
], ],
// 操作 // 操作
iconMsg: [ iconMsg: [
......
<template> <template>
<div> <div>
<Form id="search-form-sample-progress" :label-width="80" inline onsubmit="return false"> <div v-for="(itemInfo, index) in info" :key="index" class="contract-box">
<Form-item label="委托编号:" class="search-item">
<Input v-model="formObj.entrustCode" @on-enter="_search" name="entrustCode" placeholder="请输入委托编号" style="width:100%" clearable></Input>
</Form-item>
<Form-item label="钻孔名称:" class="search-item">
<Input v-model="formObj.boreholeName" @on-enter="_search" name="boreholeName" placeholder="请输入钻孔名称" style="width:100%" clearable></Input>
</Form-item>
<Form-item class="search-item">
<Button @click="_search" type="primary" class="width-80">搜索</Button>
</Form-item>
</Form>
<div v-for="(itemInfo, index) in entrustList" :key="index" class="contract-box">
<Row> <Row>
<!--样品信息--> <!--样品信息-->
<Col span="6"> <Col span="6">
...@@ -45,19 +34,19 @@ ...@@ -45,19 +34,19 @@
<li> <li>
<div class="title">委托日期</div> <div class="title">委托日期</div>
<div class="cont"> <div class="cont">
{{$dateformat(itemInfo.entrustVO.entrustDate,'yyyy-mm-dd HH:MM:ss')}} {{$dateformat(itemInfo.entrustVO.entrustDate,'yyyy-mm-dd')}}
</div> </div>
</li> </li>
<li> <li>
<div class="title">项目负责人</div> <div class="title">项目负责人</div>
<div class="cont"> <div class="cont">
{{itemInfo.entrustVO.waterDepth}} {{itemInfo.entrustVO.projectLeader}}
</div> </div>
</li> </li>
<li> <li>
<div class="title">项目名称</div> <div class="title">项目名称</div>
<div class="cont"> <div class="cont">
{{itemInfo.entrustVO.waterDepth}} {{itemInfo.entrustVO.projectName}}
</div> </div>
</li> </li>
<li> <li>
...@@ -105,9 +94,6 @@ export default { ...@@ -105,9 +94,6 @@ export default {
console.log('newVal===========', newVal.oldValue) console.log('newVal===========', newVal.oldValue)
} }
}, },
mounted() {
this._getData()
},
methods: { methods: {
_search() { _search() {
this._getData() this._getData()
......
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<Row style="padding-top: 10px;border: 2px solid #EEEEEE;background-color: white;">
<Form id="search-form-sample-progress" :label-width="80" inline onsubmit="return false">
<Form-item label="委托编号:" class="search-item">
<Input v-model="formObj.entrustCode" @on-enter="_search" name="entrustCode" placeholder="请输入委托编号" style="width:100%" clearable></Input>
</Form-item>
<Form-item label="钻孔名称:" class="search-item">
<Input v-model="formObj.boreholeName" @on-enter="_search" name="boreholeName" placeholder="请输入钻孔名称" style="width:100%" clearable></Input>
</Form-item>
<Form-item class="search-item">
<Button @click="_search" type="primary" class="width-80">搜索</Button>
</Form-item>
</Form>
<Col style="height: 420px;width: 100%;" span="24">
<VScrollFull ref="myscrollfull" :page-size="rows" @load="_loadData">
<div slot="empty" style="text-align:center" class="gray-color">暂无数据</div>
<SampleSteps ref="stepsModal" :info="sampleInfo"></SampleSteps>
</VScrollFull>
</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
import VScrollFull from '../../components/base/VScrollFull'
import { soilEntrust } from '../../api'
import SampleSteps from './ItemFlow'
export default {
components: {
SampleSteps,
VScrollFull
},
data() {
return {
dateList: [],
sampleProgressList: ['已分配', '检测完成', '复核', '校核'],
// 样品信息
sampleInfo: [],
testTypeList: [],
// 合同id
contractId: '',
//
page: 0,
rows: 10,
formObj: {},
processObj: {
height: document.documentElement.clientHeight - 300 + 'px'
},
typeList: [{ name: '企业', value: 0 }, { name: '政府', value: 1 }]
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('noBtn') - 200
}
},
mounted() {
// this._initData()
},
methods: {
_reportDateChange(data) {
$('input[name="reportDateBegin"]').val(data[0])
$('input[name="reportDateEnd"]').val(data[1])
},
// 日期
_ctimeChange(data) {
$('input[name="beginDate"]').val(data[0])
$('input[name="endDate"]').val(data[1])
},
_search() {
// 超期未完成(默认的)
// 重置
this.$refs.myscrollfull.$_init()
},
_loadData: async function(pageIndex) {
console.log('pageIndex', pageIndex)
this.page = pageIndex
if (pageIndex === 1) {
this.sampleInfo = []
}
Object.assign(this.formObj, this._searchParams())
const result = await soilEntrust.listSummaryQuery(
this.$serializeForm(this.formObj)
)
if (result) {
const records = result.records
const pages = result.pages
// for (let i = 0; i < records.length; i++) {
// // 获取下标
// if (records[i].auditTime) {
// records[i].progressIndex = 3
// } else if (records[i].checkTime) {
// records[i].progressIndex = 2
// } else if (records[i].testEndTime) {
// records[i].progressIndex = 1
// } else if (records[i].allotTime) {
// records[i].progressIndex = 0
// } else {
// records[i].progressIndex = -1
// }
// }
// this.sampleInfo = records
this.sampleInfo = this.sampleInfo.concat(records)
this.$refs.myscrollfull.endByPage(this.sampleInfo.length, pages)
console.log('this.sampleInfo', this.sampleInfo)
}
// this.$store
// .dispatch('StbSampleProgress/list', this._searchParams())
// .then(() => {
// const result = this.$store.state.StbSampleProgress.list
// const records = result.records
// const pages = result.pages
// for (let i = 0; i < records.length; i++) {
// // 获取下标
// records[i].statisStatusIndex = this.sampleProgressList.indexOf(
// records[i].statisStatus
// )
// }
// this.sampleInfo = this.sampleInfo.concat(records)
// this.$refs.myscrollfull.endByPage(this.sampleInfo.length, pages)
// })
},
// 获取模块数量
_statusChange(data, list) {
const temp = []
const blueList = list.blueList
const redList = list.redList
const greenList = list.greenList
const orgList = list.orgList
for (let i = 0; i < blueList.length; i++) {
temp.push(blueList[i])
}
for (let i = 0; i < redList.length; i++) {
temp.push(redList[i])
}
for (let i = 0; i < greenList.length; i++) {
temp.push(greenList[i])
}
for (let i = 0; i < orgList.length; i++) {
temp.push(orgList[i])
}
if (temp.length !== 0) {
$('input[name=queryTypeList]').val(temp.join(','))
} else {
$('input[name=queryTypeList]').val('')
}
this._search()
},
_searchParams() {
const data = this.$serialize('search-form-sample-progress')
data.page = this.page
data.rows = this.rows
return this.$extend(data)
}
}
}
</script>
...@@ -59,11 +59,11 @@ ...@@ -59,11 +59,11 @@
<!-- <Col span="24">--> <!-- <Col span="24">-->
<!-- <ItemFlow></ItemFlow>--> <!-- <ItemFlow></ItemFlow>-->
<!-- </Col>--> <!-- </Col>-->
<div :style="{height}" v-if="moduleList.length" class="config_home"> <div v-if="moduleList.length" class="config_home">
<Row :gutter="10"> <Row :gutter="10">
<Col <Col
:sm="{span:item.alias === 'SampleProgress'||item.alias === 'SampleProgressDetail' ?24:12}" :sm="{span:item.alias === 'SampleProgress'||item.alias === 'SampleProgressDetail'||item.alias === 'ItemFlow' ?24:12}"
v-for="(item,index) in moduleList" v-for="(item,index) in finalList"
:key="index" :key="index"
style="margin-bottom: 10px"> style="margin-bottom: 10px">
<!-- eslint-disable-next-line vue/require-component-is --> <!-- eslint-disable-next-line vue/require-component-is -->
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
</template> </template>
<script> <script>
import Global from '../../api/config' import Global from '../../api/config'
import { sysOrg } from '../../api' import { sysOrg, sysUser } from '../../api'
import statisticalPanel from './statisticalPanel' import statisticalPanel from './statisticalPanel'
import messagePanel from './messagePanel' import messagePanel from './messagePanel'
import toDoTask from './ToDoTask' import toDoTask from './ToDoTask'
...@@ -94,7 +94,7 @@ import GroupItem from './GroupItem' ...@@ -94,7 +94,7 @@ import GroupItem from './GroupItem'
import CustomerContract from './CustomerContract' import CustomerContract from './CustomerContract'
import SampleProgress from './sample-progress/SampleProgress' import SampleProgress from './sample-progress/SampleProgress'
import SampleProgressDetail from './SampleProgressDetail' import SampleProgressDetail from './SampleProgressDetail'
import ItemFlow from './ItemFlow' import ItemFlow from './ItemFlowIndex'
export default { export default {
name: 'Workbench', name: 'Workbench',
components: { components: {
...@@ -137,12 +137,15 @@ export default { ...@@ -137,12 +137,15 @@ export default {
}, },
data() { data() {
return { return {
moduleList: [] moduleList: [],
userId: '',
list: [],
finalList: []
} }
}, },
mounted() { mounted() {
if (Global.getLn()) { if (Global.getLn()) {
this._open() this._getUserInfo()
} }
}, },
methods: { methods: {
...@@ -157,13 +160,45 @@ export default { ...@@ -157,13 +160,45 @@ export default {
_open() { _open() {
this._myModule() this._myModule()
}, },
_getUserInfo: async function() {
const result = await sysUser.getUserInfo()
if (result) {
this.userId = result.id
this._myModule()
}
},
_myModule: async function() { _myModule: async function() {
// this.$store.dispatch('SysModule/listUserFood').then(() => { const result = await sysOrg.getMenuByUserId(1304006677087891457)
// this.moduleList = this.$store.state.SysModule.list if (result) {
// }) console.log('菜单', result)
const list = []
for (let i = 0; i < result.length; i++) {
if (result[i].status.display === '正常') {
list.push(result[i].id)
}
}
this.list = list
console.log('启用的模块', list)
this._getModule()
}
},
_getModule: async function() {
this.finalList = []
console.log('this.userId', this.userId)
const result = await sysOrg.getModulesList() const result = await sysOrg.getModulesList()
if (result) { if (result) {
this.moduleList = result this.moduleList = result
for (let i = 0; i < this.list.length; i++) {
console.log(
this.moduleList.findIndex(item => item.id === this.list[i])
)
this.finalList.push(
this.moduleList[
this.moduleList.findIndex(item => item.id === this.list[i])
]
)
}
console.log(this.finalList)
console.log('菜单', result) console.log('菜单', result)
} }
} }
......
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