Commit 8a9e557c by wangweidong

整体优化

parent 8038d535
...@@ -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" @on-result-change="_cusNameChange" <AutoComplete :value="formObj.client" :down-data="customerData" name="client"
name="client" placeholder="请输入或选择委托单位" placeholder="请输入或选择委托单位" @on-result-change="_cusNameChange"
></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(',')" @on-result-change="_cascaderResult" name="tested"> <CityNameCascader :value="testedCityData.join(',')" name="tested" @on-result-change="_cascaderResult">
</CityNameCascader> </CityNameCascader>
</Form-item> </Form-item>
...@@ -39,13 +39,13 @@ ...@@ -39,13 +39,13 @@
<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" @on-change="_ctimeChange" type="date" split-panels style="width:100%;" <Date-picker v-model="formObj.edate" type="date" split-panels style="width:100%;" placeholder="请选择委托日期"
placeholder="请选择委托日期"></Date-picker> @on-change="_ctimeChange"></Date-picker>
</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" @on-change="_odateChange" type="date" split-panels style="width:100%;" <Date-picker v-model="formObj.odate" type="date" split-panels style="width:100%;" placeholder="请选择要求完成日期"
placeholder="请选择要求完成日期"></Date-picker> @on-change="_odateChange"></Date-picker>
</Form-item> </Form-item>
<Form-item label="合同号:" prop="contractCode" class="width-48"> <Form-item label="合同号:" prop="contractCode" class="width-48">
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
</Form-item> </Form-item>
</Form> </Form>
<Col span="24"> <Col span="24">
<!-- <btn-list :msg="btn" :open="searchOpen" :showSearchBtn="false" @on-result-change="_btnClick"--> <btn-list :msg="btn" :open="searchOpen" :show-search-btn="false" class="contHide"
<!-- class="contHide"></btn-list>--> @on-result-change="_btnClick"></btn-list>
<Button @click="_add()" type="success">添加</Button>
</Col> </Col>
<Col span="24"> <Col span="24">
<PTVXETable <PTVXETable
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,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" @click.native="_selectjudgeBasis(scope.$rowIndex)" blur placeholder="请输入或选择样品名称" <el-input v-model="scope.row.name" blur placeholder="请输入或选择样品名称" @click.native="_selectjudgeBasis(scope.$rowIndex)"
></el-input> ></el-input>
</div> </div>
...@@ -107,9 +107,9 @@ ...@@ -107,9 +107,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>
...@@ -119,6 +119,11 @@ ...@@ -119,6 +119,11 @@
placeholder="请输入备注" placeholder="请输入备注"
/> />
</div> </div>
<div v-else>
{{scope.row[item.key]}}
</div>
</template> </template>
</vxe-table-column> </vxe-table-column>
</PTVXETable> </PTVXETable>
...@@ -128,7 +133,9 @@ ...@@ -128,7 +133,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" @on-result-change="_backData" is-change /> <EditModal ref="EditModal" is-change @on-result-change="_backData" />
<importModal ref="importModal" aptitude-item @on-result-change="_inputBack"></importModal>
</div> </div>
</template> </template>
<script> <script>
...@@ -136,12 +143,13 @@ ...@@ -136,12 +143,13 @@
* 添加编辑分包商 * 添加编辑分包商
*/ */
import { lmsBaseDict, meterEntrust, meterSample } from '../../../api' import { lmsBaseDict, meterEntrust, meterSample } from '../../../api'
import importModal from '../../../components/import/DownloadTemplateImport'
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 EditModal from './EditModal' import EditModal from './EditModal'
export default { export default {
components: { CityNameCascader, EditModal, AutoComplete }, components: { CityNameCascader, EditModal, AutoComplete, importModal },
data() { data() {
const validateRemark = (rule, value, callback) => { const validateRemark = (rule, value, callback) => {
if (this.testedCityData.length === 0) { if (this.testedCityData.length === 0) {
...@@ -178,6 +186,7 @@ export default { ...@@ -178,6 +186,7 @@ export default {
}, },
customerData: [], customerData: [],
cityData: [], cityData: [],
searchOpen: true,
testedCityData: [], testedCityData: [],
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: '删除' }],
...@@ -188,9 +197,23 @@ export default { ...@@ -188,9 +197,23 @@ export default {
{ title: '出厂编号', key: 'factoryNumber' }, { title: '出厂编号', key: 'factoryNumber' },
{ title: '检测类型', key: 'type' }, { title: '检测类型', key: 'type' },
{ title: '数量', key: 'quantity' }, { title: '数量', key: 'quantity' },
{ title: '单价', key: 'price' },
{ title: '总价', key: 'totalPrice' },
{ title: '备注', key: 'remark' } { title: '备注', key: 'remark' }
// {title: '限制范围或说明', key: 'limitDescription'}, // {title: '限制范围或说明', key: 'limitDescription'},
], ],
btn: [
{
type: 'success',
id: '',
name: '添加'
},
{
type: 'success',
id: '',
name: '导入'
}
],
options: [ options: [
{ {
name: '检定' name: '检定'
...@@ -321,6 +344,29 @@ export default { ...@@ -321,6 +344,29 @@ export default {
this.formObj.client = query this.formObj.client = query
console.log(query) console.log(query)
}, },
_btnClick(msg) {
this.$nextTick(function() {
switch (msg) {
case '添加':
this._add()
break
case '导入':
this._importSample()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_inputBack(data) {
if (undefined !== data) {
for (let i = 0; i < data.length; i++) {
this.getPage.records.push(data[i])
}
}
},
_ctimeChange(data) { _ctimeChange(data) {
console.log('时间', data) console.log('时间', data)
this.formObj.edate = data this.formObj.edate = data
...@@ -362,8 +408,11 @@ export default { ...@@ -362,8 +408,11 @@ export default {
console.log(typeof this.index) console.log(typeof this.index)
this.getPage.records[this.index].name = data.name this.getPage.records[this.index].name = data.name
this.getPage.records[this.index].aptitudeId = data.id this.getPage.records[this.index].aptitudeId = data.id
console.log('返回的数据') this.getPage.records[this.index].verification = data.code + data.basis
console.log(data) this.getPage.records[this.index].price = data.price
this.getPage.records[this.index].totalPrice =
data.price * this.getPage.records[this.index].quantity
console.log('返回的数据', data)
console.log(this.getPage.records) console.log(this.getPage.records)
}, },
_add() { _add() {
...@@ -377,6 +426,16 @@ export default { ...@@ -377,6 +426,16 @@ export default {
} }
this.getPage.records.unshift(data) this.getPage.records.unshift(data)
}, },
_importSample() {
const data = {
importUrl: '/meter/v1/sample/import_sample_pre',
downloadUrl: '/meter/v1/excel/template/MeterSampleImport',
title: '导入'
}
this.$refs.importModal._open(data, '样品导入')
},
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'selectIds': case 'selectIds':
......
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