|
|
@@ -0,0 +1,369 @@
|
|
|
+<style>
|
|
|
+ .input-with-select .el-select .el-input {
|
|
|
+ width: 110px;
|
|
|
+ }
|
|
|
+ .input-with-select .el-input-group__append {
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-breadcrumb class="heading">
|
|
|
+ <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
|
|
|
+ <el-breadcrumb-item :to="{ path: '/lims/principal' }">委托方信息</el-breadcrumb-item>
|
|
|
+ <el-breadcrumb-item>{{pagetitle}}</el-breadcrumb-item>
|
|
|
+ </el-breadcrumb>
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header">
|
|
|
+ <span>
|
|
|
+ <i class="icon icon-table2"></i> {{pagetitle}}
|
|
|
+ </span>
|
|
|
+ <span style="float: right;">
|
|
|
+ <el-button v-if="service_flag == 'addservice'" type="primary" @click="addCustomer('customerForm')" class="el-button--small">保存</el-button>
|
|
|
+ <el-button v-if="service_flag == 'editservice'" type="primary" @click="editCustomer('customerForm')" class="el-button--small">保存</el-button>
|
|
|
+ <el-button type="primary" class="el-button--small" onclick="window.history.go(-1)">返回</el-button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <el-form :model="customerForm" :rules="rulestestlistform" label-width="110px" ref="customerForm">
|
|
|
+ <el-row :gutter="20" class="donorsaddformcss">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="类型" prop="ViceBusiness">
|
|
|
+ <el-select v-model="customerForm.ViceBusiness" style="width:100%" clearable placeholder="请选择委托方类型">
|
|
|
+ <el-option label="大港油田" value="大港油田"></el-option>
|
|
|
+ <el-option label="外部委托方" value="外部委托方"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="委托方名称" required prop="CustomerName">
|
|
|
+ <el-input v-model="customerForm.CustomerName" placeholder="请输入委托方名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="机构代码" prop="CustomerCode">
|
|
|
+ <el-input v-model="customerForm.CustomerCode" placeholder="请输入委托方机构代码"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="经办人" required prop="Person">
|
|
|
+ <el-input v-model="customerForm.Person" placeholder="请输入委托方经办人"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="联系电话" required prop="Telephone">
|
|
|
+ <el-input v-model="customerForm.Telephone" placeholder="请输入联系电话"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="邮箱" prop="Mailbox">
|
|
|
+ <el-input v-model="customerForm.Mailbox" placeholder="请输入邮箱"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="委托方地址" prop="Address">
|
|
|
+ <el-input v-model="customerForm.Address" style="width:100%" type="textarea" :rows=3 placeholder="请输入委托方地址"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-row :gutter="10" style="margin-top: 10px; width: 100%; overflow: hidden">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header">
|
|
|
+ <legend style="color:#436EEE"></legend>
|
|
|
+ <i class="icon icon-database"> 检测地点</i>
|
|
|
+ <span style="float: right;">
|
|
|
+ <el-button size="mini" plain type="primary">添加</el-button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ stripe
|
|
|
+ style="width: 100%">
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="设备分类"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="address"
|
|
|
+ label="检测地点"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header">
|
|
|
+ <legend style="color:#436EEE"></legend>
|
|
|
+ <i class="icon icon-database"> 安装位置及设备列表</i>
|
|
|
+ <span style="float: right;">
|
|
|
+ <el-button size="mini" plain type="primary">添加</el-button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ :data="tableData2"
|
|
|
+ stripe
|
|
|
+ style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ prop="seqNo"
|
|
|
+ label="序号"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="设备分类"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="address"
|
|
|
+ label="地点名称"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="address2"
|
|
|
+ label="设备厂家">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="address3"
|
|
|
+ label="设备型号">
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {
|
|
|
+ mapGetters
|
|
|
+ } from 'vuex'
|
|
|
+ import api from '@/api/lims/customerposition'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'labsetingadd',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ customerId: 0,
|
|
|
+ pagetitle: '', //界面标题
|
|
|
+ customerForm: {
|
|
|
+ Id: '',
|
|
|
+ ViceBusiness: '',
|
|
|
+ CustomerName: '',
|
|
|
+ CustomerCode: '',
|
|
|
+ Person: '',
|
|
|
+ Telephone: '',
|
|
|
+ Mailbox: '',
|
|
|
+ Address: '',
|
|
|
+ },
|
|
|
+ rulestestlistform: {
|
|
|
+ CustomerName: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入委托方名称',
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
+ Person: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入经办人',
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
+ Telephone: [{
|
|
|
+ message: '请输入联系电话',
|
|
|
+ trigger: 'blur',
|
|
|
+ required: true
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ ServiceId: '',
|
|
|
+ tableData: [{
|
|
|
+ name: '无游梁式抽油机检测',
|
|
|
+ address: '1号楼'
|
|
|
+ }, {
|
|
|
+ name: '阻火器检测',
|
|
|
+ address: '1号楼'
|
|
|
+ }, {
|
|
|
+ name: '呼吸阀检测',
|
|
|
+ address: '1号楼'
|
|
|
+ }, {
|
|
|
+ name: '空气泡沫产生器检测',
|
|
|
+ address: '1号楼'
|
|
|
+ }, {
|
|
|
+ name: '无游梁式抽油机检测',
|
|
|
+ address: '1号楼'
|
|
|
+ }, {
|
|
|
+ name: '阻火器检测',
|
|
|
+ address: '1号楼'
|
|
|
+ }, {
|
|
|
+ name: '呼吸阀检测',
|
|
|
+ address: '1号楼'
|
|
|
+ }, {
|
|
|
+ name: '空气泡沫产生器检测',
|
|
|
+ address: '1号楼'
|
|
|
+ }],
|
|
|
+
|
|
|
+ tableData2: [{
|
|
|
+ seqNo: '1',
|
|
|
+ name: '无游梁式抽油机检测',
|
|
|
+ address: '1号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'A001'
|
|
|
+ }, {
|
|
|
+ seqNo: '2',
|
|
|
+ name: '阻火器检测',
|
|
|
+ address: '2号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'B002'
|
|
|
+ }, {
|
|
|
+ seqNo: '3',
|
|
|
+ name: '呼吸阀检测',
|
|
|
+ address: '2号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'C003'
|
|
|
+
|
|
|
+ }, {
|
|
|
+ seqNo: '4',
|
|
|
+ name: '空气泡沫产生器检测',
|
|
|
+ address: '2号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'D004'
|
|
|
+ },{
|
|
|
+ seqNo: '5',
|
|
|
+ name: '无游梁式抽油机检测',
|
|
|
+ address: '1号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'A001'
|
|
|
+ }, {
|
|
|
+ seqNo: '6',
|
|
|
+ name: '阻火器检测',
|
|
|
+ address: '2号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'B002'
|
|
|
+ }, {
|
|
|
+ seqNo: '7',
|
|
|
+ name: '呼吸阀检测',
|
|
|
+ address: '2号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'C003'
|
|
|
+
|
|
|
+ }, {
|
|
|
+ seqNo: '8',
|
|
|
+ name: '空气泡沫产生器检测',
|
|
|
+ address: '2号位',
|
|
|
+ address2: '大连制表厂',
|
|
|
+ address3: 'D004'
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.operaid = 195 // initial data
|
|
|
+ this.ServiceId = 195
|
|
|
+ if (this.ServiceId == 'principaladd') {
|
|
|
+ this.pagetitle = '委托方信息'
|
|
|
+ this.service_flag = 'addservice'
|
|
|
+ } else if (this.ServiceId != '0') {
|
|
|
+ this.pagetitle = '委托方信息'
|
|
|
+ this.service_flag = 'editservice'
|
|
|
+ this.customerId = parseInt(this.ServiceId)
|
|
|
+ this.getCustomerInfo()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ addCustomer(formName) {
|
|
|
+ let _this = this
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ _this.$axios.post('customer/customerlistadd', _this.customerForm)
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ window.history.go(-1)
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getCustomerInfo() {
|
|
|
+ let _this = this // request
|
|
|
+ this.$axios.get('customer/getcustomerlist/' + _this.ServiceId, {})
|
|
|
+ .then(res => {
|
|
|
+ _this.customerForm = res.data.items
|
|
|
+ }).catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ editCustomer(formName) {
|
|
|
+ let _this = this
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ _this.$axios.put('/customer/customerlistedit/' + _this.customerForm.Id, _this.customerForm)
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ window.history.go(-1)
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .button {
|
|
|
+ padding: 0;
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .customerbtncss .el-button {
|
|
|
+ padding: 12px 2px;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+</style>
|