Commit e8e0daf6 by wangweidong

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

# Conflicts:
#	pages/soil-statistics/sample-progress/SampleProgressDetail.vue
parents 27607fb1 9e0cd698
......@@ -165,5 +165,9 @@ export default {
pageWaitStorageHis: data =>
http
.post('soil/v1/alone_sample/page_wait_storage_his', data)
.then(res => res),
bathChangeStorehouse: data =>
http
.post('soil/v1/alone_sample/bath_change_storehouse', data)
.then(res => res)
}
......@@ -262,5 +262,7 @@ export default {
pageStorehouseSample: data =>
http
.post('soil/v1/alone_sample/page_storehouse_sample', data)
.then(res => res)
.then(res => res),
aloneSampleDelete: data =>
http.delete('soil/v1/alone_sample/?ids=' + data).then(res => res)
}
......@@ -111,7 +111,7 @@ export default {
viewUri: '/soil/v1/standard_annex/preview/'
}
break
case 'sampleId':
case 'aloneSampleId':
// 样品
this.entrustId = id
this.urlData = {
......
......@@ -208,7 +208,7 @@ export default {
},
methods: {
_batchUpload() {
if (this.formObj.sampleId) {
if (this.formObj.aloneSampleId) {
this.$refs.batchUploadSample._open(this.id)
} else {
this.$refs.batchUpload._open(this.id)
......
......@@ -8,6 +8,9 @@
<!--搜索表单-->
<Form id="search-form" :label-width="90" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="钻孔名称:">
<Input @on-enter="_formSearch" v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入钻孔名称" clearable/>
</Form-item>
<Form-item class="search-item" label="库房号:">
<Input @on-enter="_formSearch" v-model="formObj.warehouse" name="warehouse" placeholder="请输入库房号" clearable/>
</Form-item>
......@@ -60,18 +63,25 @@
</div>
<!--组件加载-->
<ViewSample ref="viewSample"></ViewSample>
<StandardsManageEdit ref="editModal" @on-result-change="_page"></StandardsManageEdit>
<ViewDetail ref="viewDetail"></ViewDetail>
<FileManage ref="FileManage" @on-result-change="_page"></FileManage>
<BatchModal ref="batchModal" @on-result-change="_page"></BatchModal>
<stockSampleEdit ref="editModal" @on-result-change="_page"></stockSampleEdit>
</div>
</template>
<script>
import { soilSample } from '../../../api'
import StandardsManageEdit from './AddressManageEdit' // 添加、编辑
import { soilEntrust, soilSample } from '../../../api'
import ViewDetail from '../../soil-alone-sample/ViewDetail'
import ViewSample from './ViewLocationEntrust'
import stockSampleEdit from './stockSampleEdit'
import BatchModal from './BatchModal'
export default {
components: {
StandardsManageEdit,
ViewSample
stockSampleEdit,
ViewSample,
ViewDetail,
BatchModal
},
data() {
return {
......@@ -84,10 +94,9 @@ export default {
{
type: 'success',
id: '',
name: '添加',
componentName: 'StandardsManageEdit'
name: '出库'
},
{ type: 'error', id: '', name: '删除' }
{ type: 'success', id: '', name: '批量填写' }
],
// 表格
pageColumns: [
......@@ -107,9 +116,14 @@ export default {
componentName: 'StandardsManageEdit'
},
{
type: 'md-apps',
type: 'ios-list',
id: '',
name: '查看'
},
{
type: 'md-cloud',
id: '',
name: '查看试样'
name: '附件'
},
{ type: 'md-remove-circle', id: '', name: '删除' }
],
......@@ -142,6 +156,9 @@ export default {
this._editModal(false)
})
break
case '批量填写':
this._bathChange()
break
case '删除':
this._deleteSelected()
break
......@@ -159,6 +176,13 @@ export default {
break
}
},
_bathChange() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.batchModal._open(this.selectIds.join(','))
}
},
// 表格中操作
_iconClick(res, data, currentComponent) {
this.currentComponent = currentComponent
......@@ -170,28 +194,70 @@ export default {
case '查看试样':
this._viewSample(data.name)
break
case '查看':
this._viewModal(true, data.id)
break
case '附件':
this._upload(data.id)
break
case '删除':
this._deleteById(data.id)
break
}
})
},
_upload(id) {
// 上传文件
this.$refs.FileManage._open(id, 'aloneSampleId')
},
_viewModal(edit, id) {
if (edit) {
this.$refs.pageTable._showLoading()
// 编辑
this._getDetailById(id)
} else {
// 添加
this.$nextTick(() => {
this.$refs.refModal._open()
})
}
},
_getDetailById: async function(id) {
const result = await soilEntrust.aloneSampleGetById(id)
if (result) {
this.$refs.viewDetail._open(result)
this.$refs.pageTable._hideLoading()
} else {
this.$refs.pageTable._hideLoading()
}
},
_viewSample(data) {
this.$refs.viewSample._open(data)
},
_editModal: async function(edit, id) {
_editModal(edit, id) {
if (edit) {
const result = await soilSample.aloneWarehouseLocationGetById(id)
if (result) {
this.$refs.editModal._open(result)
}
this.$refs.pageTable._showLoading()
// 编辑
this._getById(id)
} else {
// 添加
this.$refs.editModal._open()
this.$nextTick(() => {
this.$refs.refModal._open()
})
}
},
_getById: async function(id) {
const result = await soilEntrust.aloneSampleGetById(id)
if (result) {
this.$refs.editModal._openEdit(result)
this.$refs.pageTable._hideLoading()
} else {
this.$refs.pageTable._hideLoading()
}
},
// 获取数据
_page: async function() {
this.selectIds = []
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilSample.pageStorehouseSample(
this.$serializeForm(this.formObj)
......@@ -231,7 +297,7 @@ export default {
})
},
_delOk: async function(ids) {
const result = await soilSample.aloneWarehouseLocationDelete(ids)
const result = await soilSample.aloneSampleDelete(ids)
if (result) {
this._page()
this.$Modal.remove()
......
<template>
<div>
<Modal v-model="showEditModal" v-drag :mask-closable="false" :width="500" class="zIndex-1200">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="库房号" prop="storehouse " style="width: 100%">
<Input v-model="formObj.storehouse " name="storehouse" placeholder="请输入库房号"></Input>
</Form-item>
<Form-item label="架位号" prop="shelfCode " style="width: 100%">
<Input v-model="formObj.shelfCode " name="shelfCode" placeholder="请输入架位号"></Input>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑
*/
import ModalFooter from '../../../components/base/modalFooter'
import { soilAptitude, soilEntrust, soilSample } from '../../../api'
export default {
components: {
ModalFooter
},
data() {
return {
formId: '',
modalTitle: '批量填写存放架位',
formObj: {
detail: ''
},
ruleValidate: {},
showEditModal: false,
ids: '',
options: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
/** *modal-footer */
selectLocation(data) {
this._getLocationById(data)
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
this.formObj.ids = this.ids
this._receive(this.formObj)
} else {
this.$Message.error('表单验证失败!')
this._hideLoading()
}
})
},
_receive: async function(data) {
const result = await soilEntrust.bathChangeStorehouse(data)
if (result) {
this._resultChange('填写成功!')
}
},
_save: async function(data) {
const result = await soilAptitude.standardSave(data)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilAptitude.standardEdit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this._hideLoading()
this.showEditModal = false
},
_open(ids) {
this.formObj.storehouse = ''
this.formObj.shelfCode = ''
this.ids = ids
this.showEditModal = true
},
_getLocation: async function() {
const result = await soilSample.locationList()
if (result) {
console.log(result)
this.options = result
console.log(this.options)
}
},
_getLocationById: async function(id) {
console.log(id)
const result = await soilSample.locationGetById(id)
if (result) {
this.formObj.receiveLocation = result.name
}
console.log(this.formObj.receiveLocation)
},
_registerAdd() {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
this.modalTitle = '添加'
this.formObj.id = ''
this.formObj.type = 3
this.showEditModal = true
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" width="900">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="MeterSendTestEdit" ref="formObj" :model="formObj" :label-width="90" inline>
<Form-item @click.native="_selectReceiverPerson" label="接收人" prop="receiver" class="width-48">
<Input v-model="formObj.receiver" name="receiver" placeholder="请输入接收人"/>
</Form-item>
<Form-item label="接收日期:" prop="receiveTime" class="width-48">
<Date-picker v-model="formObj.receiveTime" @on-change="_ctimeChange" type="date" split-panels style="width:100%;"
placeholder="请选择接收日期" name="receiveTime"></Date-picker>
</Form-item>
<Form-item label="项目名称" prop="projectName" class="width-48">
<!-- <Input v-model="formObj.projectName" name="projectName" placeholder="请输入项目名称"/>-->
<AutoComplete ref="autoInput" v-model="formObj.projectName" :down-data="projectData"
@on-result-change="_projectChange" name="projectName" placeholder="请输入或选择项目名称"
></AutoComplete>
</Form-item>
<Form-item @click.native="_selectProjectPerson" label="项目负责人" prop="projectLeader" class="width-48">
<Input v-model="formObj.projectLeader" name="projectLeader" placeholder="请输入项目负责人"/>
</Form-item>
<Form-item label="钻孔名称" prop="boreholeName" class="width-48">
<Input v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入名称"/>
</Form-item>
<Form-item label="箱数" prop="casesNum" class="width-48">
<Input v-model="formObj.casesNum" name="casesNum" placeholder="请输入箱数"/>
</Form-item>
<Form-item @click.native="_selectRegisterPerson" label="登记人" prop="registrant" class="width-48">
<Input v-model="formObj.registrant" name="registrant" placeholder="请输入登记人"/>
</Form-item>
<Form-item label="登记日期:" prop="registTime" class="width-48">
<Date-picker v-model="formObj.registTime" @on-change="_tabulateChange" name="registTime" type="date" split-panels style="width:100%;"
placeholder="请选择登记日期"></Date-picker>
</Form-item>
<!-- <Form-item label="检验类别" prop="testType" class="width-48">-->
<!-- <Input v-model="formObj.testType" name="testType" placeholder="请输入名称"/>-->
<!-- </Form-item>-->
</Form>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div>
</Modal>
<assignPerson ref="userModal" @on-result-change="_userResult"></assignPerson>
</div>
</template>
<script>
/**
* 添加编辑分包商
*/
import { meterEntrust, meterSample, soilEntrust } from '../../../api'
import AutoComplete from '../../../components/base/AutoCompletes'
import assignPerson from '../../../components/user-info-single/assignPerson'
import Global from '../../../api/config'
export default {
components: {
AutoComplete,
assignPerson
},
data() {
return {
formId: 'meterSendTestEditFormId',
getPage: {
records: []
},
showBtn: true,
customerData: [],
projectData: [],
edit: false,
cityData: [],
selectData: [],
sampleItemList: [],
searchOpen: true,
testedCityData: [],
judgeType: [{ value: 1, name: '是' }, { value: 0, name: '否' }],
iconMsg: [
{
type: 'md-trash',
id: '',
name: '删除'
}
],
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 140 },
{ title: '现场编号', key: 'siteNo', width: 140 },
{ title: '试验项目', key: 'experiments', width: 140 },
{ title: '试样深度', key: 'sampleDepth', width: 140 },
{ title: '样品包装类型', key: 'samplePack', width: 150 },
{ title: '土质描述', key: 'sampleDescribe' }
],
btn: [
{
type: 'success',
id: '',
name: '添加'
},
{
type: 'success',
id: '',
name: '导入试验项目'
}
],
btnEdit: [
{
type: 'success',
id: '',
name: '添加'
},
{
type: 'success',
id: '',
name: '导入样品'
},
{
type: 'success',
id: '',
name: '导入试验项目'
}
],
options: [
{
name: '检定'
},
{
name: '校准'
},
{
name: '外观检查'
}
],
typeoptions: [],
personType: '',
packList: [],
soilList: [],
currentIndex: -1,
id: '',
modalTitle: '',
subcontractorId: '',
formObj: {},
selectIds: [],
indexList: [],
itemList: [],
clearingWayList: ['款到后测试', '先测试后付款', '其他情况()'],
clearingWayListTemp: ['款到后测试', '先测试后付款', '其他情况()'],
showModal: false,
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
],
aptitudeData: []
}
},
methods: {
typeChange(data) {
this.$forceUpdate()
this.formObj.testType = data
},
_removeItem(itemInfo) {
console.log('试验项目', itemInfo)
this.sampleItemList = itemInfo.experimentList
if (itemInfo.sampleCode !== '') {
this.$refs.sampleItemEdit._open(this.sampleItemList)
} else {
this.$refs.sampleItemRemove._open(this.sampleItemList)
}
},
_removeItemBack(data) {
this.$forceUpdate()
if (data) {
this.getPage.records[this.currentIndex].experimentList = data
const itemNames = []
for (let j = 0; j < data.length; j++) {
itemNames.push(data[j].name)
}
this.getPage.records[this.currentIndex].experiments = itemNames.join(
','
)
}
this.$set(
this.getPage.records,
this.currentIndex,
this.getPage.records[this.currentIndex]
)
},
_itemImportBack(data) {
this.$forceUpdate()
for (let i = 0; i < data.length; i++) {
data[i].id = undefined
}
const info = data
for (let i = 0; i < this.indexList.length; i++) {
const index = this.indexList[i]
if (
this.getPage.records[index].experimentList !== undefined &&
this.getPage.records[index].experimentList !== []
) {
const name = []
this.itemList = this.getPage.records[index].experimentList
name.push(this.getPage.records[index].experiments)
for (let i = 0; i < info.length; i++) {
this.itemList.push(info[i])
name.push(info[i].name)
}
this.getPage.records[index].experiments = name.join('、')
this.getPage.records[index].experimentList = this.itemList
this.$set(this.getPage.records, index, this.getPage.records[index])
} else {
const name = []
this.itemList = []
for (let i = 0; i < info.length; i++) {
this.itemList.push(info[i])
name.push(info[i].name)
}
this.getPage.records[index].experiments = name.join('、')
this.getPage.records[index].experimentList = this.itemList
this.$set(this.getPage.records, index, this.getPage.records[index])
}
}
},
_selectProjectPerson() {
this.personType = 'project'
this.$refs.userModal._openOrg('选择人员', 'itemTree')
},
_selectReceiverPerson() {
this.personType = 'receive'
this.$refs.userModal._openOrg('选择人员', 'itemTree')
},
_selectRegisterPerson() {
this.personType = 'resistrant'
this.$refs.userModal._openOrg('选择人员', 'itemTree')
},
_userResult(data, msg) {
console.log(msg)
this.$forceUpdate()
if (this.personType === 'resistrant') {
this.formObj.registrant = data.realname
this.formObj.registrantId = data.id
} else if (this.personType === 'receive') {
this.formObj.receiver = data.realname
} else {
this.formObj.projectLeader = data.realname
this.formObj.projectLeaderId = data.id
}
},
_packChange(msg, data) {
switch (msg) {
case 'select':
this.getPage.records[this.currentIndex].samplePack = data
break
case 'query':
this.getPage.records[this.currentIndex].samplePack = data
break
}
},
_soilChange(msg, data) {
switch (msg) {
case 'select':
this.getPage.records[this.currentIndex].sampleDescribe = data
break
case 'query':
this.getPage.records[this.currentIndex].sampleDescribe = data
break
}
},
_cusNameChange(msg, data) {
if (this.$string(this.id).isEmpty()) {
// 添加的时候选择单位
switch (msg) {
case 'select':
this._customerMatch(data)
break
case 'query':
this._cusNameQuery(data)
break
}
} else if (this.customerData.indexOf(data) !== -1) {
this._getQueryList(data)
} else {
this._cusNameQuery(data)
}
},
_customerMatch(data) {
this._getQueryList(data)
},
_cusNameQuery(query) {
console.log('query', query)
this.formObj.client = query
this._getQueryList(query)
},
_projectChange(msg, data) {
if (this.$string(this.id).isEmpty()) {
// 添加的时候选择单位
switch (msg) {
case 'select':
this._projectMatch(data)
break
case 'query':
this._projectQuery(data)
break
}
} else if (this.projectData.indexOf(data) !== -1) {
this._getProjectQueryList(data)
} else {
this._projectQuery(data)
}
},
_projectMatch(data) {
this._getQueryList(data)
},
_projectQuery(query) {
this.formObj.projectName = query
this._getProjectQueryList(query)
},
_btnClick(msg) {
this.$nextTick(function() {
switch (msg) {
case '添加':
this._add()
break
case '导入试验项目':
this._importItem()
break
case '导入样品':
this._importSample()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_importItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择至少一条数据!')
} else {
this.$refs.sampleItemSelectModal._open()
this.allSelect(this.selectData)
}
},
_getByEntrustId: async function(id) {
const result = await soilEntrust.getVOById(id)
if (result) {
this.$forceUpdate()
const sampleList = Object.assign(
this.getPage.records,
result.sampleList
)
this.$set(this.getPage.records, sampleList)
}
},
_inputBack(data) {
if (data) {
this._getByEntrustId(this.id)
}
},
_ctimeChange(data) {
this.formObj.receiveTime = data
},
_tabulateChange(data) {
this.formObj.registTime = data
},
_odateChange(data) {
this.formObj.odate = data
},
_judgeBasisChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.stdId = data.id
this.formObj.code = data.stdNum
this.formObj.name = data.name
this.$refs.formObj.validateField('code')
break
case 'query':
this.formObj.stdId = ''
this.formObj.code = data.stdNum
this.formObj.name = ''
this._getJudgeBasisList(data.stdNum)
break
case 'focus':
this._getJudgeBasisList()
break
case 'blur':
if (this.formObj.stdId === '') {
this.formObj.code = ''
this._getJudgeBasisList()
}
this.$refs.formObj.validateField('code')
}
},
_selectjudgeBasis(index) {
this.index = index
this.$refs.EditModal._open()
},
_selectverification(index) {
this.index = index
this.$refs.VerificationModal._open()
},
_selectcontractCode() {
this.$refs.ContractModal._open()
},
_backData(data) {
this.$forceUpdate()
console.log(typeof this.index)
this.getPage.records[this.index].name = data.name
this.getPage.records[this.index].aptitudeId = data.id
this.getPage.records[this.index].verification = data.code + data.basis
this.getPage.records[this.index].price = data.price
this.getPage.records[this.index].totalPrice =
data.price * this.getPage.records[this.index].quantity
},
_backContract(data) {
this.formObj.client = data.client
this.formObj.operation.person = data.person
this.formObj.operation.tel = data.tel
this.formObj.operation.fax = data.fax
if (data.province) {
this.testedCityData = [data.province, data.city, data.county]
this.formObj.province = data.province
this.formObj.city = data.city
this.formObj.county = data.county
}
this.formObj.street = data.street
this.formObj.entrustDate = new Date(data.entrustDate)
this.formObj.odate = new Date(data.odate)
this.formObj.contractCode = data.salesCode
this.formObj.operation.fee = data.discountPrice
if (data.sampleQuoteList) {
this.getPage.records = data.sampleQuoteList
} else {
this.getPage.records = []
}
},
_backVerification(data) {
this.$forceUpdate()
this.getPage.records[this.index].verification = data.verification
},
_add() {
const data = {
sampleCode: '',
sampleDepth: '',
samplePack: '',
sampleDescribe: '',
siteNo: '',
experiments: ''
}
this.getPage.records.push(data)
},
_getPackList: async function() {
const result = await soilEntrust.testType('样品包装类型')
if (result) {
const pack = []
for (let i = 0; i < result.length; i++) {
pack.push(result[i].name)
}
this.packList = pack
}
},
_getSoil: async function() {
const result = await soilEntrust.testType('土质描述')
if (result) {
const soilRemark = []
for (let i = 0; i < result.length; i++) {
soilRemark.push(result[i].name)
}
this.soilList = soilRemark
}
},
_importSample() {
const data = {
importUrl: '/soil/v1/entrust/edit_import_entrust/?id=' + this.id,
downloadUrl: '/meter/v1/excel/template/MeterSampleImport',
title: '样品导入'
}
this.$refs.importModal._open(data, '样品导入')
},
_tableResultChange(msg, data, selData) {
switch (msg) {
case 'selectIds':
this.selectIds = data
this.selectData = selData
console.log(this.selectIds)
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.rowIndex)
break
}
},
allSelect(data) {
console.log(data)
this.indexList = []
for (let i = 0; i < data.length; i++) {
this.indexList.push(data[i].index)
}
console.log('索引', this.indexList)
},
// 省 市 区
_cascaderResult(name, data, msg) {
switch (name) {
case 'cus':
this._casChange(data, msg)
break
case 'tested':
this._testedChange(data, msg)
break
}
},
_emptyProvince() {
this.cityData = []
this.testedCityData = []
// this.formObj.tested.testedProvince = ''
// this.formObj.tested.testedCity = ''
// this.formObj.tested.testedCounty = ''
// this.formObj.testedTemp.testedProvince = ''
// this.formObj.testedTemp.testedCity = ''
// this.formObj.testedTemp.testedCounty = ''
},
_testedChange(data, msg) {
// 省、市、区
if (msg === 'clear') {
// this.formObj.tested.testedProvince = ''
// this.formObj.tested.testedCity = ''
// this.formObj.tested.testedCounty = ''
this.formObj.testedTemp.testedProvince = ''
this.formObj.testedTemp.testedCity = ''
this.formObj.testedTemp.testedCounty = ''
this.formObj.province = ''
this.formObj.city = ''
this.formObj.county = ''
this.testedCityData = []
} else {
// this.formObj.tested.testedProvince = data.value[0]
// this.formObj.tested.testedCity = data.value[1]
// this.formObj.tested.testedCounty = data.value[2]
this.formObj.province = data.value[0]
this.formObj.city = data.value[1]
this.formObj.county = data.value[2]
this.testedCityData = [data.value[0], data.value[1], data.value[2]]
}
},
_iconClick(res, data, index) {
switch (res) {
case '编辑':
// this._editModal(true, data.id)
break
case '删除':
this.getPage.records.splice(index, 1)
break
case '操作日志':
// this._record(data.id)
break
}
},
_deleteSample(data) {
if (data.id === undefined) {
return false
} else {
this._delete(data.id)
}
},
_delete: async function(id) {
const result = await meterSample.deleteById(id)
if (result) {
console.log(result)
}
},
_selectAptitude(data) {
console.log(data)
},
_handleRow(data) {
this.currentRow = data.row
this.currentIndex = data.rowIndex
},
channelInputLimit(e) {
const key = e.key
// 不允许输入'e'和'.'
if (key === 'e' || key === '.') {
e.returnValue = false
return false
}
return true
},
/** *modal-footer */
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.$serialize('MeterSendTestEdit')
console.log(this.getPage.records)
if (this.$string(this.id).isEmpty()) {
// 添加
if (this.formObj.projectLeaderId) {
data.projectLeaderId = this.formObj.projectLeaderId
}
if (this.formObj.registrantId) {
data.registrantId = this.formObj.registrantId
}
console.log('saveData', data)
this._save(data)
} else {
data.id = this.id
if (this.formObj.projectLeaderId) {
data.projectLeaderId = this.formObj.projectLeaderId
}
if (this.formObj.registrantId) {
data.registrantId = this.formObj.registrantId
}
this._edit(data)
}
} else {
this.$Message.error('表单验证失败!')
}
})
},
_wayResult(msg, data) {
switch (msg) {
case 'select':
this.formObj.clearingWay = data
break
case 'query':
this.formObj.clearingWay = data
this._wayQuery(data)
break
}
},
_wayQuery(query) {
if (query === '') {
this.clearingWayList = this.clearingWayListTemp
} else {
this.clearingWayList = this.clearingWayListTemp.filter(
item => item.indexOf(query) > -1
)
}
},
_cancel() {
this.showModal = false
},
_open(formObj) {
this.$refs.autoInput._clear()
this.edit = false
this._getProjectList()
this.showBtn = true
this.showModal = true
this._hideLoading()
if (this.$string(formObj).isEmpty()) {
this.$refs.formObj.resetFields()
this.getPage.records = []
this.formObj.client = ''
this.id = ''
this.formObj.entrustDate = new Date()
this.modalTitle = '委托单新增'
}
this._getUser()
},
_openEdit(formObj) {
this.edit = true
console.log(formObj)
this._getProjectList()
this.showBtn = false
this.showModal = true
this.$refs.formObj.resetFields()
this._getUser()
this.getPage.records = []
this._hideLoading()
this.id = ''
this.modalTitle = '委托单编辑'
this.id = formObj.id
this.formObj = formObj
this._showTime(formObj)
// for (let i = 0; i < formObj.sampleList.length; i++) {
// if (formObj.sampleList[i].lastTime !== undefined) {
// this.getPage.records[i].lastTime = new Date(
// formObj.sampleList[i].lastTime
// )
// }
// }
},
_getUser() {
const user = Global.getUserInfo()
this.formObj.receiver = user.realname
},
_getTestType: async function() {
const result = await soilEntrust.testType('检验类别')
console.log(result)
if (result) {
console.log('检验类别', result)
this.typeoptions = result
}
},
_showTime(formObj) {
if (this.formObj.receiveTime === undefined) {
this.formObj.receiveTime = ''
} else {
this.formObj.receiveTime = new Date(formObj.receiveTime)
}
if (this.formObj.registTime === undefined) {
this.formObj.registTime = ''
} else {
this.formObj.registTime = new Date(formObj.registTime)
}
},
_showAddress(formObj) {
this.testedCityData = []
if (
formObj.province !== undefined &&
formObj.city !== undefined &&
formObj.county !== undefined
) {
this.testedCityData.push(formObj.province)
this.testedCityData.push(formObj.city)
this.testedCityData.push(formObj.county)
}
},
_getList: async function() {
const result = await meterEntrust.pageList()
const list = []
if (result) {
for (let i = 0; i < result.length; i++) {
list.push(result[i].cname)
}
this.customerData = list
}
},
_getProjectList: async function() {
const result = await soilEntrust.testType('项目名称')
const projectlist = []
if (result) {
for (let i = 0; i < result.length; i++) {
projectlist.push(result[i].name)
}
this.projectData = projectlist
}
},
_getQueryList: async function(data) {
const result = await meterEntrust.pageQueryList(data)
const queryList = []
if (result) {
for (let i = 0; i < result.length; i++) {
queryList.push(result[i].cname)
}
this.customerData = queryList
console.log('委托商', result)
}
},
_getProjectQueryList: async function(data) {
const queryData = {}
queryData.type = '项目名称'
queryData.name = data
const result = await soilEntrust.projectQueryList(queryData)
const queryList = []
if (result) {
for (let i = 0; i < result.length; i++) {
queryList.push(result[i].name)
}
this.projectData = queryList
console.log('项目名称', result)
}
},
_save: async function(data) {
const result = await soilEntrust.aloneSampleAdd(data)
if (result) {
this._resultChange('添加成功!')
} else {
setTimeout(() => {
this._hideLoading()
}, 500)
}
},
_edit: async function(data) {
this._hideLoading()
const result = await soilEntrust.aloneSampleEdit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_sampleEdit: async function(data) {
this._hideLoading()
const result = await soilEntrust.editDTO(data)
if (result) {
this.$Message.success('编辑成功')
}
},
_visibleChange(data) {
this.$forceUpdate()
console.log('清空')
this.formObj.client = ''
this.formObj = {}
}
}
}
</script>
<style>
.vxe-table--tooltip-wrapper {
z-index: 2147483647 !important;
}
</style>
......@@ -376,7 +376,7 @@ export default {
// 上传文件
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'sampleId')
this.$refs.refModal._open(id, 'aloneSampleId')
})
},
_getById: async function(id) {
......
......@@ -5,7 +5,7 @@
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="土质描述详情" prop="detail " style="width: 100%">
<el-input v-model="formObj.detail " name="detail "></el-input>
<Input v-model="formObj.detail " name="detail "></Input>
</Form-item>
</Form>
</div>
......
......@@ -4,36 +4,45 @@
<!--查询条件-->
<Col span="24">
<div>
<Form v-show="searchOpen" :label-width="100" inline onsubmit="return false">
<Form :label-width="100" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="委托编号:" class="search-item">
<Input v-model="formObj.entrustCode" placeholder="请输入委托编号" clearable @on-enter="_formSearch"/>
<Form-item label="钻孔名称:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.boreholeName" placeholder="请输入钻孔名称" clearable/>
</Form-item>
<Form-item label="样品编号:" class="search-item">
<Input v-model="formObj.sampleCode" placeholder="请输入样品编号" clearable @on-enter="_formSearch"/>
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" placeholder="请输入样品编号" clearable/>
</Form-item>
<Form-item label="委托编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.entrustCode" placeholder="请输入委托编号" clearable/>
</Form-item>
<Form-item label="项目名称:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.projectName" placeholder="请输入项目名称" clearable/>
</Form-item>
<Form-item label="现场编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.siteNo" placeholder="请输入现场编号" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button>
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</div>
</Col>
<Col span="24">
<BtnList :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
@on-result-change="_btnClick">
<BtnList :msg="btn" :open="searchOpen" :showSearchBtn="true" @on-result-change="_btnClick"
class="contHide">
</BtnList>
</Col>
<Col span="24">
<PTVXETable ref="pageTable" :page-columns="pageColumns" :table-name="tableName"
:table-height="tableHeight"
:get-page="getPage" select-data @on-result-change="_tableResultChange">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
:key="item.key"
sortable>
<template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div>
......@@ -69,18 +78,11 @@ export default {
userColumns: [],
searchOpen: true,
formObj: {
cname: '',
num: '',
contractName: '',
code: '',
finished: '',
reportDateBegin: '',
reportDateEnd: '',
myGroupData: 0,
name: '',
groupIds: '',
salesmans: '',
type: ''
boreholeName: undefined,
sampleCode: undefined,
entrustCode: undefined,
projectName: undefined,
siteNo: undefined
},
btn: [
{ type: 'primary', id: '', name: '导出' },
......@@ -91,6 +93,9 @@ export default {
{ title: '委托编号', key: 'entrustCode', width: 140 },
{ title: '钻孔名称', key: 'boreholeName', width: 140 },
{ title: '样品编号', key: 'sampleCode', width: 140 },
{ title: '现场编号', key: 'siteNo', width: 140 },
{ title: '项目名称', key: 'projectName', width: 140 },
{ title: '深度', key: 'sampleDepth', width: 140 },
{ title: '状态', key: 'status', width: 80, status: true },
{ title: '检测进度', key: 'testProgress', width: 160 }
],
......@@ -106,9 +111,9 @@ export default {
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('', 400)
return this.$tableHeight('', 300)
} else {
return this.$tableHeight('noSearch') + 50
return this.$tableHeight('noSearch')
}
}
},
......
<template>
<div>
<Row style="border: 2px solid #EEEEEE">
<!--查询条件-->
<Col span="24">
<div>
<Form :label-width="100" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="钻孔名称:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.boreholeName" placeholder="请输入钻孔名称" clearable/>
</Form-item>
<Form-item label="样品编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" placeholder="请输入样品编号" clearable/>
</Form-item>
<Form-item label="委托编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.entrustCode" placeholder="请输入委托编号" clearable/>
</Form-item>
<Form-item label="项目名称:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.projectName" placeholder="请输入项目名称" clearable/>
</Form-item>
<Form-item label="现场编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.siteNo" placeholder="请输入现场编号" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</div>
</Col>
<Col span="24">
<PTVXETableHeight ref="pageTable" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="300"
@on-result-change="_tableResultChange" :getPage="getPage" select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
:key="item.key"
sortable>
<template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div>
<div v-else-if="item.key==='testProgress'" style="position: relative">
<Progress :percent="scope.row.testProgressPer" :stroke-width="30" status="active" hide-info>
</Progress>
<div style="position: absolute;top: 0;bottom: 0;text-align: center;width: 100%;line-height: 30px">
{{scope.row[item.key]}}
</div>
</div>
<div v-else-if="item.status">
{{scope.row[item.key]?scope.row[item.key].display:''}}
</div>
<div v-else-if="item.type">{{$sampleType(scope.row[item.key])}}</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
</template>
<script>
import { soilStatistics } from '../../api'
export default {
components: {},
data() {
return {
tableName: 'food-test-progress-table',
// 用户自己选中的列
userColumns: [],
searchOpen: true,
formObj: {
boreholeName: undefined,
sampleCode: undefined,
entrustCode: undefined,
projectName: undefined,
siteNo: undefined
},
btn: [
{ type: 'primary', id: '', name: '导出' },
{ type: 'primary', id: '', name: '催单' }
],
getPage: {},
pageColumns: [
{ title: '委托编号', key: 'entrustCode', width: 140 },
{ title: '钻孔名称', key: 'boreholeName', width: 140 },
{ title: '样品编号', key: 'sampleCode', width: 140 },
{ title: '现场编号', key: 'siteNo', width: 140 },
{ title: '项目名称', key: 'projectName', width: 140 },
{ title: '深度', key: 'sampleDepth', width: 140 },
{ title: '状态', key: 'status', width: 80, status: true },
{ title: '检测进度', key: 'testProgress', width: 160 }
],
selectIds: [],
selectData: [],
groupData: [],
salesmanData: [],
selectGroupIds: [],
selectSalesmans: [],
typeList: [{ name: '企业', value: 0 }, { name: '政府', value: 1 }]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('', 300)
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
// 重置column
_resetColumn(colList) {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
// 获取业务员数据
_getSalesManList() {
this.$store.dispatch('LmsEquipInfo/userList').then(() => {
const list = this.$store.state.LmsEquipInfo.userList
const tempList = []
list.forEach(item => {
if (item.status.display !== '待激活' && item.realname !== undefined) {
tempList.push({ id: item.id, realname: item.realname })
}
})
this.salesmanData = JSON.parse(JSON.stringify(tempList))
})
},
_salesmanDataChange(data) {
this.formObj.salesmans = data.join(',')
},
// 所选检测科室的ids
_groupDataChange(data) {
this.formObj.groupIds = data.join(',')
},
// 获取当前的检测科室下拉
_getGroupList() {
this.$store.dispatch('LmsUserGroup/list').then(() => {
this.groupData = this.$store.state.LmsUserGroup.list
})
},
// 应出报告日期
_reportDueDateChange(data) {
this.formObj.reportDateBegin = data[0]
this.formObj.reportDateEnd = data[1]
},
_btnClick(msg) {
switch (msg) {
case '导出':
if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出')
} else {
this._export()
}
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_page: async function() {
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilStatistics.listSampleProgress(
this.$serializeForm(this.formObj)
)
if (result) {
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.getPage = this.$store.state.FoodSample.page
break
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < data.length; i++) {
this.selectIds.push(data[i].id)
}
break
case 'changeSize':
this._page()
break
case 'table-col':
// 用户选中的表格列
this.userColumns = data
break
}
}
}
}
</script>
......@@ -19,7 +19,7 @@
<!--<Col span="24">-->
<!--<SampleSteps :info="sampleInfo" ref="stepsModal"></SampleSteps>-->
<!--</Col>-->
<Col :style="processObj" span="24">
<Col style="height: 300px;" span="24">
<VScrollFull ref="myscrollfull" @load="_loadData" :pageSize="rows">
<div slot="empty" style="text-align:center" class="gray-color">暂无数据</div>
<SampleSteps ref="stepsModal" :info="sampleInfo"></SampleSteps>
......@@ -52,7 +52,7 @@ export default {
contractId: '',
//
page: 0,
rows: 30,
rows: 10,
formObj: {},
processObj: {
height: document.documentElement.clientHeight - 300 + 'px'
......
......@@ -27,7 +27,10 @@
<UnfinishedContract></UnfinishedContract>
</Col>
<Col span="24">
<SampleProgress></SampleProgress>
<SampleProgress style="margin-bottom: 20px;"></SampleProgress>
</Col>
<Col span="24" style="margin-bottom: 10px;">
<SampleProgressDetail></SampleProgressDetail>
</Col>
<Col span="12">
<UnfinishedItem></UnfinishedItem>
......@@ -88,6 +91,7 @@ import YearOverItem from './YearOverItem'
import GroupItem from './GroupItem'
import CustomerContract from './CustomerContract'
import SampleProgress from './sample-progress/SampleProgress'
import SampleProgressDetail from './SampleProgressDetail'
export default {
name: 'Workbench',
components: {
......@@ -122,7 +126,9 @@ export default {
// eslint-disable-next-line vue/no-unused-components
CustomerContract,
// eslint-disable-next-line vue/no-unused-components
SampleProgress
SampleProgress,
// eslint-disable-next-line vue/no-unused-components
SampleProgressDetail
},
data() {
return {
......
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