Commit a4edc668 by lichengming

修改了试验委托登记

parent b20192d5
......@@ -9,7 +9,8 @@ export default {
// page
page: data => http.post('soil/v1/entrust/page', data).then(res => res),
getVOById: data => http.get('soil/v1/entrust/' + data).then(res => res),
deleteById: data => http.delete('soil/v1/entrust/' + data).then(res => res),
deleteById: data =>
http.delete('soil/v1/entrust/?ids=' + data).then(res => res),
// 保存
save: data => http.post('soil/v1/entrust/', data).then(res => res),
edit: data => http.put('soil/v1/entrust/' + data.id, data.obj)
......
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" width="1250">
<Modal v-model="showModal" :mask-closable="false" width="700">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="MeterSendTestEdit" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="90" inline>
......@@ -11,19 +11,20 @@
</Form-item>
<Form-item label="委托日期:" prop="entrustDate" class="width-48">
<Date-picker v-model="formObj.entrustDate" @on-change="_ctimeChange" type="date" split-panels style="width:100%;"
placeholder="请选择委托日期"></Date-picker>
placeholder="请选择委托日期" name="entrustDate"></Date-picker>
</Form-item>
<Form-item label="钻孔名称" prop="boreholeName" class="width-48">
<Input v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入名称"/>
</Form-item>
<Form-item label="钻孔位置" prop="boreholeName" class="width-48">
<Form-item label="钻孔位置" prop="boreholeLocation" class="width-48">
<Input v-model="formObj.boreholeLocation" name="boreholeLocation" placeholder="请输入名称"/>
</Form-item>
<Form-item label="水深(米)" prop="waterDepth" class="width-48">
<Input v-model="formObj.waterDepth" name="waterDepth" placeholder="请输入名称"/>
</Form-item>
<Form-item label="制表日期" prop="tabulateDate" class="width-48">
<Input v-model="formObj.tabulateDate" name="tabulateDate" placeholder="请输入名称"/>
<Form-item label="制单日期:" prop="tabulateDate" class="width-48">
<Date-picker v-model="formObj.tabulateDate" @on-change="_tabulateChange" name="tabulateDate" type="date" split-panels style="width:100%;"
placeholder="请选择委托日期"></Date-picker>
</Form-item>
<Form-item label="制表人" prop="tabulater" class="width-48">
<Input v-model="formObj.tabulater" name="tabulater" placeholder="请输入名称"/>
......@@ -145,9 +146,7 @@ export default {
id: '',
modalTitle: '',
subcontractorId: '',
formObj: {
id: ''
},
formObj: {},
ruleValidate: {
client: [
......@@ -284,9 +283,11 @@ export default {
}
},
_ctimeChange(data) {
console.log('时间', data)
this.formObj.entrustDate = data
},
_tabulateChange(data) {
this.formObj.tabulateDate = data
},
_odateChange(data) {
this.formObj.odate = data
},
......@@ -514,14 +515,16 @@ export default {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.$serialize('MeterSendTestEdit')
Object.assign(this.formObj, data)
// Object.assign(this.formObj, data)
if (this.$string(this.id).isEmpty()) {
// 添加
const saveData = this.formObj
this._save(saveData)
// const saveData = this.formObj
this._save(data)
} else {
const saveData = this.formObj
this._edit(saveData)
// const saveData = this.formObj
console.log(data)
data.id = this.id
this._edit(data)
}
} else {
this.$Message.error('表单验证失败!')
......@@ -558,9 +561,7 @@ export default {
this.$refs.formObj.resetFields()
this._hideLoading()
if (this.$string(formObj).isEmpty()) {
this.getPage.records = []
this.id = ''
this.formObj.id = ''
this.formObj.entrustDate = new Date()
this.modalTitle = '委托单新增'
} else {
......@@ -572,38 +573,35 @@ export default {
},
_openEdit(formObj) {
this.showBtn = false
this.getPage.records = []
this.showModal = true
this.$refs.formObj.resetFields()
this._hideLoading()
this.id = ''
this.modalTitle = '送检委托单编辑'
this.modalTitle = '委托单编辑'
this.id = formObj.id
this.formObj = formObj
this._showTime(formObj)
this.getPage.records = formObj.sampleList
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
)
}
}
// this.getPage.records = formObj.sampleList
// 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
// )
// }
// }
},
_showTime(formObj) {
if (this.formObj.odate === undefined) {
this.formObj.odate = ''
} else {
this.formObj.odate = new Date(formObj.odate)
console.log('转换格式后的时间', this.formObj.odate)
}
if (this.formObj.entrustDate === undefined) {
this.formObj.entrustDate = ''
} else {
this.formObj.entrustDate = new Date(formObj.entrustDate)
}
if (this.formObj.tabulateDate === undefined) {
this.formObj.tabulateDate = ''
} else {
this.formObj.tabulateDate = new Date(formObj.tabulateDate)
}
},
_showAddress(formObj) {
this.testedCityData = []
......
......@@ -11,7 +11,7 @@
<Form-item class="search-item" label="委托商:">
<Input v-model="formObj.client" @on-enter="_formSearch" name="client" placeholder="请输入委托单位" clearable/>
</Form-item>
<Form-item class="search-item" label="委托号:">
<Form-item class="search-item" label="委托号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" name="entrustCode" placeholder="请输入委托单号" clearable/>
</Form-item>
<Form-item class="search-btn">
......@@ -37,8 +37,7 @@
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<span v-if="item.key==='edate'">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}
</span>
<span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
......@@ -81,18 +80,20 @@ export default {
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
{ title: '邮编', key: 'postcode' },
{ title: 'E-mail', key: 'email', width: 120 },
{ title: '委托日期', key: 'edate', width: 120 },
{ title: '费用合计', key: 'fee', width: 120 },
{ title: '合同号', key: 'contractCode', width: 120 },
{ title: '备注', key: 'remark' }
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '工程号', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 },
{ title: '批准日期', key: 'approveDate', width: 120, date: true },
{ title: '批准人', key: 'approver', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
]
}
},
......
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