nsales_list.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowExamine && !isShowReturnForm">
  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="24" :lg="24">
  9. <el-form-item prop="orderNum" label-width="0">
  10. <el-radio-group v-model="screenForm.status" @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="mainOrderId">
  23. <el-input v-model="screenForm.mainOrderId" 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="jxsName">
  28. <el-input v-model="screenForm.jxsName" 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="jxsNum">
  33. <el-input v-model="screenForm.jxsNum" 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="chName">
  38. <el-input v-model="screenForm.chName" 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="chNum">
  43. <el-input v-model="screenForm.chNum" placeholder="请输入产品编码"></el-input>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :xs="24" :sm="12" :lg="6">
  47. <el-form-item label="规格型号" prop="model">
  48. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  49. </el-form-item>
  50. </el-col>
  51. <el-col :xs="24" :sm="12" :lg="6">
  52. <el-form-item label="仓库名称" prop="warehouse">
  53. <el-input v-model="screenForm.warehouse" placeholder="请输入仓库名称"></el-input>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :xs="24" :sm="12" :lg="6">
  57. <el-form-item label="发货日期" prop="date">
  58. <el-date-picker
  59. v-model="screenForm.date"
  60. type="datetimerange"
  61. range-separator="至"
  62. style="width: 100%;"
  63. value-format="yyyy-MM-dd HH:mm:ss"
  64. start-placeholder="开始日期"
  65. end-placeholder="结束日期">
  66. </el-date-picker>
  67. </el-form-item>
  68. </el-col>
  69. <el-col :xs="24" :sm="12" :lg="18" class="tr">
  70. <el-form-item label="">
  71. <el-button @click="resetScreenForm">清空</el-button>
  72. <el-button type="primary" @click="submitScreenForm">搜索</el-button>
  73. </el-form-item>
  74. </el-col>
  75. </el-row>
  76. </el-form>
  77. </div>
  78. <div class="mymain-container">
  79. <div class="btn-group clearfix">
  80. <div class="fl">
  81. <!-- <el-button size="mini" type="primary" icon="el-icon-plus" @click="toReturnForm()" v-if="$checkBtnRole('refund', $route.meta.roles)">退货申请</el-button>-->
  82. <!-- <el-button size="mini" type="warning" icon="el-icon-finished" @click="batchExamine" :disabled="multipleSelection.length < 1" v-if="$checkBtnRole('examine', $route.meta.roles)">批量审批</el-button>-->
  83. </div>
  84. <div class="fr">
  85. <ExportButton :exUrl="'sale/order/export'" :exParams="exParams" />
  86. </div>
  87. </div>
  88. <div class="table">
  89. <el-table
  90. v-loading="listLoading"
  91. :data="dataList"
  92. element-loading-text="Loading"
  93. border
  94. fit
  95. highlight-current-row
  96. stripe
  97. @selection-change="handleSelectionChange"
  98. show-summary
  99. :summary-method="$getSummaries">
  100. <!-- <el-table-column align="center" type="selection" width="55"></el-table-column>-->
  101. <el-table-column align="left" label="状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  102. <template slot-scope="scope">
  103. {{scope.row.examineStatus | statusFilter}}
  104. </template>
  105. </el-table-column>
  106. <el-table-column align="left" label="开票状态" prop="billStatus" min-width="100" show-overflow-tooltip>
  107. <template slot-scope="scope">
  108. {{scope.row.billStatus | billStatusFilter}}
  109. </template>
  110. </el-table-column>
  111. <el-table-column align="left" label="出库单号" prop="id" min-width="110" show-overflow-tooltip>
  112. <template slot-scope="scope">
  113. <CopyButton :copyText="scope.row.id" />
  114. <span>{{scope.row.id}}</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column align="left" label="发货单号" prop="orderNo" min-width="130" show-overflow-tooltip>
  118. <template slot-scope="scope">
  119. <CopyButton :copyText="scope.row.orderNo" />
  120. <span>{{scope.row.orderNo}}</span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column align="left" label="订单号" prop="orderNo" min-width="140" show-overflow-tooltip>
  124. <template slot-scope="scope">
  125. <CopyButton :copyText="scope.row.orderType === 'TRADE' || scope.row.orderType === 'HMOE' ? scope.row.enginOrderNo : scope.row.mainOrderId" />
  126. <span>{{scope.row.orderType === 'TRADE' || scope.row.orderType === 'HMOE' ? scope.row.enginOrderNo : scope.row.mainOrderId}}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column align="left" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
  130. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
  131. <template slot-scope="scope">
  132. <CopyButton :copyText="scope.row.customerNumber" />
  133. <span>{{scope.row.customerNumber}}</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  137. <template slot-scope="scope">
  138. <CopyButton :copyText="scope.row.customerName" />
  139. <span>{{scope.row.customerName}}</span>
  140. </template>
  141. </el-table-column>
  142. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  143. <template slot-scope="scope">
  144. <CopyButton :copyText="scope.row.materialCode" />
  145. <span>{{scope.row.materialCode}}</span>
  146. </template>
  147. </el-table-column>
  148. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  149. <template slot-scope="scope">
  150. <CopyButton :copyText="scope.row.materialOldNumber" />
  151. <span>{{scope.row.materialOldNumber}}</span>
  152. </template>
  153. </el-table-column>
  154. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  155. <template slot-scope="scope">
  156. <CopyButton :copyText="scope.row.materialName" />
  157. <span>{{scope.row.materialName}}</span>
  158. </template>
  159. </el-table-column>
  160. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  161. <template slot-scope="scope">
  162. <CopyButton :copyText="scope.row.specification" />
  163. <span>{{scope.row.specification}}</span>
  164. </template>
  165. </el-table-column>
  166. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  167. <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  168. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  169. <template slot-scope="scope">
  170. {{ scope.row.price | numToFixed }}
  171. </template>
  172. </el-table-column>
  173. <el-table-column align="right" label="订单金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  174. <template slot-scope="scope">
  175. {{ scope.row.payAmount | numToFixed }}
  176. </template>
  177. </el-table-column>
  178. <el-table-column align="left" label="订单备注" prop="headerRemark" min-width="160" show-overflow-tooltip></el-table-column>
  179. <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  180. <el-table-column align="left" label="表体备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip></el-table-column>
  181. <el-table-column align="left" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
  182. <el-table-column align="left" label="表头业务员" prop="k3ServiceName" min-width="100" show-overflow-tooltip></el-table-column>
  183. <!-- <el-table-column align="center" label="操作" width="120" fixed="right">-->
  184. <!-- <template slot-scope="scope">-->
  185. <!-- <el-button type="text" @click="toDetail(scope.row)">详情</el-button>-->
  186. <!--&lt;!&ndash; <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>&ndash;&gt;-->
  187. <!--&lt;!&ndash; <el-popconfirm&ndash;&gt;-->
  188. <!--&lt;!&ndash; style="margin-left: 10px;"&ndash;&gt;-->
  189. <!--&lt;!&ndash; title="确定弃审吗?"&ndash;&gt;-->
  190. <!--&lt;!&ndash; @onConfirm="handleAbandon(scope.row.id)"&ndash;&gt;-->
  191. <!--&lt;!&ndash; v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >&ndash;&gt;-->
  192. <!--&lt;!&ndash; <el-button slot="reference" type="text">弃审</el-button>&ndash;&gt;-->
  193. <!--&lt;!&ndash; </el-popconfirm>&ndash;&gt;-->
  194. <!-- </template>-->
  195. <!-- </el-table-column>-->
  196. </el-table>
  197. </div>
  198. </div>
  199. <div class="pagination clearfix">
  200. <div class="fr">
  201. <el-pagination
  202. @size-change="handleSizeChange"
  203. @current-change="handleCurrentChange"
  204. :current-page="currentPage"
  205. :page-sizes="[10, 20, 30, 50]"
  206. :page-size="10"
  207. layout="total, sizes, prev, pager, next, jumper"
  208. :total="listTotal">
  209. </el-pagination>
  210. </div>
  211. </div>
  212. </div>
  213. <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
  214. <SalesDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  215. <SalesExamine :listItem="queryItem" v-if="isShowExamine" @backListFormExamine="backList" />
  216. <SalesReturnForm :listItem="queryItem" v-if="isShowReturnForm" @backListFormDetail="backList" />
  217. </div>
  218. </template>
  219. <script>
  220. import { abandonData, examineBatch, examineJudge, getList } from '@/api/supply/sales'
  221. import SalesDetail from '@/views/supply/sales/components/sales_detail'
  222. import SalesExamine from '@/views/supply/sales/components/sales_examine'
  223. import SalesReturnForm from '@/views/supply/sales/components/sales_return_form'
  224. import ExamineDialog from '@/components/Common/examine-dialog'
  225. let that
  226. export default {
  227. components: {
  228. SalesDetail,
  229. SalesExamine,
  230. SalesReturnForm,
  231. ExamineDialog,
  232. },
  233. filters: {
  234. statusFilter(val) {
  235. let obj = that.statusList.find(o => o.value == val);
  236. return obj ? obj.label : ''
  237. },
  238. billStatusFilter(val) {
  239. const MAP = {
  240. 1: '已开票',
  241. 0: '未开票',
  242. }
  243. return MAP[val];
  244. }
  245. },
  246. data() {
  247. return {
  248. currentPage: 1, // 当前页码
  249. pageSize: 10, // 每页数量
  250. listTotal: 0, // 列表总数
  251. dataList: null, // 列表数据
  252. listLoading: false, // 列表加载loading
  253. screenForm: { // 筛选表单数据
  254. orderNum: '',
  255. jxsName: '',
  256. jxsNum: '',
  257. chName: '',
  258. chNum: '',
  259. model: '',
  260. warehouse: '',
  261. date: '',
  262. status: '',
  263. mainOrderId: '',
  264. },
  265. statusList: [
  266. { label: '已保存', value: 'SAVE' },
  267. { label: '待审核', value: 'WAIT' },
  268. { label: '审核通过', value: 'OK' },
  269. // { label: '审核驳回', value: 'FAIL' },,
  270. ],
  271. queryItem: {},
  272. isShowDetail: false,
  273. isShowExamine: false,
  274. isShowReturnForm: false,
  275. multipleSelection: [],
  276. isShowExamineDialog: false,
  277. examineForm: {
  278. status: '',
  279. remark: '',
  280. },
  281. }
  282. },
  283. computed: {
  284. exParams() {
  285. return {
  286. examineStatus: this.screenForm.status,
  287. orderNo: this.screenForm.orderNum,
  288. customerName: this.screenForm.jxsName,
  289. customerNumber: this.screenForm.jxsNum,
  290. materialName: this.screenForm.chName,
  291. materialNumber: this.screenForm.chNum,
  292. specification: this.screenForm.model,
  293. correspondName: this.screenForm.warehouse,
  294. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  295. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  296. mainOrderId: this.screenForm.mainOrderId,
  297. }
  298. },
  299. },
  300. beforeCreate() {
  301. that = this;
  302. },
  303. created() {
  304. this.getList();
  305. },
  306. methods: {
  307. // 查询列表
  308. getList() {
  309. this.listLoading = true;
  310. let params = {
  311. pageNum: this.currentPage,
  312. pageSize: this.pageSize,
  313. examineStatus: this.screenForm.status,
  314. orderNo: this.screenForm.orderNum,
  315. customerName: this.screenForm.jxsName,
  316. customerNumber: this.screenForm.jxsNum,
  317. materialName: this.screenForm.chName,
  318. materialNumber: this.screenForm.chNum,
  319. specification: this.screenForm.model,
  320. correspondName: this.screenForm.warehouse,
  321. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  322. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  323. mainOrderId: this.screenForm.mainOrderId,
  324. };
  325. getList(params).then((res) => {
  326. res.data.records.forEach(item => {
  327. item.sums1 = ['refundableQty'];
  328. item.sums2 = ['price', 'payAmount'];
  329. })
  330. this.dataList = res.data.records;
  331. this.listTotal = res.data.total;
  332. this.listLoading = false;
  333. })
  334. },
  335. // 提交筛选表单
  336. submitScreenForm() {
  337. this.currentPage = 1;
  338. this.getList();
  339. },
  340. // 重置筛选表单
  341. resetScreenForm() {
  342. this.$refs.screenForm.resetFields();
  343. this.currentPage = 1;
  344. this.getList();
  345. },
  346. // 更改每页数量
  347. handleSizeChange(val) {
  348. this.pageSize = val;
  349. this.currentPage = 1;
  350. this.getList();
  351. },
  352. // 更改当前页
  353. handleCurrentChange(val) {
  354. this.currentPage = val;
  355. this.getList();
  356. },
  357. // 判断是否可以审批
  358. async examineJudge(item) {
  359. // 获取页面模版
  360. const result = await new Promise((resolve, reject)=>{
  361. examineJudge({id: item.id}).then(res => {
  362. resolve(res.code == 200);
  363. }).catch(res => {
  364. resolve(0);
  365. })
  366. })
  367. return result;
  368. },
  369. // 进入表单
  370. toReturnForm(item) {
  371. this.queryItem = item;
  372. this.isShowReturnForm = true;
  373. },
  374. // 进入详情
  375. toDetail(item) {
  376. this.queryItem = item;
  377. this.isShowDetail = true;
  378. },
  379. // 进入审批
  380. async toExamine(item) {
  381. const canExamine = await this.examineJudge(item);
  382. if(!canExamine) {
  383. return false;
  384. }
  385. this.queryItem = item;
  386. this.isShowExamine = true;
  387. },
  388. backList() {
  389. this.queryItem = {};
  390. this.isShowDetail = false;
  391. this.isShowExamine = false;
  392. this.isShowReturnForm = false;
  393. },
  394. handleSelectionChange(val) {
  395. this.multipleSelection = val;
  396. },
  397. // 打开 批量审批
  398. batchExamine() {
  399. this.isShowExamineDialog = true;
  400. },
  401. // 提交 批量审批
  402. submitExamineForm() {
  403. let ids = this.multipleSelection.map(item => {
  404. return item.id;
  405. });
  406. examineBatch({
  407. ids: ids.join(','),
  408. examineStatus: this.examineForm.status,
  409. approvalRemark: this.examineForm.remark,
  410. }).then(res => {
  411. this.isShowExamineDialog = false;
  412. this.getList();
  413. this.$successMsg('修改成功');
  414. })
  415. },
  416. // 弃审
  417. handleAbandon(id) {
  418. abandonData({id}).then(res => {
  419. this.$successMsg();
  420. this.getList();
  421. })
  422. },
  423. }
  424. }
  425. </script>
  426. <style lang="scss" scoped>
  427. </style>