retail_list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowForm && !isShowExamine && !isShowReturn">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form ref="screenForm" :model="screenForm" label-width="100px" size="small" label-position="left">
  7. <el-row :gutter="20">
  8. <el-col :xs="24" :sm="24" :lg="24">
  9. <el-form-item prop="status" 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="policyCode">
  23. <el-input v-model="screenForm.policyCode" 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="policyRemark">
  28. <el-input v-model="screenForm.policyRemark" 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="jxsName">
  33. <el-input v-model="screenForm.jxsName" 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="date">
  38. <el-date-picker
  39. v-model="screenForm.date"
  40. type="datetimerange"
  41. range-separator="至"
  42. style="width: 100%;"
  43. value-format="yyyy-MM-dd HH:mm:ss"
  44. start-placeholder="开始日期"
  45. end-placeholder="结束日期">
  46. </el-date-picker>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :xs="24" :sm="12" :lg="6">
  50. <el-form-item label="制表人" prop="zbMan">
  51. <el-input v-model="screenForm.zbMan" placeholder="请输入制表人"></el-input>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :xs="24" :sm="12" :lg="6">
  55. <el-form-item label="审核人" prop="shMan">
  56. <el-input v-model="screenForm.shMan" placeholder="请输入审核人"></el-input>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :xs="24" :sm="12" :lg="6" class="tr">
  60. <el-form-item label="">
  61. <el-button size="small" @click="resetScreenForm">清空</el-button>
  62. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  63. </el-form-item>
  64. </el-col>
  65. </el-row>
  66. </el-form>
  67. </div>
  68. <div class="mymain-container">
  69. <div class="btn-group clearfix">
  70. <div class="fl">
  71. <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
  72. </div>
  73. <div class="fr">
  74. <ExportButton :exUrl="'retail/export'" :exParams="exParams" />
  75. </div>
  76. </div>
  77. <div class="table">
  78. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  79. <el-table-column align="center" label="订单号" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
  80. <el-table-column align="center" label="订单日期" prop="theTime" min-width="100" show-overflow-tooltip>
  81. <template slot-scope="scope">
  82. {{scope.row.theTime | dateToDayFilter}}
  83. </template>
  84. </el-table-column>
  85. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  86. <el-table-column align="center" label="货品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  87. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  88. <el-table-column align="center" label="计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  89. <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
  90. <template slot-scope="scope">
  91. {{scope.row.isDirectTransfer ? '是':'否'}}
  92. </template>
  93. </el-table-column>
  94. <el-table-column align="center" label="总数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  95. <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
  96. <el-table-column align="center" label="出库数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
  97. <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
  98. <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
  99. <el-table-column align="center" label="返利使用比例" prop="rebateRate" min-width="110" show-overflow-tooltip></el-table-column>
  100. <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip>
  101. <template slot-scope="scope">
  102. <div>{{scope.row.rebateAmount}}</div>
  103. <div>(实际:{{scope.row.payRebateAmount}})</div>
  104. </template>
  105. </el-table-column>
  106. <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
  107. <el-table-column align="center" label="制表人" prop="createName" min-width="100" show-overflow-tooltip></el-table-column>
  108. <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  109. <el-table-column align="center" label="审核人" prop="examineName" min-width="100" show-overflow-tooltip></el-table-column>
  110. <el-table-column align="center" label="审核日期" prop="examineTime" min-width="160" show-overflow-tooltip></el-table-column>
  111. <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  112. <template slot-scope="scope">
  113. {{scope.row.examineStatus | statusFilter}}
  114. </template>
  115. </el-table-column>
  116. <el-table-column align="center" label="操作" width="220" fixed="right">
  117. <template slot-scope="scope">
  118. <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
  119. <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审批</el-button>
  120. <el-button type="text" @click="toReturn(scope.row)">退订</el-button>
  121. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  122. <el-popconfirm style="margin-left: 10px;" title="确定提审吗?" @onConfirm="handleSubmit(scope.row.id)" v-if="scope.row.examineStatus === 'SAVE'" >
  123. <el-button slot="reference" type="text">提审</el-button>
  124. </el-popconfirm>
  125. <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.id)" v-if="!scope.row.closeTime" >
  126. <el-button slot="reference" type="text">关闭</el-button>
  127. </el-popconfirm>
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. </div>
  132. </div>
  133. <div class="pagination clearfix">
  134. <div class="fr">
  135. <el-pagination
  136. @size-change="handleSizeChange"
  137. @current-change="handleCurrentChange"
  138. :current-page="currentPage"
  139. :page-sizes="[10, 20, 30, 50]"
  140. :page-size="10"
  141. layout="total, sizes, prev, pager, next, jumper"
  142. :total="listTotal">
  143. </el-pagination>
  144. </div>
  145. </div>
  146. </div>
  147. <RetailDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  148. <RetailForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  149. <RetailExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  150. <RetailReturn :listItem="queryItem" v-if="isShowReturn" @backListFormDetail="backList" />
  151. </div>
  152. </template>
  153. <script>
  154. import { getList, closeData, submitData } from "@/api/supply/retail";
  155. import RetailDetail from "@/views/supply/retail/components/retail_detail";
  156. import RetailForm from "@/views/supply/retail/components/retail_form";
  157. import RetailExamine from "@/views/supply/retail/components/retail_examine";
  158. import RetailReturn from "@/views/supply/retail/components/retail_return";
  159. let that
  160. export default {
  161. components: {
  162. RetailDetail,
  163. RetailForm,
  164. RetailExamine,
  165. RetailReturn,
  166. },
  167. filters: {
  168. statusFilter(val) {
  169. let obj = that.statusList.find(o => o.value == val);
  170. return obj ? obj.label : ''
  171. }
  172. },
  173. data() {
  174. return {
  175. currentPage: 1, // 当前页码
  176. pageSize: 10, // 每页数量
  177. listTotal: 0, // 列表总数
  178. dataList: null, // 列表数据
  179. listLoading: false, // 列表加载loading
  180. screenForm: { // 筛选表单数据
  181. orderNum: '',
  182. policyCode: '',
  183. policyRemark: '',
  184. jxsName: '',
  185. date: '',
  186. zbMan: '',
  187. shMan: '',
  188. status: '',
  189. },
  190. statusList: [
  191. { label: '已保存', value: 'SAVE' },
  192. { label: '待审核', value: 'WAIT' },
  193. { label: '审核通过', value: 'OK' },
  194. { label: '审核驳回', value: 'FAIL' },
  195. ],
  196. queryItem: {},
  197. isShowDetail: false,
  198. isShowForm: false,
  199. isShowExamine: false,
  200. isShowReturn: false,
  201. }
  202. },
  203. computed: {
  204. exParams() {
  205. return {
  206. examineStatus: this.screenForm.status,
  207. id: this.screenForm.orderNum,
  208. policyCode: this.screenForm.policyCode,
  209. policyRemark: this.screenForm.policyRemark,
  210. customer: this.screenForm.jxsName,
  211. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  212. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  213. createBy: this.screenForm.zbMan,
  214. examineBy: this.screenForm.shMan,
  215. type: 1, // 1:普通零售单,2:政策零售单
  216. }
  217. },
  218. },
  219. beforeCreate() {
  220. that = this;
  221. },
  222. created() {
  223. this.getList();
  224. },
  225. methods: {
  226. // 查询按钮权限
  227. checkBtnRole(value) {
  228. // let btnRole = this.$route.meta.roles;
  229. // if(!btnRole) {return true}
  230. // let index = btnRole.indexOf(value);
  231. // return index >= 0;
  232. return true
  233. },
  234. // 查询列表
  235. getList() {
  236. this.listLoading = true;
  237. let params = {
  238. pageNum: this.currentPage,
  239. pageSize: this.pageSize,
  240. examineStatus: this.screenForm.status,
  241. id: this.screenForm.orderNum,
  242. policyCode: this.screenForm.policyCode,
  243. policyRemark: this.screenForm.policyRemark,
  244. customer: this.screenForm.jxsName,
  245. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  246. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  247. createBy: this.screenForm.zbMan,
  248. examineBy: this.screenForm.shMan,
  249. type: 1, // 1:普通零售单,2:政策零售单
  250. };
  251. getList(params).then((res) => {
  252. this.dataList = res.data.records;
  253. this.listTotal = res.data.total;
  254. this.listLoading = false;
  255. })
  256. },
  257. // 提交筛选表单
  258. submitScreenForm() {
  259. this.currentPage = 1;
  260. this.getList();
  261. },
  262. // 重置筛选表单
  263. resetScreenForm() {
  264. this.$refs.screenForm.resetFields();
  265. this.currentPage = 1;
  266. this.getList();
  267. },
  268. // 更改每页数量
  269. handleSizeChange(val) {
  270. this.pageSize = val;
  271. this.currentPage = 1;
  272. this.getList();
  273. },
  274. // 更改当前页
  275. handleCurrentChange(val) {
  276. this.currentPage = val;
  277. this.getList();
  278. },
  279. // 进入表单
  280. toForm(item) {
  281. this.queryItem = item;
  282. this.isShowForm = true;
  283. },
  284. // 进入详情
  285. toDetail(item) {
  286. this.queryItem = item;
  287. this.isShowDetail = true;
  288. },
  289. // 进入审批
  290. toExamine(item) {
  291. this.queryItem = item;
  292. this.isShowExamine = true;
  293. },
  294. // 进入退订
  295. toReturn(item) {
  296. this.queryItem = item;
  297. this.isShowReturn = true;
  298. },
  299. backList() {
  300. this.queryItem = {};
  301. this.isShowDetail = false;
  302. this.isShowForm = false;
  303. this.isShowExamine = false;
  304. this.isShowReturn = false;
  305. },
  306. // 关闭
  307. handleClose(id) {
  308. closeData({id}).then(res => {
  309. this.$successMsg();
  310. this.getList();
  311. })
  312. },
  313. // 提审
  314. handleSubmit(id) {
  315. submitData({id}).then(res => {
  316. this.$successMsg();
  317. this.getList();
  318. })
  319. },
  320. }
  321. }
  322. </script>
  323. <style lang="scss" scoped>
  324. </style>