index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. <template>
  2. <div class="orderEntry pagePadding">
  3. <ex-table
  4. v-loading="loading"
  5. v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
  6. :table="table"
  7. :data="tableData"
  8. :columns="columns"
  9. :page="pageInfo"
  10. :size="size"
  11. @page-curr-change="handlePageChange"
  12. @page-size-change="handleSizeChange"
  13. @screen-reset="
  14. parmValue.page = 1;
  15. pageInfo.curr = 1;
  16. searchList();
  17. "
  18. @screen-submit="
  19. parmValue.page = 1;
  20. pageInfo.curr = 1;
  21. searchList();
  22. "
  23. >
  24. <template #table-header="{}">
  25. <div style="width: 100%">
  26. <el-row :gutter="10">
  27. <el-col :span="24" style="padding: 0 0 10px 80px">
  28. <el-col :span="6" style="width: 306px; padding: 0 0 0 0">
  29. <period-date-picker
  30. :start="parmValue.starttime"
  31. :end="parmValue.endtime"
  32. :type="1"
  33. :width="'140px'"
  34. :size="searchSize"
  35. @timeReturned="timeReturned($event)"
  36. ></period-date-picker>
  37. </el-col>
  38. <el-col :span="8" style="width: 400px">
  39. <el-input
  40. :size="searchSize"
  41. v-model="input"
  42. placeholder="关键字"
  43. @blur="
  44. parmValue.page = 1;
  45. pageInfo.curr = 1;
  46. searchList();
  47. "
  48. >
  49. <el-select
  50. style="width: 125px"
  51. v-model="select"
  52. slot="prepend"
  53. placeholder="请选择"
  54. @change="
  55. parmValue.page = 1;
  56. pageInfo.curr = 1;
  57. searchList();
  58. "
  59. >
  60. <el-option label="确认单编号" value="1"></el-option>
  61. <el-option label="采购单编号" value="2"></el-option>
  62. <el-option label="销售员" value="3"></el-option>
  63. <el-option label="采购员" value="4"></el-option>
  64. </el-select>
  65. <el-button
  66. slot="append"
  67. icon="el-icon-search"
  68. @click="
  69. parmValue.page = 1;
  70. pageInfo.curr = 1;
  71. searchList();
  72. "
  73. ></el-button>
  74. </el-input>
  75. </el-col>
  76. <el-col :span="3" style="width: 60px; float: right">
  77. <el-button
  78. v-if="powers.some((item) => item == '002')"
  79. :size="searchSize"
  80. type="primary"
  81. style="float: right; margin-left: 10px"
  82. @click="searchList"
  83. >
  84. 刷新
  85. </el-button></el-col
  86. >
  87. <el-col :span="3" style="width: 60px; float: right">
  88. <el-button
  89. v-if="powers.some((item) => item == '003')"
  90. :size="searchSize"
  91. type="success"
  92. style="float: right; margin-left: 10px"
  93. @click="openModal('add', false)"
  94. >
  95. 添加
  96. </el-button>
  97. </el-col>
  98. </el-col>
  99. <el-col :span="24" style="padding: 0">
  100. <el-col :span="8" style="width: 386px">
  101. <search-select
  102. :code="code1"
  103. :placeholder="'确认单购买方公司名称'"
  104. @end="searchChange1"
  105. :type="'1'"
  106. :size="searchSize"
  107. />
  108. </el-col>
  109. <el-col :span="8" style="width: 400px">
  110. <search-select
  111. :code="code2"
  112. :placeholder="'采购单供应商名称'"
  113. @end="searchChange2"
  114. :type="'3'"
  115. :size="searchSize"
  116. />
  117. </el-col>
  118. <el-col :span="8" style="width: 160px">
  119. <el-select
  120. :size="searchSize"
  121. v-model="parmValue.suppitem"
  122. placeholder="销售员部门"
  123. @change="
  124. parmValue.page = 1;
  125. pageInfo.curr = 1;
  126. searchList();
  127. "
  128. >
  129. <el-option
  130. v-for="item in depart_options"
  131. :key="item.value"
  132. :label="item.value"
  133. :value="item.value"
  134. :disabled="item.status !== '1'"
  135. >
  136. </el-option>
  137. </el-select>
  138. </el-col>
  139. </el-col>
  140. </el-row>
  141. </div>
  142. </template>
  143. <template #expand="{ scope }">
  144. <el-form
  145. label-position="right"
  146. size="mini"
  147. inline
  148. label-width="130px"
  149. class="demo-table-expand"
  150. >
  151. <el-row>
  152. <!-- <el-col :span="8">
  153. <el-form-item size="mini" label="客户属性">
  154. <span>{{ scope.row.khzzxz }}</span>
  155. </el-form-item>
  156. </el-col>
  157. <el-col :span="8">
  158. <el-form-item size="mini" label="客户分公司">
  159. <span>{{ scope.row.khcomp }}</span>
  160. </el-form-item>
  161. </el-col> -->
  162. <!-- <el-col :span="8">
  163. <el-form-item size="mini" label="平台">
  164. <span>{{ scope.row.suppitem }}</span>
  165. </el-form-item>
  166. </el-col> -->
  167. <el-col :span="12">
  168. <el-form-item size="mini" label="商品名称">
  169. <span>{{ scope.row.product_name }}</span>
  170. </el-form-item>
  171. </el-col>
  172. <el-col :span="12">
  173. <el-form-item size="mini" label="部门">
  174. <span>{{ scope.row.depart }}</span>
  175. </el-form-item>
  176. </el-col>
  177. <el-col :span="12">
  178. <el-form-item size="mini" label="单价">
  179. <span>{{ scope.row.sale_price }}</span>
  180. </el-form-item>
  181. </el-col>
  182. <el-col :span="12">
  183. <el-form-item size="mini" label="数量">
  184. <span>{{ scope.row.order_num }}</span>
  185. </el-form-item>
  186. </el-col>
  187. <el-col :span="12">
  188. <el-form-item size="mini" label="单据号">
  189. <span>{{ scope.row.sequenceNo }}</span>
  190. </el-form-item>
  191. </el-col>
  192. <el-col :span="12">
  193. <el-form-item size="mini" label="PO编号">
  194. <span>{{ scope.row.poNo }}</span>
  195. </el-form-item>
  196. </el-col>
  197. <el-col :span="12">
  198. <el-form-item size="mini" label="税点">
  199. <span>{{ scope.row.tax }}</span>
  200. </el-form-item>
  201. </el-col>
  202. <el-col :span="12">
  203. <el-form-item size="mini" label="确认单类型">
  204. <span>{{ scope.row.qrd_type }}</span>
  205. </el-form-item>
  206. </el-col>
  207. <el-col :span="12">
  208. <el-form-item size="mini" label="已回款总金额">
  209. <span>{{ scope.row.apay_fee }}</span>
  210. </el-form-item>
  211. </el-col>
  212. <el-col :span="12">
  213. <el-form-item size="mini" label="未回款总金额">
  214. <span>{{ scope.row.wpay_fee }}</span>
  215. </el-form-item>
  216. </el-col>
  217. <el-col :span="12">
  218. <el-form-item size="mini" label="确认单开票金额">
  219. <span>{{ scope.row.ainv_fee }}</span>
  220. </el-form-item>
  221. </el-col>
  222. <el-col :span="12">
  223. <el-form-item size="mini" label="确认单未开票金额">
  224. <span>{{ scope.row.winv_fee }}</span>
  225. </el-form-item>
  226. </el-col>
  227. </el-row>
  228. </el-form>
  229. </template>
  230. <template #status="{ scope }">
  231. <el-tag
  232. :type="scope.row.status == '0' ? 'warning' : ''"
  233. :size="size"
  234. v-text="
  235. (statusOptions.find((item) => item.id == scope.row.status) || {}).label ||
  236. '--'
  237. "
  238. ></el-tag>
  239. </template>
  240. <template #operation="{ scope }">
  241. <el-tooltip
  242. effect="dark"
  243. content="详情"
  244. v-if="powers.some((item) => item == '007')"
  245. placement="top"
  246. >
  247. <i class="el-icon-view tb-icon" @click="openModal(scope.row.id, true)"></i>
  248. </el-tooltip>
  249. <el-tooltip
  250. effect="dark"
  251. content="修改"
  252. v-if="powers.some((item) => item == '005')"
  253. placement="top"
  254. >
  255. <i class="el-icon-edit tb-icon" @click="openModal(scope.row.id, false)"></i>
  256. </el-tooltip>
  257. </template>
  258. </ex-table>
  259. <no-auth v-else></no-auth>
  260. <!-- 弹窗 新增/修改 -->
  261. <add-edit
  262. :id="modelId"
  263. :show-model="showModel"
  264. :is-detail="isDetail"
  265. :contector="contector"
  266. :name="name"
  267. @refresh="searchList"
  268. @cancel="showModel = false"
  269. />
  270. </div>
  271. </template>
  272. <script>
  273. import asyncRequest from "@/apis/service/network/orderEntry";
  274. import ExTable from "@/components/ExTableNew.vue";
  275. import mixinPage from "@/mixins/elPaginationHandle";
  276. import addEdit from "./addEdit";
  277. import PeriodDatePicker from "@/components/PeriodDatePicker";
  278. import { mapGetters } from "vuex";
  279. import resToken from "@/mixins/resToken";
  280. export default {
  281. name: "orderEntry",
  282. components: {
  283. ExTable,
  284. addEdit,
  285. PeriodDatePicker,
  286. },
  287. mixins: [mixinPage, resToken],
  288. computed: {
  289. //组件SIZE设置
  290. ...mapGetters(["tablebtnSize", "searchSize", "size", "userid"]),
  291. powers() {
  292. let tran =
  293. this.$store.getters.btnList.find((item) => item.menu_route == "orderEntry") || {};
  294. if (tran && tran.action && tran.action.length > 0) {
  295. return tran.action;
  296. } else {
  297. return [];
  298. }
  299. },
  300. },
  301. data() {
  302. return {
  303. code1: [],
  304. code2: [],
  305. select: "1",
  306. input: "",
  307. isDetail: false,
  308. depart_options: [
  309. {
  310. status: "1",
  311. value: "网络部",
  312. },
  313. {
  314. status: "1",
  315. value: "客服部",
  316. },
  317. {
  318. status: "0",
  319. value: "项目部",
  320. },
  321. {
  322. status: "0",
  323. value: "平台部",
  324. },
  325. {
  326. status: "0",
  327. value: "财务部",
  328. },
  329. {
  330. status: "0",
  331. value: "采购部",
  332. },
  333. {
  334. status: "0",
  335. value: "产品部",
  336. },
  337. ],
  338. // 状态
  339. statusOptions: [
  340. { id: "0", label: "禁用" },
  341. { id: "1", label: "启用" },
  342. ],
  343. pickerOptions: {
  344. // disabledDate是一个函数,参数是当前选中的日期值,这个函数需要返回一个Boolean值,
  345. disabledDate(time) {
  346. let date = new Date().valueOf();
  347. const one = 1000 * 60 * 60 * 24;
  348. date = parseInt(date / one) * one;
  349. return time.getTime() <= date;
  350. },
  351. },
  352. showModel: false,
  353. loading: false,
  354. modelId: 0,
  355. parmValue: {
  356. qrdNo: "", //确认单编号
  357. cgdNo: "", //采购单编号
  358. sale_name: "", //销售员
  359. cgd_sale: "", //采购员
  360. endtime: "", //完成时间
  361. starttime: "", //开始下单时间
  362. khNo: "", //客户code
  363. supplierNo: "", //供应商编号
  364. page: 1, // 页码
  365. size: 15, // 每页显示条数
  366. suppitem: "",
  367. },
  368. // 表格 - 数据
  369. tableData: [],
  370. // 表格 - 参数
  371. table: {
  372. stripe: true,
  373. border: true,
  374. _defaultHeader_: ["setcol"],
  375. },
  376. // 表格 - 分页
  377. pageInfo: {
  378. size: 15,
  379. curr: 1,
  380. total: 0,
  381. },
  382. // 表格 - 列参数
  383. columns: [
  384. {
  385. type: "expand",
  386. label: "",
  387. _slot_: "expand",
  388. },
  389. {
  390. prop: "qrdNo",
  391. label: "确认单编号",
  392. width: "165px",
  393. // fixed: "left",
  394. },
  395. {
  396. prop: "sale_total",
  397. label: "销售总额",
  398. width: "100px",
  399. },
  400. {
  401. prop: "sale_name",
  402. label: "销售员",
  403. width: "70px",
  404. },
  405. {
  406. prop: "khNo",
  407. label: "企业客户编码",
  408. width: "125px",
  409. },
  410. {
  411. prop: "khName",
  412. label: "企业客户",
  413. "min-width": "190px",
  414. },
  415. {
  416. prop: "companyNo",
  417. label: "确认单销售公司编码",
  418. width: "175px",
  419. },
  420. {
  421. prop: "supperinfo",
  422. label: "确认单销售公司",
  423. "min-width": "190px",
  424. },
  425. {
  426. prop: "cgdNo",
  427. label: "采购单号",
  428. width: "165px",
  429. },
  430. {
  431. prop: "supplierNo",
  432. label: "供应商编号",
  433. width: "140px",
  434. },
  435. {
  436. prop: "supplier",
  437. label: "供应商",
  438. "min-width": "190px",
  439. },
  440. // {
  441. // prop: "suppitem",
  442. // label: "平台",
  443. // },
  444. // {
  445. // prop: "status",
  446. // label: "状态",
  447. // width: "90px",
  448. // _slot_: "status",
  449. // },
  450. // {
  451. // prop: "poNo",
  452. // label: "po编号",
  453. // },
  454. {
  455. prop: "ordertime",
  456. label: "创建时间",
  457. width: "140px",
  458. },
  459. {
  460. prop: "",
  461. label: "操作",
  462. width: "85px",
  463. fixed: "right",
  464. _noset_: true,
  465. _slot_: "operation",
  466. },
  467. ],
  468. };
  469. },
  470. mounted() {
  471. if (this.userid === "116") {
  472. this.parmValue.suppitem = "客服部";
  473. }
  474. if (this.userid === "65" || this.userid === "71") {
  475. this.parmValue.suppitem = "网络部";
  476. }
  477. this.searchList();
  478. },
  479. methods: {
  480. async searchList() {
  481. this.loading = true;
  482. this.parmValue.qrdNo = this.select === "1" ? this.input : "";
  483. this.parmValue.cgdNo = this.select === "2" ? this.input : "";
  484. this.parmValue.sale_name = this.select === "3" ? this.input : "";
  485. this.parmValue.cgd_sale = this.select === "4" ? this.input : "";
  486. this.parmValue.khNo = this.code1.join(",");
  487. this.parmValue.supplierNo = this.code2.join(",");
  488. const res = await asyncRequest.list(this.parmValue);
  489. if (res && res.code === 0 && res.data) {
  490. this.tableData = res.data.list;
  491. this.tableData.forEach((v1) => {
  492. v1.apay_fee = this.setnum(v1.apay_fee);
  493. v1.wpay_fee = this.setnum(v1.wpay_fee);
  494. v1.ainv_fee = this.setnum(v1.ainv_fee);
  495. v1.winv_fee = this.setnum(v1.winv_fee);
  496. });
  497. this.pageInfo.total = Number(res.data.count);
  498. } else if (res && res.code >= 100 && res.code <= 104) {
  499. await this.logout();
  500. } else {
  501. this.tableData = [];
  502. this.pageInfo.total = 0;
  503. }
  504. this.loading = false;
  505. },
  506. setnum(s) {
  507. let str = "";
  508. if (isNaN(s)) {
  509. str = "0";
  510. } else if (typeof s == "undefined") {
  511. str = "0";
  512. } else if (!s && typeof s != "undefined" && s != 0) {
  513. str = "0";
  514. } else {
  515. str = parseFloat(s + "").toFixed(2);
  516. }
  517. return str;
  518. },
  519. async searchChange1(e) {
  520. this.code1 = JSON.parse(JSON.stringify(e));
  521. this.parmValue.page = 1;
  522. await this.searchList();
  523. },
  524. async searchChange2(e) {
  525. this.code2 = JSON.parse(JSON.stringify(e));
  526. this.parmValue.page = 1;
  527. await this.searchList();
  528. },
  529. async timeReturned(e) {
  530. if (e.startTime !== "") {
  531. this.parmValue.starttime = e.startTime;
  532. } else {
  533. this.parmValue.starttime = "";
  534. }
  535. if (e.endTime !== "") {
  536. this.parmValue.endtime = e.endTime;
  537. } else {
  538. this.parmValue.endtime = "";
  539. }
  540. if (this.parmValue.starttime !== "" && this.parmValue.endtime !== "") {
  541. this.parmValue.page = 1;
  542. await this.searchList();
  543. }
  544. },
  545. openModal(id, isDetail) {
  546. this.showModel = true;
  547. this.modelId = id;
  548. this.isDetail = isDetail;
  549. },
  550. async statusConfirm(id, status) {
  551. await this.$confirm(`确定要改为${status === "1" ? "禁用" : "启用"}?`, {
  552. confirmButtonText: "确定",
  553. cancelButtonText: "取消",
  554. type: "warning",
  555. })
  556. .then(async () => {
  557. this.loading = true;
  558. const model = {
  559. companyNo: id,
  560. status: status === "1" ? "0" : "1",
  561. };
  562. const res = await asyncRequest.status(model);
  563. if (res && res.code === 0) {
  564. this.loading = false;
  565. this.$notify.success({
  566. title: "状态修改成功!",
  567. message: "",
  568. });
  569. await this.searchList();
  570. } else if (res && res.code >= 100 && res.code <= 104) {
  571. await this.logout();
  572. } else {
  573. this.loading = false;
  574. this.$message.warning(res.message);
  575. }
  576. })
  577. .catch(() => {
  578. console.log("取消");
  579. });
  580. },
  581. },
  582. };
  583. </script>
  584. <style lang="scss" scoped>
  585. .orderEntry {
  586. background: rgba(242, 242, 242, 1);
  587. min-height: 100%;
  588. width: 100%;
  589. height: 100%;
  590. // background-color: $bg;
  591. overflow: hidden;
  592. // position: absolute;
  593. z-index: 2;
  594. background: #fff;
  595. .change {
  596. .title {
  597. border-width: 0px;
  598. width: 100%;
  599. height: 100px;
  600. // display: flex;
  601. font-weight: 400;
  602. font-style: normal;
  603. font-size: 22px;
  604. text-align: left;
  605. padding: 0;
  606. padding: 60px 0 0 100px;
  607. width: 100%;
  608. box-sizing: border-box;
  609. }
  610. }
  611. }
  612. </style>