Commit 5ec9eaaa by lichengming

修改了送检委托单添加

parent db9b2473
......@@ -197,6 +197,7 @@ export default {
this.$emit('on-result-change', 'changeSize')
},
_searchParams() {
this.loading = true
const data = {}
const serData = this.$serialize(this.formId)
Object.assign(data, serData, this.extendsData)
......
......@@ -6,36 +6,36 @@
<Row>
<!--查询-->
<Col span="24" style="margin-top: 10px">
<Form v-show="searchOpen" id="formId" inline onsubmit="return false" :label-width="90">
<Form id="formId" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="实验室名称:">
<Input v-model="formObj.name" name="name" placeholder="请输入实验室名称" clearable @on-enter="_formSearch"/>
<Input v-model="formObj.name" @on-enter="_formSearch" name="name" placeholder="请输入实验室名称" clearable/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" name="aptitude" placeholder="请输入资质" clearable @on-enter="_formSearch"/>
<Input v-model="formObj.aptitude" @on-enter="_formSearch" name="aptitude" placeholder="请输入资质" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button>
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" class="contHide" :open="searchOpen" :show-search-btn="true"
@on-result-change="_btnClick"></btn-list>
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
</Col>
<!--表格-->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId"
:get-page="getPage" :icon-msg="iconMsg" hide-checkbox @on-result-change="_tableResultChange">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" hide-checkbox>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
sortable
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200" :fixed="item.fixed?item.fixed:undefined">
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<span>{{scope.row[item.key]}}</span>
</template>
......@@ -180,6 +180,7 @@ export default {
console.log('this.formObj', this.formObj)
const result = await meterEntrust.pageSendEntrust(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
......
......@@ -40,10 +40,69 @@
<Input v-model="formObj.contractCode" name="contractCode" placeholder="请输入联系人"/>
</Form-item>
<Form-item label="备注:" prop="remark" style="width: 99.8%">
<Input v-model="formObj.remark" name="remark" type="textarea" :rows="3"
<Input v-model="formObj.remark" :rows="3" name="remark" type="textarea"
placeholder="请输入备注"/>
</Form-item>
</Form>
<Col span="24">
<!-- <btn-list :msg="btn" :open="searchOpen" :showSearchBtn="false" @on-result-change="_btnClick"-->
<!-- class="contHide"></btn-list>-->
<Button @click="_add()" type="success">添加</Button>
</Col>
<Col span="24">
<PTVXETable
ref="pageTable"
:form-id="formId"
:tableHeight="500"
:getPage="getPage"
:iconMsg="iconMsg"
@on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
sortable
>
<template slot-scope="scope">
<div v-if="item.key==='name'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.name" blur placeholder="请输入或选择样品名称"
></el-input>
</div>
<div v-if="item.key==='spec'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.spec" blur placeholder="请输入或选择型号规格"
></el-input>
</div>
<div v-if="item.key==='factoryNumber'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.factoryNumber" blur placeholder="请输入或选择出厂编号"
></el-input>
</div>
<div v-if="item.key==='type'" @click.stop="_handleRow(scope)">
<!--&lt;!&ndash; <el-input v-model="scope.row.type" blur placeholder="请输入或选择检测类型"&ndash;&gt;-->
<!--&lt;!&ndash; ></el-input>&ndash;&gt;-->
<Select v-model="scope.row.type">
<Option v-for="(item,index) in options" :key="item.name" :value="index">
{{ item.name }}
</Option>
</Select>
</div>
<div v-if="item.key==='quantity'" @click.stop="_handleRow(scope)">
<!-- <el-input v-model="scope.row.quantity" blur placeholder="请输入或选择数量"-->
<!-- ></el-input>-->
<el-input
v-model="scope.row.quantity"
@keydown.native="channelInputLimit"
type="number"
placeholder="请输入或选择数量"
/>
</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
......@@ -61,6 +120,33 @@ export default {
components: {},
data() {
return {
formId: 'meterSendTestEditFormId',
getPage: {
records: []
},
iconMsg: [
{ type: 'ios-clock', id: '', name: '编辑' },
{ type: 'ios-clock', id: '', name: '删除' }
],
pageColumns: [
{ title: '样品名称', key: 'name', width: 160 },
{ title: '型号规格', key: 'spec' },
{ title: '出厂编号', key: 'factoryNumber' },
{ title: '检测类型', key: 'type' },
{ title: '数量', key: 'quantity' }
// {title: '限制范围或说明', key: 'limitDescription'},
],
options: [
{
name: '检定'
},
{
name: '校准'
},
{
name: '外观检查'
}
],
id: '',
modalTitle: '',
subcontractorId: '',
......@@ -103,6 +189,61 @@ export default {
}
},
methods: {
_add() {
const data = {
name: '',
spec: '',
factoryNumber: '',
quantity: '',
type: ''
}
this.getPage.records.unshift(data)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
// this.getPage = this.$store.state.FoodJudgeBasis.page
break
case 'selectIds':
// this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.rowIndex)
break
// case 'changeSize':
// this._page()
// break
}
},
_iconClick(res, data, index) {
switch (res) {
case '编辑':
// this._editModal(true, data.id)
break
case '删除':
// this._deleteById(data.id)
console.log('点击了删除按钮')
console.log(index)
this.getPage.records.splice(index, 1)
break
case '操作日志':
// this._record(data.id)
break
}
},
_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) {
......@@ -132,7 +273,8 @@ export default {
// 添加
console.log('data', data)
console.log('this.formObj', this.formObj)
this._save(this.formObj)
console.log(this.getPage.records)
// this._save(this.formObj)
} else {
// 编辑
this._edit({ id: this.formObj.id, obj: data })
......@@ -172,6 +314,7 @@ export default {
this._hideLoading()
this._getAptitudeList()
if (this.$string(formObj).isEmpty()) {
this.getPage.records = []
this.id = ''
this.formObj.aptitude = []
this.modalTitle = '分包商管理新增'
......
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