setData.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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" @click="openModal(item,i)">
  7. <u-input
  8. v-show="item.remarks != 'FLAG'"
  9. slot="right-icon"
  10. v-model="item.value"
  11. disabled
  12. @click="openModal(item,i)"
  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" :val="val0" code="sales_bill_period"></redioPicker>
  46. <!-- 类似于picker多选 -->
  47. <checkBoxPicker :showModal="showModal1" @chooseCon="chooseStatus" @close="showModal1 = false" :val="val1" :filtrate="true" code="SALES_BILL_STATUS"></checkBoxPicker>
  48. <checkBoxPicker :showModal="showModal2" @chooseCon="chooseStatus" @close="showModal2 = false" :val="val2" code="SALES_SOURCE"></checkBoxPicker>
  49. <redioPicker :showModal="showModal3" @chooseItem="chooseCycle" @close="showModal3 = false" :val="val3" code="verify_default_customer"></redioPicker>
  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. val0:undefined,
  70. val1:undefined,
  71. val2:undefined,
  72. val3:undefined,
  73. inputStyle: {
  74. 'text-align': 'right'
  75. },
  76. activeColor: this.$config('primaryColor')
  77. };
  78. },
  79. onLoad() {
  80. this.getData();
  81. },
  82. methods: {
  83. getData() {
  84. queryVerifySalesParams({}).then(res => {
  85. res.data.forEach(item=>{
  86. if(item.valueShow && item.valueShow.indexOf(",")!=-1){
  87. let arr = item.valueShow.split(',');
  88. item.value = '已选' + arr.length + '项'
  89. }else{
  90. item.value = item.valueShow
  91. }
  92. })
  93. this.systemList = res.data;
  94. });
  95. },
  96. openModal(code,index) {
  97. const newArr = ['sales_bill_period','SALES_BILL_STATUS','SALES_SOURCE','verify_default_customer']
  98. newArr.forEach((con,i)=>{
  99. if(code.remarks==con){
  100. this['showModal' + i] = true;
  101. this['val' + i] = code.paramValue;
  102. }
  103. })
  104. //打开弹窗
  105. this.siteNum=index;
  106. },
  107. changeSwitch(status, i) {
  108. //是否参与对账单 0否 1是
  109. this.systemList[i].paramValue = status ? 0 : 1;
  110. let ajaxObj = {
  111. id: this.systemList[i].id,
  112. paramValue: this.systemList[i].paramValue
  113. };
  114. this.updateList(ajaxObj);
  115. },
  116. chooseCycle(con) {
  117. this.systemList[this.siteNum].value=con.dispName;
  118. let ajaxObj = {
  119. id: this.systemList[this.siteNum].id,
  120. paramValue: con.code
  121. };
  122. this.updateList(ajaxObj);
  123. },
  124. chooseStatus(arr) {
  125. this.systemList[this.siteNum].value='已选' + arr.length + '项';
  126. let newArr =arr.map(item=>{
  127. return item.code
  128. })
  129. let ajaxObj = {
  130. id: this.systemList[this.siteNum].id,
  131. paramValue: newArr.toString()
  132. };
  133. this.updateList(ajaxObj);
  134. },
  135. updateList(ajaxdata) {//修改系统参数
  136. updateParam(ajaxdata).then(res => {
  137. if (res.status == 200) {
  138. uni.showToast({
  139. title: res.message,
  140. icon: 'success'
  141. });
  142. this.getData();
  143. } else {
  144. uni.showToast({
  145. title: res.message,
  146. icon: 'none'
  147. });
  148. }
  149. });
  150. }
  151. }
  152. };
  153. </script>
  154. <style lang="scss" scoped>
  155. .content {
  156. width: 100%;
  157. height: 100vh;
  158. .tit {
  159. padding: 30rpx 20rpx 16rpx;
  160. }
  161. .con {
  162. box-sizing: border-box;
  163. width: calc(100% - 40rpx);
  164. margin: 0 auto;
  165. border-radius: 30rpx;
  166. overflow: hidden;
  167. .u-cell {
  168. padding: 14rpx 26rpx;
  169. color: #333;
  170. /deep/.u-cell_right {
  171. max-width: 40% !important;
  172. }
  173. }
  174. }
  175. }
  176. </style>