|
@@ -14,28 +14,35 @@
|
|
|
<el-form :model="form" :rules="rules" ref="form" size="mini" label-position="right" label-width="100px">
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="阶段名称:" prop="stagename">
|
|
|
- <el-input v-model="form.stagename" autocomplete="off" placeholder="输入手机号码"></el-input>
|
|
|
+ <el-input v-model="form.stagename" autocomplete="off" placeholder="输入阶段名称"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="顺序" >
|
|
|
- <el-input v-model="form.sequence" autocomplete="off" placeholder="输入用户名称"></el-input>
|
|
|
+ <el-input v-model="form.sequence" autocomplete="off" placeholder="输入阶段顺序"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="说明:" prop="remarks">
|
|
|
- <el-input v-model="form.remarks" autocomplete="off" placeholder="输入手机号码"></el-input>
|
|
|
+ <el-input v-model="form.remarks" autocomplete="off" placeholder="输入阶段说明"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="18">
|
|
|
+ <el-col :span="17">
|
|
|
<el-form-item label="请选择适用项目类型:" label-width="160px" prop="remarks">
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item >
|
|
|
- <el-checkbox v-model="checked">适用所有项目类型</el-checkbox>
|
|
|
+ <el-checkbox v-model="checked" @change="checkedChange">适用所有项目类型</el-checkbox>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <layoutTable ref="projectType" :layout="tablecols" :data="list" :custom="true" :checkbox="true" @checkboxCallBack="checkboxCallBack">
|
|
|
+ <template v-slot:customcol="scope">
|
|
|
+ <p>{{scope.column.data[scope.column.columnname]}}</p>
|
|
|
+ </template>
|
|
|
+ </layoutTable>
|
|
|
+ </el-col>
|
|
|
</el-form>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -48,12 +55,20 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import layoutTable from '@/components/table/index2'
|
|
|
export default {
|
|
|
name: "add",
|
|
|
+ components:{
|
|
|
+ layoutTable
|
|
|
+ },
|
|
|
data(){
|
|
|
return {
|
|
|
drawer:false,
|
|
|
- checked:false,
|
|
|
+ checked:true,
|
|
|
+ tablecols:[],
|
|
|
+ list:[],
|
|
|
+ selectType:[],
|
|
|
+ total:0,
|
|
|
form:{
|
|
|
"sa_projstagemagid":0,
|
|
|
"stagename": "",
|
|
@@ -69,19 +84,98 @@ export default {
|
|
|
remarks: [
|
|
|
{ required: true, message: '说明不能为空', trigger: 'blur' },
|
|
|
],
|
|
|
+ },
|
|
|
+ param:{
|
|
|
+ "classname": "sysmanage.develop.optiontype.optiontype",
|
|
|
+ "method": "optiontypeselect",
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "typename": "projecttype",
|
|
|
+ "parameter": {
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
onShow(){
|
|
|
this.drawer = true
|
|
|
+ this.typeData()
|
|
|
+ },
|
|
|
+ /*获取项目类型*/
|
|
|
+ async typeData(){
|
|
|
+ const res = await this.$api.requested(this.param)
|
|
|
+ console.log(res,"项目类型")
|
|
|
+ this.list = res.data
|
|
|
+ this.total = res.total
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ for (let i=0;i<this.list.length;i++){
|
|
|
+ this.$refs.projectType.$refs.tables.toggleRowSelection(this.list[i],true)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
onSubmit(){
|
|
|
-
|
|
|
+ this.form.projecttype = this.selectType
|
|
|
+ if (this.checked){
|
|
|
+ this.form.allprojecttype = 1
|
|
|
+ }else {
|
|
|
+ this.form.allprojecttype = 0
|
|
|
+ }
|
|
|
+ console.log(this.form)
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20221128143504",
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.drawer = false
|
|
|
+ this.$refs.form.resetFields()
|
|
|
+ this.form = {
|
|
|
+ "sa_projstagemagid":0,
|
|
|
+ "stagename": "",
|
|
|
+ "remarks": "",
|
|
|
+ "allprojecttype":0,
|
|
|
+ "sequence":'',
|
|
|
+ "projecttype":''
|
|
|
+ }
|
|
|
+ this.selectType = []
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
onClose(){
|
|
|
|
|
|
+ },
|
|
|
+ checkboxCallBack(val){
|
|
|
+ this.selectType = []
|
|
|
+ val.forEach((item,index)=>{
|
|
|
+ this.selectType[index] = item.value
|
|
|
+ })
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ if (this.selectType.length < this.total){
|
|
|
+ this.checked = false
|
|
|
+ }else {
|
|
|
+ this.checked = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ checkedChange(){
|
|
|
+ if (this.checked){
|
|
|
+ for (let i=0;i<this.list.length;i++){
|
|
|
+ this.$refs.projectType.$refs.tables.toggleRowSelection(this.list[i],true)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ for (let i=0;i<this.list.length;i++){
|
|
|
+ this.$refs.projectType.$refs.tables.toggleRowSelection(this.list[i],false)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.tablecols = this.tool.tabelCol(this.$route.name).projectTypeTable.tablecols
|
|
|
}
|
|
|
}
|
|
|
</script>
|