Commit e04c08f1 authored by Mac's avatar Mac

1

parent 4a0b85cd
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<q-toggle v-if="element.IsLock==1" v-model="element.Enable" :true-value="1" :false-value="2" <q-toggle v-if="element.IsLock==1" v-model="element.Enable" :true-value="1" :false-value="2"
icon="lock" disable /> icon="lock" disable />
<q-toggle v-else v-model="element.Enable" :true-value="1" :false-value="2" <q-toggle v-else v-model="element.Enable" :true-value="1" :false-value="2"
@update:model-value="godelete(element,1,index)" /> @update:model-value="godelete(element.Enable,1,index)" />
</td> </td>
<td> <td>
<q-toggle v-model="element.Required" :true-value="1" :false-value="2" <q-toggle v-model="element.Required" :true-value="1" :false-value="2"
...@@ -58,19 +58,20 @@ ...@@ -58,19 +58,20 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent ,ref, onMounted,reactive } from 'vue' import { defineComponent ,ref, onMounted, } from 'vue'
import requestgroup from '../../../components/customer/request-group.vue' // import requestgroup from '../../../components/customer/request-group.vue'
import customerService from '@/api/customer' import customerService from '@/api/customer'
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import { useQuasar } from 'quasar' import { useQuasar } from 'quasar'
interface listType { interface listType {
Id: number Id: number
Enable:number Enable:number
Required:number Required?:number
[propName:string]:any [propName:string]:any
} }
export default defineComponent({ export default defineComponent({
components: { draggable ,requestgroup}, components: { draggable },
setup() { setup() {
const $q = useQuasar() const $q = useQuasar()
let data= ref<Array<listType>>([]) let data= ref<Array<listType>>([])
...@@ -95,7 +96,7 @@ ...@@ -95,7 +96,7 @@
} }
customerService.setCustomerFiledState(msg).then((res) => { customerService.setCustomerFiledState(msg).then((res) => {
if (res.data.Code == 1) { if (res.data.Code == 1) {
console.log(res)
}else{//如果移动失败 重新获取列表 }else{//如果移动失败 重新获取列表
changePage() changePage()
} }
...@@ -125,11 +126,13 @@ ...@@ -125,11 +126,13 @@
} }
}) })
} }
const godelete = (item:any,type:number,index:number) => { const godelete = (item:listType,type:number,index:number) => {
let text = '' let text = ''
console.log(item)
if(type==1){//tyep等于1和2的时候 先让弹出提示 然后再给予掉接口 所以把原本的值暂时先赋值给本身 if(type==1){//tyep等于1和2的时候 先让弹出提示 然后再给予掉接口 所以把原本的值暂时先赋值给本身
text = '确定修改启用状态' text = '确定修改启用状态'
if(item.Enable==2){ if(item.Enable==2){
data.value[index].Enable = 1 data.value[index].Enable = 1
}else{ }else{
data.value[index].Enable = 2 data.value[index].Enable = 2
...@@ -138,6 +141,8 @@ ...@@ -138,6 +141,8 @@
text = '确定修改必填状态' text = '确定修改必填状态'
if(item.Required==2){ if(item.Required==2){
data.value[index].Required = 1 data.value[index].Required = 1
console.log( data.value[index].Required,' data.value[index].Required')
}else{ }else{
data.value[index].Required = 2 data.value[index].Required = 2
} }
......
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