优化走访慰问
This commit is contained in:
		@@ -48,7 +48,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            <div class="addBtns">
 | 
					            <div class="addBtns">
 | 
				
			||||||
              <span> 点击</span>
 | 
					              <span> 点击</span>
 | 
				
			||||||
              <span class="toAdds" @click="goDetail">新增按钮</span>
 | 
					              <span class="toAdds" @click="goDetail()">新增按钮</span>
 | 
				
			||||||
              <span> 试试试吧~</span>
 | 
					              <span> 试试试吧~</span>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
@@ -61,23 +61,16 @@
 | 
				
			|||||||
        <div class="addBtn iconfont iconfont-iconfangda" @tap.stop="goDetail()" />
 | 
					        <div class="addBtn iconfont iconfont-iconfangda" @tap.stop="goDetail()" />
 | 
				
			||||||
      </AiFixedBtn>
 | 
					      </AiFixedBtn>
 | 
				
			||||||
    </template>
 | 
					    </template>
 | 
				
			||||||
 | 
					 | 
				
			||||||
    <component v-else :is="comp" :params="params"></component>
 | 
					 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
import { mapState } from 'vuex'
 | 
					import { mapState } from 'vuex'
 | 
				
			||||||
import add from './add.vue'
 | 
					 | 
				
			||||||
