Commit b687985f by wangweidong

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

parents 82b907f4 cb736890
...@@ -41,6 +41,9 @@ ...@@ -41,6 +41,9 @@
<Date-picker v-model="formObj.edate" @on-change="_ctimeChange" type="date" split-panels style="width:100%;" <Date-picker v-model="formObj.edate" @on-change="_ctimeChange" type="date" split-panels style="width:100%;"
placeholder="请选择委托日期"></Date-picker> placeholder="请选择委托日期"></Date-picker>
</Form-item> </Form-item>
<Form-item label="委托费用:" prop="operation.fee" class="width-48">
<Input @keydown.native="channelInputLimit" v-model="formObj.operation.fee" type="number" name="operation.fee" placeholder="请输入委托费用"/>
</Form-item>
<Form-item label="要求完成日期:" prop="odate" class="width-48"> <Form-item label="要求完成日期:" prop="odate" class="width-48">
<Date-picker v-model="formObj.odate" @on-change="_odateChange" type="date" split-panels style="width:100%;" <Date-picker v-model="formObj.odate" @on-change="_odateChange" type="date" split-panels style="width:100%;"
placeholder="请选择要求完成"></Date-picker> placeholder="请选择要求完成"></Date-picker>
...@@ -56,7 +59,9 @@ ...@@ -56,7 +59,9 @@
<Col span="24"> <Col span="24">
<!-- <btn-list :msg="btn" :open="searchOpen" :showSearchBtn="false" @on-result-change="_btnClick"--> <!-- <btn-list :msg="btn" :open="searchOpen" :showSearchBtn="false" @on-result-change="_btnClick"-->
<!-- class="contHide"></btn-list>--> <!-- class="contHide"></btn-list>-->
<Button @click="_add()" type="success">添加</Button> <btn-list :msg="btn" :open="searchOpen" :show-search-btn="false" @on-result-change="_btnClick"
class="contHide"></btn-list>
<!-- <Button @click="_add()" type="success">添加</Button>-->
</Col> </Col>
<Col span="24"> <Col span="24">
<PTVXETable <PTVXETable
...@@ -113,6 +118,7 @@ ...@@ -113,6 +118,7 @@
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer> <modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div> </div>
<EditModal ref="EditModal" @on-result-change="_backData" is-change /> <EditModal ref="EditModal" @on-result-change="_backData" is-change />
<importModal ref="importModal" @on-result-change="_inputBack" aptitude-item></importModal>
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -123,11 +129,19 @@ ...@@ -123,11 +129,19 @@
import { lmsBaseDict, meterEntrust } from '../../../api' import { lmsBaseDict, meterEntrust } from '../../../api'
import CityNameCascader from '../../../components/base/CityNameCascader' import CityNameCascader from '../../../components/base/CityNameCascader'
import AutoComplete from '../../../components/base/AutoCompletes' import AutoComplete from '../../../components/base/AutoCompletes'
import importModal from '../../../components/import/DownloadTemplateImport'
import EditModal from './EditModal' import EditModal from './EditModal'
export default { export default {
components: { EditModal, CityNameCascader, AutoComplete }, components: { EditModal, CityNameCascader, AutoComplete, importModal },
data() { data() {
const validatefee = (rule, value, callback) => {
if (this.formObj.operation.fee === '') {
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('内容不能为空'))
...@@ -163,6 +177,7 @@ export default { ...@@ -163,6 +177,7 @@ export default {
}, },
testedCityData: [], testedCityData: [],
customerData: [], customerData: [],
searchOpen: true,
judgeType: [{ value: 1, name: '是' }, { value: 0, name: '否' }], judgeType: [{ value: 1, name: '是' }, { value: 0, name: '否' }],
iconMsg: [{ type: 'md-trash', id: '', name: '删除' }], iconMsg: [{ type: 'md-trash', id: '', name: '删除' }],
pageColumns: [ pageColumns: [
...@@ -173,6 +188,18 @@ export default { ...@@ -173,6 +188,18 @@ export default {
{ title: '数量', key: 'quantity' } { title: '数量', key: 'quantity' }
// {title: '限制范围或说明', key: 'limitDescription'}, // {title: '限制范围或说明', key: 'limitDescription'},
], ],
btn: [
{
type: 'success',
id: '',
name: '添加'
},
{
type: 'success',
id: '',
name: '导入'
}
],
options: [ options: [
{ {
name: '检定' name: '检定'
...@@ -259,6 +286,14 @@ export default { ...@@ -259,6 +286,14 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
'operation.fee': [
{
required: true,
validator: validatefee,
message: '委托费用不能为空',
trigger: 'blur'
}
],
'operation.person': [ 'operation.person': [
{ required: true, message: '联系人不能为空', trigger: 'blur' } { required: true, message: '联系人不能为空', trigger: 'blur' }
], ],
...@@ -287,6 +322,36 @@ export default { ...@@ -287,6 +322,36 @@ export default {
// ) // )
// }, // },
methods: { methods: {
_importSample() {
const data = {
importUrl: '/meter/v1/sample/import_sample_pre',
downloadUrl: '/meter/v1/excel/template/MeterSampleImport',
title: '导入'
}
this.$refs.importModal._open(data, '样品导入')
},
_inputBack(data) {
if (undefined !== data) {
for (let i = 0; i < data.length; i++) {
this.getPage.records.push(data[i])
}
}
},
_btnClick(msg) {
this.$nextTick(function() {
switch (msg) {
case '添加':
this._add()
break
case '导入':
this._importSample()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_cusNameChange(msg, data) { _cusNameChange(msg, data) {
// this.financeObj = {} // 清空维护发票信息的数据 // this.financeObj = {} // 清空维护发票信息的数据
if (this.$string(this.id).isEmpty()) { if (this.$string(this.id).isEmpty()) {
...@@ -545,6 +610,8 @@ export default { ...@@ -545,6 +610,8 @@ export default {
this._hideLoading() this._hideLoading()
this.getPage.records = [] this.getPage.records = []
this.id = '' this.id = ''
this.formObj.id = ''
this.formObj.operation.id = ''
this.modalTitle = '出检委托单登记' this.modalTitle = '出检委托单登记'
this.testedCityData = [] this.testedCityData = []
}, },
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
</Radio-group> </Radio-group>
</Form-item> </Form-item>
<Form-item label="委托单位" prop="client" class="width-48"> <Form-item label="委托单位" prop="client" class="width-48">
<AutoComplete :value="formObj.client" :down-data="customerData" name="client" <AutoComplete :value="formObj.client" :down-data="customerData" @on-result-change="_cusNameChange"
placeholder="请输入或选择委托单位" @on-result-change="_cusNameChange" name="client" placeholder="请输入或选择委托单位"
></AutoComplete> ></AutoComplete>
</Form-item> </Form-item>
<Form-item label="联系人" prop="operation.person" class="width-48"> <Form-item label="联系人" prop="operation.person" class="width-48">
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<Input v-model="formObj.operation.fax" name="operation.fax" placeholder="请输入传真"/> <Input v-model="formObj.operation.fax" name="operation.fax" placeholder="请输入传真"/>
</Form-item> </Form-item>
<Form-item label="省、市、区" prop="testedCityData" class="width-48"> <Form-item label="省、市、区" prop="testedCityData" class="width-48">
<CityNameCascader :value="testedCityData.join(',')" name="tested" @on-result-change="_cascaderResult"> <CityNameCascader :value="testedCityData.join(',')" @on-result-change="_cascaderResult" name="tested">
</CityNameCascader> </CityNameCascader>
</Form-item> </Form-item>
...@@ -39,15 +39,15 @@ ...@@ -39,15 +39,15 @@
<Input v-model="formObj.operation.email" name="operation.email" placeholder="请输入E-mail"/> <Input v-model="formObj.operation.email" name="operation.email" placeholder="请输入E-mail"/>
</Form-item> </Form-item>
<Form-item label="委托日期:" prop="edate" class="width-48"> <Form-item label="委托日期:" prop="edate" class="width-48">
<Date-picker v-model="formObj.edate" type="date" split-panels style="width:100%;" placeholder="请选择委托日期" <Date-picker v-model="formObj.edate" @on-change="_ctimeChange" type="date" split-panels style="width:100%;"
@on-change="_ctimeChange"></Date-picker> placeholder="请选择委托日期"></Date-picker>
</Form-item> </Form-item>
<Form-item label="委托费用:" prop="cost" class="width-48"> <Form-item label="委托费用:" prop="operation.fee" class="width-48">
<Input @keydown.native="channelInputLimit" v-model="formObj.operation.fee" type="number" name="cost" placeholder="请输入委托费用"/> <Input @keydown.native="channelInputLimit" v-model="formObj.operation.fee" type="number" name="operation.fee" placeholder="请输入委托费用"/>
</Form-item> </Form-item>
<Form-item label="要求完成日期:" prop="odate" class="width-48"> <Form-item label="要求完成日期:" prop="odate" class="width-48">
<Date-picker v-model="formObj.odate" type="date" split-panels style="width:100%;" placeholder="请选择要求完成日期" <Date-picker v-model="formObj.odate" @on-change="_odateChange" type="date" split-panels style="width:100%;"
@on-change="_odateChange"></Date-picker> placeholder="请选择要求完成日期"></Date-picker>
</Form-item> </Form-item>
<Form-item label="合同号:" prop="contractCode" class="width-48"> <Form-item label="合同号:" prop="contractCode" class="width-48">
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
</Form-item> </Form-item>
</Form> </Form>
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="false" class="contHide" <btn-list :msg="btn" :open="searchOpen" :show-search-btn="false" @on-result-change="_btnClick"
@on-result-change="_btnClick"></btn-list> class="contHide"></btn-list>
</Col> </Col>
<Col span="24"> <Col span="24">
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.key==='name'" @click.stop="_handleRow(scope)"> <div v-if="item.key==='name'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.name" blur placeholder="请输入或选择样品名称" @click.native="_selectjudgeBasis(scope.$rowIndex)" <el-input v-model="scope.row.name" @click.native="_selectjudgeBasis(scope.$rowIndex)" blur placeholder="请输入或选择样品名称"
></el-input> ></el-input>
</div> </div>
...@@ -109,9 +109,9 @@ ...@@ -109,9 +109,9 @@
<div v-if="item.key==='quantity'" @click.stop="_handleRow(scope)"> <div v-if="item.key==='quantity'" @click.stop="_handleRow(scope)">
<el-input <el-input
v-model="scope.row.quantity" v-model="scope.row.quantity"
@keydown.native="channelInputLimit"
type="number" type="number"
placeholder="请输入或选择数量" placeholder="请输入或选择数量"
@keydown.native="channelInputLimit"
/> />
</div> </div>
...@@ -135,9 +135,9 @@ ...@@ -135,9 +135,9 @@
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer> <modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div> </div>
</Modal> </Modal>
<EditModal ref="EditModal" is-change @on-result-change="_backData" /> <EditModal ref="EditModal" @on-result-change="_backData" is-change />
<importModal ref="importModal" aptitude-item @on-result-change="_inputBack"></importModal> <importModal ref="importModal" @on-result-change="_inputBack" aptitude-item></importModal>
</div> </div>
</template> </template>
<script> <script>
...@@ -153,6 +153,13 @@ import EditModal from './EditModal' ...@@ -153,6 +153,13 @@ import EditModal from './EditModal'
export default { export default {
components: { CityNameCascader, EditModal, AutoComplete, importModal }, components: { CityNameCascader, EditModal, AutoComplete, importModal },
data() { data() {
const validatefee = (rule, value, callback) => {
if (this.formObj.operation.fee === '') {
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('内容不能为空'))
...@@ -297,6 +304,14 @@ export default { ...@@ -297,6 +304,14 @@ export default {
'operation.person': [ 'operation.person': [
{ required: true, message: '联系人不能为空', trigger: 'blur' } { required: true, message: '联系人不能为空', trigger: 'blur' }
], ],
'operation.fee': [
{
required: true,
validator: validatefee,
message: '委托费用不能为空',
trigger: 'blur'
}
],
'operation.tel': [ 'operation.tel': [
{ required: true, message: '联系电话不能为空', trigger: 'blur' } { required: true, message: '联系电话不能为空', trigger: 'blur' }
], ],
...@@ -615,6 +630,8 @@ export default { ...@@ -615,6 +630,8 @@ export default {
if (this.$string(formObj).isEmpty()) { if (this.$string(formObj).isEmpty()) {
this.getPage.records = [] this.getPage.records = []
this.id = '' this.id = ''
this.formObj.id = ''
this.formObj.operation.id = ''
this.formObj.aptitude = [] this.formObj.aptitude = []
this.modalTitle = '送检委托单新增' this.modalTitle = '送检委托单新增'
} else { } else {
......
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