index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <div>
  3. <basicLayout
  4. ref="list"
  5. tableName="storeList"
  6. :apiId="{query:20230408091703}"
  7. :autoQuery="false"
  8. :options="options"
  9. :isExport="false"
  10. :hideSearch="true">
  11. <template #titleRight>
  12. <el-button type="primary" size="small" @click="onExport" plain>导 出</el-button>
  13. </template>
  14. <template #custom>
  15. <el-form :inline="true" class="demo-form-inline" size="small">
  16. <!-- <el-form-item label="产品名称">
  17. <el-input v-model="itemname" placeholder="输入产品名称"></el-input>
  18. </el-form-item>-->
  19. <el-form-item label="产品信息">
  20. <el-input v-model="iteminfo" placeholder="输入产品编号/名称"></el-input>
  21. </el-form-item>
  22. <el-form-item label="营销分类">
  23. <el-cascader
  24. v-model="itemclassids"
  25. :options="classOptions"
  26. :props="{label:'itemclassname',value:'itemclassid',children:'subdep',checkStrictly: true }"
  27. clearable>
  28. </el-cascader>
  29. </el-form-item>
  30. <el-form-item label="经销商信息">
  31. <el-input v-model="agentinfo" placeholder="输入经销商信息"></el-input>
  32. </el-form-item>
  33. <el-form-item label="是否上架">
  34. <el-select class="inline-24" v-model="isonsale" placeholder="请选择是否上架" size="small" clearable>
  35. <el-option
  36. v-for="item in isOnSaleData"
  37. :key="item.value"
  38. :label="item.label"
  39. :value="item.value">
  40. </el-option>
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item>
  44. <el-button type="primary" @click="onSubmit(false)">查询</el-button>
  45. <!-- <el-button type="primary" @click="onSubmit(true)">一键查询全部</el-button> -->
  46. </el-form-item>
  47. </el-form>
  48. </template>
  49. <!-- unsoldqty 未发数量 -->
  50. <template v-slot:tbList="scope">
  51. <div v-if="scope.data.column.columnname == 'cansaleqty'">
  52. {{scope.data.column.data.invbalqty - scope.data.column.data.unsoldqtysum }}
  53. </div>
  54. <div v-if="scope.data.column.columnname == 'cansaleqty2'">
  55. {{scope.data.column.data.invbalqty - scope.data.column.data.unsoldqtysum - scope.data.column.data.undelqtysum }}
  56. </div>
  57. <!-- <div v-else-if="scope.data.column.columnname == 'itemclass'">
  58. {{scope.data.column.data.itemclass.map(e=>e.itemclassname).join(',')}}
  59. </div> -->
  60. <div v-else>
  61. {{scope.data.column.data[[scope.data.column.columnname]]}}
  62. </div>
  63. </template>
  64. <template v-slot:tbOpreation="scope">
  65. <Detail :agentinfo="agentinfo" :rowData="scope.data.data"/>
  66. </template>
  67. </basicLayout>
  68. </div>
  69. </template>
  70. <script>
  71. import Detail from './modules/detail.vue'
  72. export default {
  73. components:{Detail},
  74. data () {
  75. return {
  76. options:[],
  77. enterpriseList:'',
  78. accountType:'',
  79. sys_enterpriseid:'',
  80. accountTypeList:[],
  81. itemno:'',
  82. iteminfo:'',
  83. agentinfo:'',
  84. // 90603036
  85. itemname:'',
  86. itemclassids:[],
  87. classOptions:[],
  88. isonsale:'',
  89. isOnSaleData:[
  90. {
  91. value:1,
  92. label:'是'
  93. },
  94. {
  95. value:0,
  96. label:'否'
  97. },
  98. ],
  99. }
  100. },
  101. async created () {
  102. // this.getEnterprise()
  103. // this.getAccountType()
  104. },
  105. methods:{
  106. async classlist () {
  107. const res = await this.$api.requested({
  108. "id": "20220922110403",
  109. "content": {
  110. "sa_brandid": 0,
  111. "where": {
  112. "istool": 0
  113. }
  114. }
  115. })
  116. this.classOptions = res.data[0].ttemclass
  117. },
  118. onSubmit () {
  119. let bool = true
  120. if (this.itemname == '' && this.itemclassids.length == 0 && this.iteminfo == '' && this.agentinfo == '' && this.isonsale == '' && this.isonsale !== 0 ) {
  121. bool = true
  122. }
  123. this.$refs['list'].param.content = {
  124. "pageNumber":1,
  125. "pageSize":100,
  126. "where":{
  127. 'isonsale':this.isonsale,
  128. "iteminfo":this.iteminfo,
  129. "itemclassids":this.itemclassids.length == 0?[]:[this.itemclassids[this.itemclassids.length - 1]],
  130. "agentinfo":this.agentinfo,
  131. "all":bool,
  132. }
  133. }
  134. this.$refs['list'].listData()
  135. },
  136. async onExport(){
  137. const res = await this.$api.requested({
  138. "id":"20230408091703",
  139. "version":1,
  140. "content":{
  141. "isExport":1,
  142. "where":{
  143. "all":true,
  144. 'isonsale':this.isonsale,
  145. "iteminfo":this.iteminfo,
  146. "itemclassids":this.itemclassids.length == 0?[]:[this.itemclassids[this.itemclassids.length - 1]],
  147. "agentinfo":this.agentinfo,
  148. },
  149. }
  150. })
  151. window.open(res.data[0].url)
  152. }
  153. },
  154. mounted () {
  155. this.classlist()
  156. }
  157. }
  158. </script>
  159. <style>
  160. </style>