Commit 60fd52b9 by wangweidong

优化修改

parent 21ce9f9b
......@@ -167,6 +167,8 @@ export default {
getReviewById: data =>
http.get('meter/v1/contract/review/' + data).then(res => res),
getReviewDTOById: data =>
http.get('meter/v1/contract/review_record/' + data).then(res => res),
getReviewRecordById: data =>
http.get('meter/v1/contract/review_record/' + data).then(res => res)
}
......@@ -44,10 +44,10 @@
<Input v-model="formObj.discount" name="discount" placeholder="折扣"/>
</Form-item>
<Form-item label="检定/校准执行规程/规范:" prop="requirements" style="width: 99.8%">
<Input v-model="formObj.requirements" :rows="3" name="requirements" type="textarea"
placeholder="请输入检定/校准执行规程/规范"/>
</Form-item>
<!-- <Form-item label="检定/校准执行规程/规范:" prop="requirements" style="width: 99.8%">-->
<!-- <Input v-model="formObj.requirements" :rows="3" name="requirements" type="textarea"-->
<!-- placeholder="请输入检定/校准执行规程/规范"/>-->
<!-- </Form-item>-->
<Form-item label="备注:" prop="remark" style="width: 99.8%">
<Input v-model="formObj.remark" :rows="3" name="remark" type="textarea"
placeholder="请输入备注"/>
......@@ -84,6 +84,10 @@
></el-input>
<a style="font-size: 18px;" class="" @on-result-change="_judgeBasisChange" @click="_selectjudgeBasis(scope.$rowIndex)">+</a>
</div>
<div v-if="item.key==='verification'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.verification" placeholder="请输入检定依据" style="width: 85%"></el-input>
<a style="font-size: 18px;width: 15%" class="" @on-result-change="_judgeBasisChange" @click="_selectverification(scope.$rowIndex)">+</a>
</div>
<div v-else-if="item.key==='spec'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.spec" blur placeholder="请输入或选择型号规格"
></el-input>
......@@ -132,6 +136,7 @@
</Modal>
<EditModal ref="EditModal" is-change @on-result-change="_backData" />
<importModal ref="importModal" aptitude-item @on-result-change="_inputBack"></importModal>
<VerificationModal ref="VerificationModal" @on-result-change="_backVerification"></VerificationModal>
</div>
</template>
<script>
......@@ -143,9 +148,15 @@ import CityNameCascader from '../../../components/base/CityNameCascader'
import AutoComplete from '../../../components/base/AutoCompletes'
import importModal from '../../../components/import/DownloadTemplateImport'
import EditModal from './EditModal'
import VerificationModal from './VerificationModal'
export default {
components: { CityNameCascader, EditModal, AutoComplete, importModal },
components: {
CityNameCascader,
EditModal,
AutoComplete,
importModal,
VerificationModal
},
data() {
const validateRemark = (rule, value, callback) => {
if (this.testedCityData.length === 0) {
......@@ -182,6 +193,7 @@ export default {
{ title: '名称', key: 'name', width: 180 },
{ title: '型号', key: 'spec' },
{ title: '是否资质内可检', key: 'aptituded', width: 130 },
{ title: '检定/校准依据', key: 'verification', width: 200 },
{ title: '数量', key: 'quantity', width: 130 },
{ title: '技术参数', key: 'technicalParameter' },
{ title: '生产厂家', key: 'manufacturer' },
......@@ -242,7 +254,31 @@ export default {
testedStreet: ''
}
},
formObjPre: {
client: '',
linkman: '',
salesCode: '',
tel: '',
email: '',
address: '',
remark: '',
province: '',
city: '',
county: '',
requirements: '',
discount: '',
street: '',
edate: '',
odate: '',
person: '',
fax: '',
testedTemp: {
testedProvince: '',
testedCity: '',
testedCounty: '',
testedStreet: ''
}
},
ruleValidate: {
client: [
{
......@@ -346,6 +382,11 @@ export default {
this.$refs.formObj.validateField('code')
}
},
_selectverification(index) {
console.log(index)
this.index = index
this.$refs.VerificationModal._open()
},
_selectjudgeBasis(index) {
console.log(index)
this.index = index
......@@ -355,11 +396,17 @@ export default {
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 =
(undefined === data.code ? '' : data.code) +
(undefined === data.basis ? '' : data.basis)
console.log('返回的数据')
console.log(data)
console.log(this.getPage.records)
},
_backVerification(data) {
this.$forceUpdate()
this.getPage.records[this.index].verification = data.verification
},
_inputBack(data) {
if (undefined !== data) {
for (let i = 0; i < data.length; i++) {
......@@ -563,13 +610,14 @@ export default {
},
_open(formObj) {
this.showModal = true
this.formObj = this.formObjPre
this._getList()
this.$refs.formObj.resetFields()
this._emptyProvince()
this._hideLoading()
if (this.$string(formObj).isEmpty()) {
this.getPage.records = []
this.id = ''
this.id = undefined
this.modalTitle = '合同新增'
} else {
this.id = formObj.id
......@@ -633,7 +681,7 @@ export default {
]
this.formObj.province = result[0].province
this.formObj.city = result[0].city
this.formObj.county = result[0].county
this.formObj.county = result[0].area
}
},
_getAptitudeList: async function() {
......
<template>
<div>
<Modal v-model="showUserGroupModal" width="800">
<p slot="header">
{{ modalTitle }}
</p>
<Row>
<!--查询条件-->
<Col span="24">
<Form id="test-item-form" :label-width="90" inline onsubmit="return false">
<label class="label-sign" />
<Form-item :label-width="70" label="授权资质仪器名称" >
<Input
v-model="code"
@on-enter="_pageChange(1)"
placeholder="授权资质仪器名称"
style="width: 100%"
/>
</Form-item>
<Form-item label="检测依据名称">
<Input
v-model="name"
@on-enter="_pageChange(1)"
placeholder="请输入检测依据名称"
style="width: 100%"
/>
</Form-item>
</Form>
</Col>
<Col span="24" style="margin-bottom: 10px">
<el-table
:data="getPage"
@row-click="_rowChange"
@row-dblclick="_dbClick"
border
size="small"
highlight-current-row
style="width: 100%"
>
<el-table-column
v-for="item in pageColumns"
:key="item.key"
:prop="item.key"
:label="item.title"
:min-width="item.width"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-if="item.key==='status'">
{{ scope.row[item.key]?scope.row[item.key].display:'' }}
</span>
<span v-else>{{ scope.row[item.key] }}</span>
</template>
</el-table-column>
</el-table>
</Col>
<Col span="24">
<Page
:total="getPage.total"
:page-size="getPage.size"
@on-change="_pageChange"
@on-page-size-change="_pageRows"
placement="top"
show-total
show-elevator
show-sizer
/>
<div style="clear: both" />
</Col>
</Row>
<div slot="footer" class="btn-width">
<Button @click="_cancel" style="margin-left: 8px">
取消
</Button>
<Button @click="_ok" type="primary">
确定
</Button>
</div>
</Modal>
</div>
</template>
<script>
// import { meterAptitude } from '../../../api'
import { meterAptitude } from '../../../api'
export default {
name: 'EditModal',
data() {
return {
formObj: {
name: undefined,
code: undefined
},
loading: true,
pageParams: { rows: 20 },
pageColumns: [
{ title: '检定依据', key: 'verification', width: 120 },
{ title: '检定依据名称', key: 'name', width: 140 }
// { title: '传真', key: 'fax', width: 120 },
// { title: '详细地址', key: 'address', width: 250 },
// { title: '登记日期', key: 'edate', width: 120, date: true },
// { title: '要求完成时间', key: 'odate', width: 120, date: true },
// { title: '折扣', key: 'discount', width: 120 },
// { title: '总价', key: 'totalPrice', width: 120 },
// { title: '折扣价', key: 'discountPrice', width: 120 },
// { title: '备注', key: 'remark' }
],
getPage: [],
showUserGroupModal: false,
modalTitle: '',
currentRowData: {},
name: '',
code: ''
}
},
methods: {
_open() {
this.modalTitle = '选择检测依据'
this.name = ''
this.code = ''
this._judge()
},
_judge() {
this.showUserGroupModal = true
this.currentRowData = {}
this._page()
},
_page: async function() {
const result = await meterAptitude.page(this.formObj)
if (result) {
this.getPage = result.records
console.log(this.getPage)
for (let i = 0; i < this.getPage.length; i++) {
this.getPage[i].verification =
this.getPage[i].code + this.getPage[i].name
}
this.loading = false
}
},
_pageChange(page) {
this.pageParams.page = page
this._page()
},
_pageRows(rows) {
this.pageParams.rows = rows
this._page()
},
_searchParams() {
const data = this.$serialize('test-item-form')
if (this.name) {
data.name = this.name
}
if (this.code) {
data.code = this.code
}
return this.$extend(data, this.pageParams)
},
_search() {
this._page()
},
_rowChange(data) {
this.currentRowData = data // 选中的行数据;
},
_cancel() {
this.showUserGroupModal = false
},
_ok() {
if (JSON.stringify(this.currentRowData) === '{}') {
switch (this.modalTitle) {
case '选择检测依据':
this.$Message.warning('请选择一条合同!')
break
}
} else {
this.$emit('on-result-change', this.currentRowData)
this.showUserGroupModal = false
}
},
// 双击
_dbClick(data, event) {
this.currentRowData = data
// 选中的行数据;
this._ok()
}
}
}
</script>
<style scoped>
</style>
......@@ -49,6 +49,7 @@
<MeterReviewHisHisOperation ref="operationModal"></MeterReviewHisHisOperation>
<FileManage ref="FileManage"></FileManage>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit>
<MeterContractReviewAddEdit ref="addEditModal" @on-result-change="_page"></MeterContractReviewAddEdit>
</div>
</template>
<script>
......@@ -56,8 +57,13 @@ import http from '../../../api/http'
import { meterContract, meterSubcontractor } from '../../../api'
import MeterReviewHisHisOperation from '../../../components/operation/Operation'
import MeterSubcontractorEdit from './MeterContractReviewEdit'
import MeterContractReviewAddEdit from './MeterContractReviewRecord'
export default {
components: { MeterSubcontractorEdit, MeterReviewHisHisOperation },
components: {
MeterSubcontractorEdit,
MeterReviewHisHisOperation,
MeterContractReviewAddEdit
},
data() {
return {
currentComponent: '',
......@@ -73,6 +79,11 @@ export default {
type: 'success',
id: 'meter-contract-review-his-export',
name: '导出项目统计表'
},
{
type: 'success',
id: '',
name: '导出合同评审记录'
}
],
iconMsg: [
......@@ -92,9 +103,9 @@ export default {
name: '附件'
},
{
type: 'md-remove-circle',
id: 'meter-contract-review-his-remove-operation',
name: '删除'
type: 'md-create',
id: '',
name: '评审记录'
},
{
type: 'ios-clock',
......@@ -147,6 +158,9 @@ export default {
case '导出项目统计表':
this._exportContractTable()
break
case '导出合同评审记录':
this._exportContractReviewRecord()
break
case 'search':
this.searchOpen = !this.searchOpen
break
......@@ -155,10 +169,10 @@ export default {
},
_exportContractTable() {
// if (this.selectIds.length === 0) {
// this.$Message.warning('请选择要导出的数据!')
// return false
// }
if (this.selectIds.length === 0) {
this.$Message.warning('请选择要导出的数据!')
return false
}
const sampleIds = this.selectIds.join(',')
const data = this.formObj
data.idsStr = sampleIds
......@@ -173,6 +187,22 @@ export default {
}
})
},
_exportContractReviewRecord() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择要导出的数据!')
return false
}
const sampleIds = this.selectIds.join(',')
const data = this.formObj
data.idsStr = sampleIds
this.$Modal.confirm({
title: '提示',
content: '确定导出数据?',
onOk: () => {
http.open('/meter/v1/contract/export_contract_review_record/', data)
}
})
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
......@@ -193,9 +223,22 @@ export default {
case '操作日志':
this._record(data.id)
break
case '评审记录':
this._reviewContract(data.id)
break
}
})
},
// 编辑&添加
_reviewContract(id) {
this._getContractReview(id)
},
_getContractReview: async function(id) {
const result = await meterContract.getReviewDTOById(id)
if (result) {
this.$refs.addEditModal._openEdit(result)
}
},
_record(id) {
this.$refs.operationModal._open(id)
},
......
......@@ -225,7 +225,7 @@ export default {
pageColumns: [
{ title: '样品名称', key: 'name', width: 200 },
{ title: '型号规格', key: 'spec' },
{ title: '检定依据', key: 'verification', width: 200 },
{ title: '检定/校准依据', key: 'verification', width: 200 },
{ title: '出厂编号', key: 'factoryNumber' },
{ title: '制造单位', key: 'manufacturer' },
{ title: '检测类型', key: 'type' },
......
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