setData.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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="showModal4" @chooseCon="chooseStatus" @close="showModal4 = 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. showModal4: false,
  68. siteNum:null,
  69. billCycle: '',
  70. checked: false,
  71. inputStyle: {
  72. 'text-align': 'right'
  73. },
  74. activeColor: this.$config('primaryColor'),
  75. showCheckBoxModal: false,
  76. statusList: [
  77. { id: 1, isChecked: false, name: '待提交' },
  78. { id: 1, isChecked: false, name: '待审核' },
  79. { id: 1, isChecked: false, name: '待出库' },
  80. { id: 1, isChecked: false, name: '已完结' }
  81. ],
  82. billStatus: '',
  83. originList: [{ id: 1, isChecked: false, name: '自建' }, { id: 1, isChecked: false, name: '下级创建' }, { id: 1, isChecked: false, name: '数字货架' }],
  84. customlist: [
  85. { id: 1, isChecked: false, name: '最近开单用户(月)' },
  86. { id: 1, isChecked: false, name: '最近开单用户(日)' },
  87. { id: 1, isChecked: false, name: '全部客户' }
  88. ]
  89. };
  90. },
  91. onLoad() {
  92. this.getData();
  93. },
  94. methods: {
  95. getData() {
  96. queryVerifySalesParams({}).then(res => {
  97. this.systemList = res.data;
  98. });
  99. },
  100. openModal(code,index) {
  101. const newArr = ['sales_bill_period','verify_default_customer','SALES_BILL_STATUS','SALES_SOURCE']
  102. let i = newArr.findIndex(con=>{
  103. code.remarks==con
  104. })
  105. //打开弹窗
  106. this.siteNum=index;
  107. if(i!=-1){
  108. this['showModal' + i] = true;
  109. }
  110. },
  111. changeSwitch(status, i) {
  112. //是否参与对账单 0否 1是
  113. this.systemList[i].paramValue = status ? 0 : 1;
  114. let ajaxObj = {
  115. id: this.systemList[i].id,
  116. paramValue: this.systemList[i].paramValue
  117. };
  118. this.updateList(ajaxObj);
  119. },
  120. chooseCycle(con) {
  121. this.systemList[this.siteNum].value=con.dispName;
  122. let ajaxObj = {
  123. id: this.systemList[this.siteNum].id,
  124. paramValue: con.code
  125. };
  126. this.updateList(ajaxObj);
  127. },
  128. chooseStatus(arr) {
  129. this.systemList[this.siteNum].value='已选' + arr.length + '项';
  130. let newArr =arr.map(item=>{
  131. return item.code
  132. })
  133. let ajaxObj = {
  134. id: this.systemList[this.siteNum].id,
  135. paramValue: newArr.toString()
  136. };
  137. this.updateList(ajaxObj);
  138. },
  139. updateList(ajaxdata) {//修改系统参数
  140. updateParam(ajaxdata).then(res => {
  141. if (res.status == 200) {
  142. uni.showToast({
  143. title: res.message,
  144. icon: 'success'
  145. });
  146. } else {
  147. uni.showToast({
  148. title: res.message,
  149. icon: 'none'
  150. });
  151. }
  152. });
  153. }
  154. }
  155. };
  156. </script>
  157. <style lang="scss" scoped>
  158. .content {
  159. width: 100%;
  160. height: 100vh;
  161. .tit {
  162. padding: 30rpx 20rpx 16rpx;
  163. }
  164. .con {
  165. box-sizing: border-box;
  166. width: calc(100% - 40rpx);
  167. margin: 0 auto;
  168. border-radius: 30rpx;
  169. overflow: hidden;
  170. .u-cell {
  171. padding: 14rpx 26rpx;
  172. color: #333;
  173. /deep/.u-cell_right {
  174. max-width: 40% !important;
  175. }
  176. }
  177. }
  178. }
  179. </style>