Commit 3e794727 authored by 张冬's avatar 张冬

增加注册输入限制,替换请求路径

parent 8141d33d
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="padding"> <div class="padding">
<div class="buttons"> <div class="buttons">
<el-button @click="add">添加</el-button> <el-button @click="add">添加</el-button>
<el-button>删除</el-button> <el-button @click="delAllSelection">删除</el-button>
</div> </div>
<dataTable :table-data="tableData" :columns="columns" :is-pageobj="false" @sendSelection="getSelection"> <dataTable :table-data="tableData" :columns="columns" :is-pageobj="false" @sendSelection="getSelection">
<el-table-column slot="operate" label="操作" align="center" fixed="right" width="100"> <el-table-column slot="operate" label="操作" align="center" fixed="right" width="100">
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
:is-inline="true" :is-inline="true"
:is-handle="false" :is-handle="false"
label-width="200px"></dataForm> --> label-width="200px"></dataForm> -->
<el-form :model="searchData" :rules="rules" ref="searchData" label-width="100px" > <el-form :model="searchData" :rules="rules" ref="searchData" label-width="150px">
<el-form-item label="标的编码:" prop="encoding"> <el-form-item label="标的编码:" prop="encoding">
<el-input v-model.trim="searchData.encoding" placeholder='请输入' maxlength="30"></el-input> <el-input v-model.trim="searchData.encoding" placeholder='请输入' maxlength="30"></el-input>
</el-form-item> </el-form-item>
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
</template> </template>
<script> <script>
import dataTable from '@components/nopageTable.vue' import dataTable from '@components/nopageTable.vue'
import dataForm from '@components/dataForm.vue' import dataForm from '@components/dataForm.vue'
export default { export default {
components: { components: {
dataTable, dataTable,
dataForm dataForm
...@@ -139,10 +139,48 @@ export default { ...@@ -139,10 +139,48 @@ export default {
// ], // ],
// 表单验证 // 表单验证
rules: { rules: {
bidName: [{requied: true, message: '请输入', trigger: 'blur'}], encoding: [{
encoding:[{requied: true, message: '请输入', trigger: 'blur'}] required: true,
message: '请输入',
trigger: 'blur'
}],
bidName: [{
required: true,
message: '请输入',
trigger: 'blur'
}],
quantity: [{
required: true,
message: '请输入',
trigger: 'blur'
}],
unit: [{
required: true,
message: '请输入',
trigger: 'blur'
}],
brand: [{
required: true,
message: '请输入',
trigger: 'blur'
}],
specification: [{
required: true,
message: '请输入',
trigger: 'blur'
}],
price: [{
required: true,
message: '请输入',
trigger: 'blur'
}],
remark: [{
required: true,
message: '请输入',
trigger: 'blur'
}],
}, },
projectCommodityList:[], multipleSelection: [],
dialogVisible: false, dialogVisible: false,
searchData: { searchData: {
encoding: '', encoding: '',
...@@ -152,7 +190,7 @@ export default { ...@@ -152,7 +190,7 @@ export default {
brand: '', brand: '',
specification: '', specification: '',
price: '', price: '',
remark:"" remark: ""
}, },
tableData: [], tableData: [],
columns: [{ columns: [{
...@@ -209,7 +247,45 @@ export default { ...@@ -209,7 +247,45 @@ export default {
} }
}, },
methods: { methods: {
sure() { // 删除操作
handleDelete(row, index) {
// 二次确认删除
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$message.success('删除成功')
this.tableData.splice(index, 1)
})
.catch(() => {})
},
getSelection(val) {
console.log(val)
this.multipleSelection = val
},
// 删除操作
delAllSelection() {
let val = this.multipleSelection
if (val.length > 0) {
console.log(val);
val.forEach((va, index) => {
this.tableData.forEach((v, i) => {
if (va.bidName === v.bidName) {
this.tableData.splice(i, 1)
}
})
})
this.$message.success("删除成功");
this.multipleSelection = [];
} else {
this.$message.error("没有选择删除的项");
}
},
// 确认添加需求
async sure() {
const valid = await this.$refs['searchData'].validate();
console.log(valid)
if (valid) {
let type = this.type let type = this.type
if (type === 0) { if (type === 0) {
this.tableData.push(this.searchData) this.tableData.push(this.searchData)
...@@ -217,6 +293,7 @@ export default { ...@@ -217,6 +293,7 @@ export default {
this.$set(this.tableData, this.idx, this.searchData) this.$set(this.tableData, this.idx, this.searchData)
} }
this.dialogVisible = false this.dialogVisible = false
}
}, },
examine(row, index) { examine(row, index) {
this.type = 1 this.type = 1
...@@ -229,29 +306,24 @@ export default { ...@@ -229,29 +306,24 @@ export default {
this.dialogVisible = true this.dialogVisible = true
const searchData = { const searchData = {
encoding: '', encoding: '',
bidName : '', bidName: '',
quantity: '', quantity: '',
unit: '', unit: '',
brand: '', brand: '',
specification: '', specification: '',
price: '', price: '',
remark:"" remark: ""
} }
this.searchData = searchData this.searchData = searchData
}, },
// 获取邀请的供应商列表
getSelection(val) {
this.projectCommodityList = val;
console.log(this.projectCommodityList)
},
next() { next() {
let projectCommodityList=this.projectCommodityList; let projectCommodityList = this.tableData;
if(projectCommodityList.length>0){ if (projectCommodityList.length > 0) {
let ruleForm={}; let ruleForm = {};
ruleForm.projectCommodityList=projectCommodityList; ruleForm.projectCommodityList = projectCommodityList;
this.$emit('getruleForm',ruleForm) this.$emit('getruleForm', ruleForm)
this.$parent.next() this.$parent.next()
}else{ } else {
this.$message.error('请添加标的需求'); this.$message.error('请添加标的需求');
} }
}, },
...@@ -259,7 +331,7 @@ export default { ...@@ -259,7 +331,7 @@ export default {
this.$parent.upper() this.$parent.upper()
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
......
...@@ -234,6 +234,18 @@ export default { ...@@ -234,6 +234,18 @@ export default {
dataTableList dataTableList
}, },
data() { data() {
let checkPhone = async (rule, value, callback) => {
if (!value) {
return callback(new Error('手机号不能为空'));
} else {
const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
if (reg.test(value)) {
callback();
} else {
return callback(new Error('请输入正确的手机号'));
}
}
};
let isMin = (rule, value, callback) => { let isMin = (rule, value, callback) => {
if (!value) { if (!value) {
callback(new Error('请输入')) callback(new Error('请输入'))
...@@ -342,7 +354,7 @@ export default { ...@@ -342,7 +354,7 @@ export default {
}], }],
phone: [{ phone: [{
required: true, required: true,
message: '请输入', validator: checkPhone,
trigger: 'blur' trigger: 'blur'
}], }],
money: [{ money: [{
...@@ -402,7 +414,7 @@ export default { ...@@ -402,7 +414,7 @@ export default {
}], }],
contactsWay: [{ contactsWay: [{
required: true, required: true,
message: '请选择', validator: checkPhone,
trigger: 'blur' trigger: 'blur'
}] }]
}, },
...@@ -480,6 +492,7 @@ export default { ...@@ -480,6 +492,7 @@ export default {
// 删除操作 // 删除操作
delAllSelection() { delAllSelection() {
let val = this.multipleSelection let val = this.multipleSelection
if(val.length>0){
val.forEach((va, index) => { val.forEach((va, index) => {
this.ruleForm.companyVOList.forEach((v, i) => { this.ruleForm.companyVOList.forEach((v, i) => {
if (va.id === v.id) { if (va.id === v.id) {
...@@ -487,19 +500,25 @@ export default { ...@@ -487,19 +500,25 @@ export default {
} }
}) })
}) })
this.$message.error("删除成功"); this.$message.success("删除成功");
this.multipleSelection = []; this.multipleSelection = [];
}else{
this.$message.error("没有选择删除的项");
}
}, },
// 到下一步 // 到下一步
async next() { async next() {
const valid = await this.$refs['ruleForm'].validate() const valid = await this.$refs['ruleForm'].validate()
const valid1 = await this.$refs['bidBookInfoPO'].validate() const valid1 = await this.$refs['bidBookInfoPO'].validate()
let valid2=""
if (this.ruleForm.isNeedEarnest) { if (this.ruleForm.isNeedEarnest) {
const valid2 = await this.$refs['earnestInfoPO'].validate() valid2 = await this.$refs['earnestInfoPO'].validate()
console.log(valid2)
} }
const valid3 = await this.$refs['contentForm'].validate() const valid3 = await this.$refs['contentForm'].validate()
let isNext = '' let isNext = ''
if (this.ruleForm.isNeedEarnest) { if (this.ruleForm.isNeedEarnest) {
console.log(valid2)
isNext = valid && valid1 && valid2 && valid3 isNext = valid && valid1 && valid2 && valid3
} else { } else {
isNext = valid && valid1 && valid3 isNext = valid && valid1 && valid3
......
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
}, },
data() { data() {
return { return {
activeIdx: 1, activeIdx: 0,
allForm: {} allForm: {}
} }
}, },
......
...@@ -5,8 +5,8 @@ import { Message, MessageBox } from 'element-ui' ...@@ -5,8 +5,8 @@ import { Message, MessageBox } from 'element-ui'
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
// baseURL: 'http://192.168.200.201:8082/apis', baseURL: 'http://192.168.200.201:8082/apis',
baseURL: 'http://192.168.3.35:8085/apis', // baseURL: 'http://192.168.3.35:8085/apis',
timeout: 35000 // 请求超时时间 timeout: 35000 // 请求超时时间
}) })
......
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