setData.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="content">
  3. <view class="tit">应收对账单</view>
  4. <view class="con">
  5. <u-cell-group :border="false">
  6. <u-cell-item :title="item.paramName" v-for="(item, i) in systemList" :key="item.id">
  7. <u-input
  8. v-show="item.remarks != 'FLAG'"
  9. slot="right-icon"
  10. v-model="item.value"
  11. @click="openModal(item,i)"
  12. disabled
  13. placeholder="请选择"
  14. placeholder-style="text-align:right"
  15. :custom-style="inputStyle"
  16. />
  17. <u-switch
  18. v-show="item.remarks == 'FLAG'"
  19. :size="40"
  20. :active-color="activeColor"
  21. slot="right-icon"
  22. :value="item.paramValue == 1"
  23. @change="
  24. status => {
  25. changeSwitch(status, i);
  26. }
  27. "
  28. ></u-switch>
  29. </u-cell-item>
  30. <!-- <u-cell-item title="参与对账的销售单业务状态">
  31. <u-input slot="right-icon" v-model="billStatus" @click="showCheckBoxModal=true" disabled placeholder="请选择参与对账的销售单业务状态" placeholder-style="text-align:right" :custom-style="inputStyle"/>
  32. </u-cell-item>
  33. <u-cell-item title="参与对账的销售单来源">
  34. <u-input slot="right-icon" v-model="billCycle" @click="showModal=true" disabled placeholder="请选择参与对账的销售单来源" placeholder-style="text-align:right" :custom-style="inputStyle"/>
  35. </u-cell-item>
  36. <u-cell-item title="铺货销售单是否参与对账">
  37. <u-switch :size="40" :active-color="activeColor" slot="right-icon" v-model="checked"></u-switch>
  38. </u-cell-item>
  39. <u-cell-item title="对账单选择客户默认页签" :border-bottom="false">
  40. <u-input slot="right-icon" v-model="billCycle" @click="showModal=true" disabled placeholder="请选择对账单客户" placeholder-style="text-align:right" :custom-style="inputStyle"/>
  41. </u-cell-item> -->
  42. </u-cell-group>
  43. </view>
  44. <!-- 类似于picker单选 -->
  45. <redioPicker :showModal="showModal0" @chooseItem="chooseCycle" @close="showModal0 = false" code="sales_bill_period"></redioPicker>
  46. <!-- 类似于picker多选 -->
  47. <checkBoxPicker :showModal="showModal1" @chooseCon="chooseStatus" @close="showModal1 = false" code="SALES_BILL_STATUS"></checkBoxPicker>
  48. <checkBoxPicker :showModal="showModal2" @chooseCon="chooseStatus" @close="showModal2 = false" code="SALES_SOURCE"></checkBoxPicker>
  49. <checkBoxPicker :showModal="showModal3" @chooseCon="chooseStatus" @close="showModal3 = false" code="verify_default_customer"></checkBoxPicker>
  50. </view>
  51. </template>
  52. <script>
  53. import redioPicker from '@/components/customPicker/redioPicker.vue';
  54. import checkBoxPicker from '@/components/customPicker/checkBoxPicker.vue';
  55. import { queryVerifySalesParams, updateParam } from '@/api/dealerBizParam.js';
  56. export default {
  57. components: {
  58. redioPicker,
  59. checkBoxPicker
  60. },
  61. data() {
  62. return {
  63. systemList: null,
  64. showModal0: false,
  65. showModal1: false,
  66. showModal2: false,
  67. showModal3: false,
  68. siteNum:null,
  69. inputStyle: {
  70. 'text-align': 'right'
  71. },
  72. activeColor: this.$config('primaryColor')
  73. };
  74. },
  75. onLoad() {
  76. this.getData();
  77. },
  78. methods: {
  79. getData() {
  80. queryVerifySalesParams({}).then(res => {
  81. this.systemList = res.data;
  82. });
  83. },
  84. openModal(code,index) {
  85. const newArr = ['sales_bill_period','verify_default_customer','SALES_BILL_STATUS','SALES_SOURCE']
  86. let i = newArr.findIndex(con=>{
  87. code.remarks==con
  88. })
  89. //打开弹窗
  90. this.siteNum=index;
  91. if(i!=-1){
  92. this['showModal' + i] = true;
  93. }
  94. },
  95. changeSwitch(status, i) {
  96. //是否参与对账单 0否 1是
  97. this.systemList[i].paramValue = status ? 0 : 1;
  98. let ajaxObj = {
  99. id: this.systemList[i].id,
  100. paramValue: this.systemList[i].paramValue
  101. };
  102. this.updateList(ajaxObj);
  103. },
  104. chooseCycle(con) {
  105. this.systemList[this.siteNum].value=con.dispName;
  106. let ajaxObj = {
  107. id: this.systemList[this.siteNum].id,
  108. paramValue: con.code
  109. };
  110. this.updateList(ajaxObj);
  111. },
  112. chooseStatus(arr) {
  113. this.systemList[this.siteNum].value='已选' + arr.length + '项';
  114. let newArr =arr.map(item=>{
  115. return item.code
  116. })
  117. let ajaxObj = {
  118. id: this.systemList[this.siteNum].id,
  119. paramValue: newArr.toString()
  120. };
  121. this.updateList(ajaxObj);
  122. },
  123. updateList(ajaxdata) {//修改系统参数
  124. updateParam(ajaxdata).then(res => {
  125. if (res.status == 200) {
  126. uni.showToast({
  127. title: res.message,
  128. icon: 'success'
  129. });
  130. } else {
  131. uni.showToast({
  132. title: res.message,
  133. icon: 'none'
  134. });
  135. }
  136. });
  137. }
  138. }
  139. };
  140. </script>
  141. <style lang="scss" scoped>
  142. .content {
  143. width: 100%;
  144. height: 100vh;
  145. .tit {
  146. padding: 30rpx 20rpx 16rpx;
  147. }
  148. .con {
  149. box-sizing: border-box;
  150. width: calc(100% - 40rpx);
  151. margin: 0 auto;
  152. border-radius: 30rpx;
  153. overflow: hidden;
  154. .u-cell {
  155. padding: 14rpx 26rpx;
  156. color: #333;
  157. /deep/.u-cell_right {
  158. max-width: 40% !important;
  159. }
  160. }
  161. }
  162. }
  163. </style>