sum_list.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowPrint">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form ref="screenForm" :model="screenForm" label-width="85px" size="mini" label-position="left">
  7. <el-row :gutter="20">
  8. <el-col :xs="24" :sm="12" :lg="6">
  9. <el-form-item label="产品名称" prop="goodsName">
  10. <el-input v-model="screenForm.goodsName" placeholder="请输入产品名称"></el-input>
  11. </el-form-item>
  12. </el-col>
  13. <el-col :xs="24" :sm="12" :lg="6">
  14. <el-form-item label="物料编码" prop="goodsCode">
  15. <el-input v-model="screenForm.goodsCode" placeholder="请输入物料编码"></el-input>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :xs="24" :sm="12" :lg="6">
  19. <el-form-item label="产品编码" prop="goodsOldCode">
  20. <el-input v-model="screenForm.goodsOldCode" placeholder="请输入产品编码"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :xs="24" :sm="12" :lg="6">
  24. <el-form-item label="规格型号" prop="model">
  25. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :xs="24" :sm="12" :lg="6">
  29. <el-form-item label="制单日期" prop="createDate">
  30. <el-date-picker
  31. v-model="screenForm.createDate"
  32. type="datetimerange"
  33. range-separator="至"
  34. style="width: 100%;"
  35. value-format="yyyy-MM-dd HH:mm:ss"
  36. start-placeholder="开始日期"
  37. end-placeholder="结束日期">
  38. </el-date-picker>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :xs="24" :sm="12" :lg="6">
  42. <el-form-item label="发货日期" prop="deliverDate">
  43. <el-date-picker
  44. v-model="screenForm.deliverDate"
  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="6">
  55. <el-form-item label="经销商编号" prop="jxsNum">
  56. <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编号"></el-input>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :xs="24" :sm="12" :lg="6">
  60. <el-form-item label="经销商名称" prop="jxsName">
  61. <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :xs="24" :sm="12" :lg="6">
  65. <el-form-item label="发货单号" prop="orderNum">
  66. <el-input v-model="screenForm.orderNum" placeholder="请输入发货单号"></el-input>
  67. </el-form-item>
  68. </el-col>
  69. <el-col :xs="24" :sm="12" :lg="6">
  70. <el-form-item label="订单" prop="mainOrderId">
  71. <el-input v-model="screenForm.mainOrderId" placeholder="请输入订单"></el-input>
  72. </el-form-item>
  73. </el-col>
  74. <el-col :xs="24" :sm="12" :lg="6">
  75. <el-form-item label="存货类别" prop="type">
  76. <el-select v-model="screenForm.type" placeholder="选择存货类别" style="width: 100%" clearable>
  77. <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.name"></el-option>
  78. </el-select>
  79. </el-form-item>
  80. </el-col>
  81. <el-col :xs="24" :sm="12" :lg="6">
  82. <el-form-item label="业务员" prop="salesMan">
  83. <el-select v-model="screenForm.salesMan" placeholder="选择业务员" clearable filterable style="width: 100%">
  84. <el-option
  85. v-for="item in salesmanList"
  86. :key="item.adminUserId"
  87. :label="item.nickName"
  88. :value="item.adminUserId">
  89. </el-option>
  90. </el-select>
  91. </el-form-item>
  92. </el-col>
  93. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  94. <el-form-item label="">
  95. <el-button @click="resetScreenForm">清空</el-button>
  96. <el-button type="primary" @click="submitScreenForm">搜索</el-button>
  97. </el-form-item>
  98. </el-col>
  99. </el-row>
  100. </el-form>
  101. </div>
  102. <div class="mymain-container">
  103. <div class="btn-group clearfix">
  104. <div class="fl">
  105. <el-button type="primary" size="mini" @click="toPrint" :disabled="tableSelection.length < 1">打印发货单</el-button>
  106. </div>
  107. <!-- -->
  108. <div class="fr" style="display: flex;">
  109. <el-button size="mini" type="primary" v-if="$checkBtnRole('refund', $route.meta.roles)" style="margin-right: 10px;" icon="el-icon-plus" @click="$router.push('/supply/deliver/apply_list?isShow=true')">零售退货申请</el-button>
  110. <el-button size="mini" type="primary" v-if="$checkBtnRole('refund', $route.meta.roles)" style="margin-right: 10px;" icon="el-icon-plus" @click="$router.push('/supply/deliver/engin_list?isShow=true')">工程退货申请</el-button>
  111. <ExportButton :exUrl="'invoice/exportInvoice'" :exParams="exParams" />
  112. </div>
  113. </div>
  114. <div class="table">
  115. <el-table
  116. ref="table"
  117. v-loading="listLoading"
  118. :data="dataList"
  119. element-loading-text="Loading"
  120. border
  121. fit
  122. highlight-current-row
  123. stripe
  124. @select="handleSelect"
  125. @select-all="handleSelectAll"
  126. show-summary
  127. :summary-method="$getSummaries">
  128. <el-table-column align="center" type="selection" width="55"></el-table-column>
  129. <el-table-column align="left" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  130. <el-table-column align="left" label="发货日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
  131. <el-table-column align="left" label="发货单号" prop="id" min-width="130" show-overflow-tooltip>
  132. <template slot-scope="scope">
  133. <CopyButton :copyText="scope.row.id" />
  134. <span>{{scope.row.id}}</span>
  135. </template>
  136. </el-table-column>
  137. <el-table-column align="left" label="订单号" prop="orderId" min-width="130" show-overflow-tooltip>
  138. <template slot-scope="scope">
  139. <<<<<<< Updated upstream
  140. <CopyButton :copyText="scope.row.enginOrderType =='HOME' || scope.row.enginOrderType =='TRADE'? scope.row.enginOrderNo :scope.row.mainOrderId " />
  141. <span>{{scope.row.enginOrderType =='HOME' || scope.row.enginOrderType =='TRADE'? scope.row.enginOrderNo :scope.row.mainOrderId }}</span>
  142. =======
  143. <CopyButton :copyText="scope.row.enginOrderType =='HOME' || scope.row.enginOrderType =='TRADE'? scope.row.enginOrderNo :scope.row.mainOrderId" />
  144. <span>{{scope.row.enginOrderType =='HOME' || scope.row.enginOrderType =='TRADE'? scope.row.enginOrderNo :scope.row.mainOrderId}}</span>
  145. >>>>>>> Stashed changes
  146. </template>
  147. </el-table-column>
  148. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
  149. <template slot-scope="scope">
  150. <CopyButton :copyText="scope.row.customerNumber" />
  151. <span>{{scope.row.customerNumber}}</span>
  152. </template>
  153. </el-table-column>
  154. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  155. <template slot-scope="scope">
  156. <CopyButton :copyText="scope.row.customerName" />
  157. <span>{{scope.row.customerName}}</span>
  158. </template>
  159. </el-table-column>
  160. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  161. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  162. <template slot-scope="scope">
  163. <CopyButton :copyText="scope.row.materialCode" />
  164. <span>{{scope.row.materialCode}}</span>
  165. </template>
  166. </el-table-column>
  167. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  168. <template slot-scope="scope">
  169. <CopyButton :copyText="scope.row.materialOldNumber" />
  170. <span>{{scope.row.materialOldNumber}}</span>
  171. </template>
  172. </el-table-column>
  173. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  174. <template slot-scope="scope">
  175. <CopyButton :copyText="scope.row.materialName" />
  176. <span>{{scope.row.materialName}}</span>
  177. </template>
  178. </el-table-column>
  179. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  180. <template slot-scope="scope">
  181. <CopyButton :copyText="scope.row.specification" />
  182. <span>{{scope.row.specification}}</span>
  183. </template>
  184. </el-table-column>
  185. <el-table-column align="left" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
  186. <el-table-column align="right" label="发货金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  187. <template slot-scope="scope">
  188. {{scope.row.payAmount | numToFixed}}
  189. </template>
  190. </el-table-column>
  191. <el-table-column align="right" label="发货返利金额" prop="payRebateAmount" min-width="110" show-overflow-tooltip>
  192. <template slot-scope="scope">
  193. {{scope.row.payRebateAmount | numToFixed}}
  194. </template>
  195. </el-table-column>
  196. <el-table-column align="right" label="发货折扣金额" prop="discAmount" min-width="110" show-overflow-tooltip>
  197. <template slot-scope="scope">
  198. {{scope.row.totalDiscAmount | numToFixed}}
  199. </template>
  200. </el-table-column>
  201. <el-table-column align="right" label="折扣额合计" prop="totalDiscAmount" min-width="100" show-overflow-tooltip>
  202. <template slot-scope="scope">
  203. {{(scope.row.totalDiscAmount + scope.row.payRebateAmount) | numToFixed}}
  204. </template>
  205. </el-table-column>
  206. <el-table-column align="right" label="含税单价" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
  207. <template slot-scope="scope">
  208. {{scope.row.singlePayPrice | numToFixed}}
  209. </template>
  210. </el-table-column>
  211. <el-table-column align="right" label="含税总额" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
  212. <template slot-scope="scope">
  213. {{scope.row.payAmount | numToFixed}}
  214. </template>
  215. </el-table-column>
  216. <el-table-column align="right" label="未出库数量" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
  217. <template slot-scope="scope">
  218. {{comRefundableQty(scope.row.type ,scope.row.salesExamineStatus , scope.row)}}
  219. </template>
  220. </el-table-column>
  221. <el-table-column align="right" label="发货数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  222. <el-table-column align="left" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
  223. <el-table-column align="left" label="政策单号" prop="policyCode" min-width="100" show-overflow-tooltip></el-table-column>
  224. <el-table-column align="left" label="政策名称" prop="policyTitle" min-width="100" show-overflow-tooltip></el-table-column>
  225. <el-table-column align="left" label="区域" prop="adminArea" min-width="100" show-overflow-tooltip></el-table-column>
  226. <el-table-column align="left" label="业务区域" prop="serviceArea" min-width="100" show-overflow-tooltip></el-table-column>
  227. <el-table-column align="left" label="月份" prop="month" min-width="100" show-overflow-tooltip></el-table-column>
  228. <el-table-column align="left" label="项目编码" prop="refEnginRecordNo" min-width="160" show-overflow-tooltip></el-table-column>
  229. <el-table-column align="left" label="项目名称" prop="refProjectName" min-width="160" show-overflow-tooltip></el-table-column>
  230. <el-table-column align="left" label="表头备注" prop="remark" min-width="200" show-overflow-tooltip></el-table-column>
  231. <el-table-column align="left" label="备注" prop="invoiceRemark" min-width="200" show-overflow-tooltip></el-table-column>
  232. <el-table-column align="left" label="打印次数" prop="printNum" min-width="200" show-overflow-tooltip></el-table-column>
  233. </el-table>
  234. </div>
  235. </div>
  236. <div class="pagination clearfix">
  237. <div class="fr">
  238. <el-pagination
  239. @size-change="handleSizeChange"
  240. @current-change="handleCurrentChange"
  241. :current-page="currentPage"
  242. :page-sizes="[10, 20, 30, 50]"
  243. :page-size="10"
  244. layout="total, sizes, prev, pager, next, jumper"
  245. :total="listTotal">
  246. </el-pagination>
  247. </div>
  248. </div>
  249. </div>
  250. <SumPrint :listItem="queryItem" v-if="isShowPrint" @backListFormDetail="backList" />
  251. </div>
  252. </template>
  253. <script>
  254. import { getSumList } from '@/api/supply/deliver'
  255. import { getCategoryList, getSalesmanList } from '@/api/common'
  256. import SumPrint from '@/views/supply/deliver/components/sum_print'
  257. export default {
  258. components: {
  259. SumPrint,
  260. },
  261. data() {
  262. return {
  263. currentPage: 1, // 当前页码
  264. pageSize: 10, // 每页数量
  265. listTotal: 0, // 列表总数
  266. dataList: null, // 列表数据
  267. listLoading: false, // 列表加载loading
  268. screenForm: { // 筛选表单数据
  269. goodsName: '',
  270. goodsCode: '',
  271. goodsOldCode: '',
  272. model: '',
  273. createDate: '',
  274. deliverDate: '',
  275. jxsNum: '',
  276. jxsName: '',
  277. orderNum: '',
  278. type: '',
  279. salesMan: '',
  280. mainOrderId:''
  281. },
  282. categoryList: [],
  283. salesmanList: [],
  284. tableSelection: [],
  285. queryItem: {},
  286. isShowPrint: false,
  287. }
  288. },
  289. computed: {
  290. exParams() {
  291. return {
  292. materialName: this.screenForm.goodsName,
  293. materialNumber: this.screenForm.goodsCode,
  294. materialOldNumber: this.screenForm.goodsOldCode,
  295. specification: this.screenForm.model,
  296. createStartTime: this.screenForm.createDate ? this.screenForm.createDate[0] : '',
  297. createEndTime: this.screenForm.createDate ? this.screenForm.createDate[1] : '',
  298. startTime: this.screenForm.deliverDate ? this.screenForm.deliverDate[0] : '',
  299. endTime: this.screenForm.deliverDate ? this.screenForm.deliverDate[1] : '',
  300. customerNumber: this.screenForm.jxsNum,
  301. customerName: this.screenForm.jxsName,
  302. id: this.screenForm.orderNum,
  303. categoryName: this.screenForm.type,
  304. serviceId: this.screenForm.salesMan,
  305. }
  306. },
  307. comRefundableQty(){
  308. return (type,status,row)=>{
  309. if (type == 2) {
  310. return ''
  311. }else{
  312. if (status == 'OK') {
  313. return 0
  314. }else{
  315. return row.refundableQty
  316. }
  317. }
  318. }
  319. }
  320. },
  321. created() {
  322. this.getSalesmanList();
  323. this.getCategoryList();
  324. this.getList();
  325. },
  326. methods: {
  327. // 获取业务员列表
  328. getSalesmanList() {
  329. getSalesmanList({
  330. pageNum: 1,
  331. pageSize: -1,
  332. isCustomer: 0,
  333. status: true,
  334. }).then(res => {
  335. this.salesmanList = res.data.records;
  336. })
  337. },
  338. // 获取存货类别列表
  339. getCategoryList() {
  340. getCategoryList({
  341. pageNum: 1,
  342. pageSize: -1,
  343. }).then(res => {
  344. this.categoryList = res.data.records;
  345. })
  346. },
  347. // 查询列表
  348. getList() {
  349. this.listLoading = true;
  350. let params = {
  351. pageNum: this.currentPage,
  352. pageSize: this.pageSize,
  353. materialName: this.screenForm.goodsName,
  354. materialNumber: this.screenForm.goodsCode,
  355. materialOldNumber: this.screenForm.goodsOldCode,
  356. specification: this.screenForm.model,
  357. createStartTime: this.screenForm.createDate ? this.screenForm.createDate[0] : '',
  358. createEndTime: this.screenForm.createDate ? this.screenForm.createDate[1] : '',
  359. startTime: this.screenForm.deliverDate ? this.screenForm.deliverDate[0] : '',
  360. endTime: this.screenForm.deliverDate ? this.screenForm.deliverDate[1] : '',
  361. customerNumber: this.screenForm.jxsNum,
  362. customerName: this.screenForm.jxsName,
  363. id: this.screenForm.orderNum,
  364. categoryName: this.screenForm.type,
  365. serviceId: this.screenForm.salesMan,
  366. mainOrderId:this.screenForm.mainOrderId
  367. };
  368. getSumList(params).then((res) => {
  369. res.data.records.forEach(item => {
  370. item.notOutNumber = item.salesStatus ? 0 : item.refundableQty;
  371. item.sums1 = ['refundableQty'];
  372. item.sums2 = ['payAmount', 'payRebateAmount', 'discAmount', 'totalDiscAmount'];
  373. })
  374. this.dataList = res.data.records;
  375. this.listTotal = res.data.total;
  376. this.listLoading = false;
  377. })
  378. },
  379. // 提交筛选表单
  380. submitScreenForm() {
  381. this.currentPage = 1;
  382. this.getList();
  383. },
  384. // 重置筛选表单
  385. resetScreenForm() {
  386. this.$refs.screenForm.resetFields();
  387. this.currentPage = 1;
  388. this.getList();
  389. },
  390. // 更改每页数量
  391. handleSizeChange(val) {
  392. this.pageSize = val;
  393. this.currentPage = 1;
  394. this.getList();
  395. },
  396. // 更改当前页
  397. handleCurrentChange(val) {
  398. this.currentPage = val;
  399. this.getList();
  400. },
  401. handleSelect(selection, row) {
  402. this.$refs.table.toggleRowSelection(row);
  403. this.dataList.forEach((item) => {
  404. if (item.id === row.id) {
  405. this.$refs.table.toggleRowSelection(item);
  406. }
  407. });
  408. this.tableSelection = this.$refs.table.selection;
  409. },
  410. handleSelectAll(selection) {
  411. this.tableSelection = this.$refs.table.selection;
  412. },
  413. // 点击打印
  414. toPrint() {
  415. this.queryItem = this.tableSelection;
  416. this.isShowPrint = true;
  417. },
  418. backList() {
  419. this.queryItem = {};
  420. this.isShowPrint = false;
  421. },
  422. }
  423. }
  424. </script>
  425. <style lang="scss" scoped>
  426. </style>