sales_list.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowExamine">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form ref="screenForm" :model="screenForm" label-width="90px" size="small" label-position="left">
  7. <el-row :gutter="20">
  8. <el-col :xs="24" :sm="24" :lg="24">
  9. <el-form-item prop="orderNum" label-width="0">
  10. <el-radio-group v-model="screenForm.status" size="medium" @change="getList()">
  11. <el-radio-button label="">全部</el-radio-button>
  12. <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
  13. </el-radio-group>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :xs="24" :sm="12" :lg="6">
  17. <el-form-item label="发货单号" prop="orderNum">
  18. <el-input v-model="screenForm.orderNum" placeholder="请输入发货单号"></el-input>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :xs="24" :sm="12" :lg="6">
  22. <el-form-item label="经销商名称" prop="jxsName">
  23. <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
  24. </el-form-item>
  25. </el-col>
  26. <el-col :xs="24" :sm="12" :lg="6">
  27. <el-form-item label="经销商编号" prop="jxsNum">
  28. <el-input v-model="screenForm.jxsNum" placeholder="请输入规格型号"></el-input>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :xs="24" :sm="12" :lg="6">
  32. <el-form-item label="存货名称" prop="chName">
  33. <el-input v-model="screenForm.chName" placeholder="请输入存货名称"></el-input>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :xs="24" :sm="12" :lg="6">
  37. <el-form-item label="规格型号" prop="model">
  38. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :xs="24" :sm="12" :lg="6">
  42. <el-form-item label="发货日期" prop="date">
  43. <el-date-picker
  44. v-model="screenForm.date"
  45. type="datetimerange"
  46. range-separator="至"
  47. style="width: 100%;"
  48. value-format="yyyy-MM-dd HH:mm:ss"
  49. start-placeholder="开始日期"
  50. end-placeholder="结束日期">
  51. </el-date-picker>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :xs="24" :sm="12" :lg="12" class="tr">
  55. <el-form-item label="">
  56. <el-button size="small" @click="resetScreenForm">清空</el-button>
  57. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  58. </el-form-item>
  59. </el-col>
  60. </el-row>
  61. </el-form>
  62. </div>
  63. <div class="mymain-container">
  64. <div class="btn-group clearfix">
  65. <div class="fl">
  66. <!-- <el-button size="small" type="warning" icon="el-icon-close">退单</el-button> -->
  67. </div>
  68. <div class="fr">
  69. <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
  70. </div>
  71. </div>
  72. <div class="table">
  73. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  74. <el-table-column align="center" label="状态" prop="status" min-width="100" show-overflow-tooltip>
  75. <template slot-scope="scope">
  76. {{scope.row.status | statusFilter}}
  77. </template>
  78. </el-table-column>
  79. <el-table-column align="center" label="开票状态" prop="billStatus" min-width="100" show-overflow-tooltip>
  80. <template slot-scope="scope">
  81. {{scope.row.billStatus | billStatusFilter}}
  82. </template>
  83. </el-table-column>
  84. <el-table-column align="center" label="出库单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></el-table-column>
  85. <el-table-column align="center" label="发货单号" prop="orderNo" min-width="180" show-overflow-tooltip></el-table-column>
  86. <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
  87. <el-table-column align="center" label="经销商" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  88. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  89. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  90. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  91. <el-table-column align="center" label="数量" prop="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
  92. <el-table-column align="center" label="单价" prop="price" min-width="160" show-overflow-tooltip></el-table-column>
  93. <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="160" show-overflow-tooltip></el-table-column>
  94. <el-table-column align="center" label="备注" prop="remark" min-width="200" show-overflow-tooltip></el-table-column>
  95. <el-table-column align="center" label="操作" width="120" fixed="right">
  96. <template slot-scope="scope">
  97. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  98. <el-button type="text" @click="toExamine(scope.row)">审批</el-button>
  99. </template>
  100. </el-table-column>
  101. </el-table>
  102. </div>
  103. </div>
  104. <div class="pagination clearfix">
  105. <div class="fr">
  106. <el-pagination
  107. @size-change="handleSizeChange"
  108. @current-change="handleCurrentChange"
  109. :current-page="currentPage"
  110. :page-sizes="[10, 20, 30, 50]"
  111. :page-size="10"
  112. layout="total, sizes, prev, pager, next, jumper"
  113. :total="listTotal">
  114. </el-pagination>
  115. </div>
  116. </div>
  117. </div>
  118. <SalesDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  119. <SalesExamine :listItem="queryItem" v-if="isShowExamine" @backListFormExamine="backList" />
  120. </div>
  121. </template>
  122. <script>
  123. import { getList } from "@/api/supply/sales";
  124. import SalesDetail from "@/views/supply/sales/components/sales_detail";
  125. import SalesExamine from "@/views/supply/sales/components/sales_examine";
  126. let that
  127. export default {
  128. components: {
  129. SalesDetail,
  130. SalesExamine,
  131. },
  132. filters: {
  133. statusFilter(val) {
  134. let obj = that.statusList.find(o => o.value == val);
  135. return obj ? obj.label : ''
  136. },
  137. billStatusFilter(val) {
  138. const MAP = {
  139. 1: '已开票',
  140. 0: '未开票',
  141. }
  142. return MAP[val];
  143. }
  144. },
  145. data() {
  146. return {
  147. currentPage: 1, // 当前页码
  148. pageSize: 10, // 每页数量
  149. listTotal: 0, // 列表总数
  150. dataList: null, // 列表数据
  151. listLoading: false, // 列表加载loading
  152. screenForm: { // 筛选表单数据
  153. orderNum: '',
  154. jxsName: '',
  155. jxsNum: '',
  156. chName: '',
  157. model: '',
  158. date: '',
  159. status: '',
  160. },
  161. statusList: [
  162. { label: '待审核', value: 1 },
  163. { label: '审核通过', value: 2 },
  164. { label: '审核驳回', value: 3 },
  165. ],
  166. queryItem: {},
  167. isShowDetail: false,
  168. isShowExamine: false,
  169. }
  170. },
  171. computed: {
  172. exParams() {
  173. return {
  174. status: this.screenForm.status,
  175. orderNo: this.screenForm.orderNum,
  176. customerName: this.screenForm.jxsName,
  177. customerNumber: this.screenForm.jxsNum,
  178. materialName: this.screenForm.chName,
  179. specification: this.screenForm.model,
  180. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  181. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  182. }
  183. },
  184. },
  185. beforeCreate() {
  186. that = this;
  187. },
  188. created() {
  189. this.getList();
  190. },
  191. methods: {
  192. // 查询按钮权限
  193. checkBtnRole(value) {
  194. // let btnRole = this.$route.meta.roles;
  195. // if(!btnRole) {return true}
  196. // let index = btnRole.indexOf(value);
  197. // return index >= 0;
  198. return true
  199. },
  200. // 查询列表
  201. getList() {
  202. this.listLoading = true;
  203. let params = {
  204. pageNum: this.currentPage,
  205. pageSize: this.pageSize,
  206. status: this.screenForm.status,
  207. orderNo: this.screenForm.orderNum,
  208. customerName: this.screenForm.jxsName,
  209. customerNumber: this.screenForm.jxsNum,
  210. materialName: this.screenForm.chName,
  211. specification: this.screenForm.model,
  212. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  213. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  214. };
  215. getList(params).then((res) => {
  216. this.dataList = res.data.records;
  217. this.listTotal = res.data.total;
  218. this.listLoading = false;
  219. })
  220. },
  221. // 提交筛选表单
  222. submitScreenForm() {
  223. this.currentPage = 1;
  224. this.getList();
  225. },
  226. // 重置筛选表单
  227. resetScreenForm() {
  228. this.$refs.screenForm.resetFields();
  229. this.currentPage = 1;
  230. this.getList();
  231. },
  232. // 更改每页数量
  233. handleSizeChange(val) {
  234. this.pageSize = val;
  235. this.currentPage = 1;
  236. this.getList();
  237. },
  238. // 更改当前页
  239. handleCurrentChange(val) {
  240. this.currentPage = val;
  241. this.getList();
  242. },
  243. // 进入详情
  244. toDetail(item) {
  245. this.queryItem = item;
  246. this.isShowDetail = true;
  247. },
  248. // 进入审批
  249. toExamine(item) {
  250. this.queryItem = item;
  251. this.isShowExamine = true;
  252. },
  253. backList() {
  254. this.queryItem = {};
  255. this.isShowDetail = false;
  256. this.isShowExamine = false;
  257. },
  258. }
  259. }
  260. </script>
  261. <style lang="scss" scoped>
  262. </style>