import detail from './detail.vue'
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
  name: 'AppWalkask',
 | 
					  name: 'AppWalkask',
 | 
				
			||||||
  appName: '走访慰问',
 | 
					  appName: '走访慰问',
 | 
				
			||||||
  components: {
 | 
					  components: {},
 | 
				
			||||||
    add,
 | 
					 | 
				
			||||||
    detail,
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  props: {},
 | 
					  props: {},
 | 
				
			||||||
  data() {
 | 
					  data() {
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
@@ -164,13 +157,13 @@ export default {
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    goDetail(item, hint) {
 | 
					    goDetail(item, hint) {
 | 
				
			||||||
      this.isList = false
 | 
					      if (hint == 1) {
 | 
				
			||||||
      if (hint == 1 || hint == 2) {
 | 
					        uni.navigateTo({ url: `./detail?id=${item.id}` })
 | 
				
			||||||
        this.comp = hint == 1 ? 'detail' : 'add'
 | 
					      }
 | 
				
			||||||
        this.params = item
 | 
					      if (hint == 2) {
 | 
				
			||||||
 | 
					        uni.navigateTo({ url: `./add?id=${item.id}` })
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        this.comp = 'add'
 | 
					        uni.navigateTo({ url: `./add` })
 | 
				
			||||||
        this.params = 111
 | 
					 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,7 +46,7 @@
 | 
				
			|||||||
      <div class="btn" @click="submit">保存</div>
 | 
					      <div class="btn" @click="submit">保存</div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <component v-else :is="comp" :paramss="params" @back="backlist"></component>
 | 
					    <component v-else :is="comp" @back="backlist"></component>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -59,9 +59,7 @@ export default {
 | 
				
			|||||||
  components: {
 | 
					  components: {
 | 
				
			||||||
    walkObject,
 | 
					    walkObject,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  props: {
 | 
					  props: {},
 | 
				
			||||||
    params: {},
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  data() {
 | 
					  data() {
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
      show: false,
 | 
					      show: false,
 | 
				
			||||||
@@ -82,10 +80,12 @@ export default {
 | 
				
			|||||||
      addList: true,
 | 
					      addList: true,
 | 
				
			||||||
      areaIdProps: '',
 | 
					      areaIdProps: '',
 | 
				
			||||||
      clickedUserSelect: false,
 | 
					      clickedUserSelect: false,
 | 
				
			||||||
 | 
					      id: '',
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  computed: { ...mapState(['user']) },
 | 
					  computed: { ...mapState(['user']) },
 | 
				
			||||||
  created() {
 | 
					  onLoad(o) {
 | 
				
			||||||
 | 
					    this.id = o.id
 | 
				
			||||||
    uni.setNavigationBarTitle({ title: '新建走访' })
 | 
					    uni.setNavigationBarTitle({ title: '新建走访' })
 | 
				
			||||||
    this.areaIdProps = this.user.areaId
 | 
					    this.areaIdProps = this.user.areaId
 | 
				
			||||||
    this.forms.areaId = this.user.areaId
 | 
					    this.forms.areaId = this.user.areaId
 | 
				
			||||||
@@ -96,10 +96,11 @@ export default {
 | 
				
			|||||||
  mounted() {},
 | 
					  mounted() {},
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
    getDetail() {
 | 
					    getDetail() {
 | 
				
			||||||
      if (this.params.id) {
 | 
					      if (this.id) {
 | 
				
			||||||
        this.$http.post(`/app/appvisitvondolence/queryDetailById?id=${this.params.id}`).then((res) => {
 | 
					        this.$http.post(`/app/appvisitvondolence/queryDetailById?id=${this.id}`).then((res) => {
 | 
				
			||||||
          if (res?.data) {
 | 
					          if (res?.data) {
 | 
				
			||||||
            this.forms = res.data
 | 
					            this.forms = res.data
 | 
				
			||||||
 | 
					            this.forms.create_user_name = res.data.name
 | 
				
			||||||
            this.forms.realityValue = res.data.reality
 | 
					            this.forms.realityValue = res.data.reality
 | 
				
			||||||
            this.forms.reality = this.$dict.getLabel('realityStatus', res.data.reality)
 | 
					            this.forms.reality = this.$dict.getLabel('realityStatus', res.data.reality)
 | 
				
			||||||
            if (res.data.images) {
 | 
					            if (res.data.images) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -44,10 +44,12 @@ export default {
 | 
				
			|||||||
  data() {
 | 
					  data() {
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
      data: {},
 | 
					      data: {},
 | 
				
			||||||
 | 
					      id: '',
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  computed: {},
 | 
					  computed: {},
 | 
				
			||||||
  onLoad() {
 | 
					  onLoad(o) {
 | 
				
			||||||
 | 
					    this.id = o.id
 | 
				
			||||||
    uni.setNavigationBarTitle({ title: '走访详情' })
 | 
					    uni.setNavigationBarTitle({ title: '走访详情' })
 | 
				
			||||||
    this.$dict.load('realityStatus').then(() => {
 | 
					    this.$dict.load('realityStatus').then(() => {
 | 
				
			||||||
      this.getDetail()
 | 
					      this.getDetail()
 | 
				
			||||||
@@ -56,7 +58,7 @@ export default {
 | 
				
			|||||||
  mounted() {},
 | 
					  mounted() {},
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
    getDetail() {
 | 
					    getDetail() {
 | 
				
			||||||
      this.$http.post(`/app/appvisitvondolence/queryDetailById?id=${this.params.id}`).then((res) => {
 | 
					      this.$http.post(`/app/appvisitvondolence/queryDetailById?id=${this.id}`).then((res) => {
 | 
				
			||||||
        if (res?.data) {
 | 
					        if (res?.data) {
 | 
				
			||||||
          this.data = res.data
 | 
					          this.data = res.data
 | 
				
			||||||
          if (this.data.images) {
 | 
					          if (this.data.images) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,7 +46,9 @@
 | 
				
			|||||||
export default {
 | 
					export default {
 | 
				
			||||||
  name: 'walkObject',
 | 
					  name: 'walkObject',
 | 
				
			||||||
  components: {},
 | 
					  components: {},
 | 
				
			||||||
  props: {},
 | 
					  props: {
 | 
				
			||||||
 | 
					    params: {},
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
  data() {
 | 
					  data() {
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
      DiyList: {},
 | 
					      DiyList: {},
 | 
				
			||||||
@@ -71,7 +73,8 @@ export default {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  computed: {},
 | 
					  computed: {},
 | 
				
			||||||
  onLoad() {
 | 
					  created() {
 | 
				
			||||||
 | 
					    console.log(1)
 | 
				
			||||||
    uni.setNavigationBarTitle({ title: '选择走访慰问对象' })
 | 
					    uni.setNavigationBarTitle({ title: '选择走访慰问对象' })
 | 
				
			||||||
    this.getDiyList()
 | 
					    this.getDiyList()
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user