saleOrder.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. <template>
  2. <!-- 销售订单页面 -->
  3. <div class="salePlan">
  4. <div class="top">
  5. <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
  6. <el-button type="primary" class="btn" @click="onclick">
  7. <i class="el-icon-search"></i>查询
  8. </el-button>
  9. <el-button type="primary" @click="btnclick(0)">
  10. <i class="el-icon-plus"></i>钢材订单新增
  11. </el-button>
  12. </div>
  13. <el-tabs v-model="activeName" @tab-click="handleClick">
  14. <el-tab-pane label="未上报" name="first">
  15. <dilTable v-bind.sync="option" ref="table3">
  16. <el-table-column fixed="right" label="操作" align="center" width="200">
  17. <template slot-scope="scope">
  18. <el-button
  19. @click="uploadclick(scope.row.saleOrderId)"
  20. type="text"
  21. size="small"
  22. >上传</el-button
  23. >
  24. <el-button
  25. @click="click(scope.row.saleOrderId)"
  26. type="text"
  27. size="small"
  28. >修改</el-button
  29. >
  30. <el-button
  31. type="text"
  32. size="small"
  33. @click="deleteclick(scope.row.saleOrderId)"
  34. >删除</el-button
  35. >
  36. <el-button
  37. @click="detailclick3(scope.row)"
  38. type="text"
  39. size="small"
  40. >物资详情</el-button
  41. >
  42. </template>
  43. </el-table-column>
  44. <!-- 物资详情抽屉 -->
  45. <el-table-column type="expand" width="1">
  46. <template slot-scope="props">
  47. <el-form label-position="center" inline class="demo-table-expand">
  48. <div v-if="false">{{ props }}</div>
  49. <div>
  50. <el-table :data="tableData3" border >
  51. <el-table-column
  52. v-for="(item, i) in tableHead"
  53. :key="i"
  54. :prop="item.prop"
  55. :label="item.label"
  56. :width="item.width"
  57. ></el-table-column>
  58. </el-table>
  59. </div>
  60. </el-form>
  61. </template>
  62. </el-table-column>
  63. </dilTable>
  64. </el-tab-pane>
  65. <!-- 已下发 -->
  66. <el-tab-pane label="已上报" name="second">
  67. <dilTable v-bind.sync="option2" ref="table2">
  68. <el-table-column fixed="right" label="操作" width="70">
  69. <template slot-scope="scope">
  70. <el-button
  71. @click="detailclick2(scope.row)"
  72. type="text"
  73. size="small"
  74. >物资详情</el-button
  75. >
  76. </template>
  77. </el-table-column>
  78. <!-- 物资详情抽屉 -->
  79. <el-table-column type="expand" width="1">
  80. <template slot-scope="props">
  81. <el-form label-position="center" inline class="demo-table-expand">
  82. <div v-if="false">{{ props }}</div>
  83. <div>
  84. <el-table :data="tableData2" border >
  85. <el-table-column
  86. v-for="(item, i) in tableHead"
  87. :key="i"
  88. :prop="item.prop"
  89. :label="item.label"
  90. :width="item.width"
  91. ></el-table-column>
  92. </el-table>
  93. </div>
  94. </el-form>
  95. </template>
  96. </el-table-column>
  97. </dilTable>
  98. </el-tab-pane>
  99. <!-- 财务已审批 -->
  100. <el-tab-pane label="财务已审批" name="third">
  101. <dilTable v-bind.sync="option3" ref="table1">
  102. <el-table-column fixed="right" label="操作" width="200">
  103. <template slot-scope="scope">
  104. <el-button
  105. @click="lookclick(scope.row.saleOrderId)"
  106. type="text"
  107. size="small"
  108. >查看</el-button
  109. >
  110. <el-button
  111. @click="passclick(scope.row.saleOrderId)"
  112. type="text"
  113. size="small"
  114. >修改日志</el-button
  115. >
  116. <el-button
  117. @click="detailclick1(scope.row)"
  118. type="text"
  119. size="small"
  120. >物资详情</el-button
  121. >
  122. </template>
  123. </el-table-column>
  124. <!-- 物资详情抽屉 -->
  125. <el-table-column type="expand" width="1">
  126. <template slot-scope="props">
  127. <el-form label-position="center" inline class="demo-table-expand">
  128. <div v-if="false">{{ props }}</div>
  129. <div>
  130. <el-table :data="tableData1" border >
  131. <el-table-column
  132. v-for="(item, i) in tableHead"
  133. :key="i"
  134. :prop="item.prop"
  135. :label="item.label"
  136. :width="item.width"
  137. ></el-table-column>
  138. </el-table>
  139. </div>
  140. </el-form>
  141. </template>
  142. </el-table-column>
  143. </dilTable>
  144. </el-tab-pane>
  145. <!-- 销售公司已审批 -->
  146. <el-tab-pane label="销售公司已审批" name="four">
  147. <dilTable v-bind.sync="option4" ref="table">
  148. <el-table-column fixed="right" label="操作" width="130">
  149. <template slot-scope="scope">
  150. <el-button
  151. @click="sendClick(scope.row.saleOrderId)"
  152. type="text"
  153. size="small"
  154. >派车</el-button
  155. >
  156. <el-button
  157. @click="addClick(scope.row.saleOrderId)"
  158. type="text"
  159. size="small"
  160. >排车</el-button
  161. >
  162. <el-button
  163. @click="detailclick(scope.row)"
  164. type="text"
  165. size="small"
  166. >物资详情</el-button
  167. >
  168. </template>
  169. </el-table-column>
  170. <!-- 物资详情抽屉 -->
  171. <el-table-column type="expand" width="1">
  172. <template slot-scope="props">
  173. <el-form label-position="center" inline class="demo-table-expand">
  174. <div v-if="false">{{ props }}</div>
  175. <div>
  176. <el-table :data="tableData" border >
  177. <el-table-column
  178. v-for="(item, i) in tableHead"
  179. :key="i"
  180. :prop="item.prop"
  181. :label="item.label"
  182. :width="item.width"
  183. ></el-table-column>
  184. </el-table>
  185. </div>
  186. </el-form>
  187. </template>
  188. </el-table-column>
  189. </dilTable>
  190. </el-tab-pane>
  191. </el-tabs>
  192. </div>
  193. </template>
  194. <script>
  195. export default {
  196. name: "saleOrder",
  197. data() {
  198. return {
  199. activeName: "first",
  200. input: "",
  201. option: {
  202. // 表格请求数据的地址
  203. requestUrl:
  204. "/api/v1/ams/getSaleOrderInfoes?apiId=408",
  205. },
  206. option2: {
  207. // 表格请求数据的地址
  208. requestUrl:
  209. "/api/v1/ams/getSaleOrderReportedes?apiId=408",
  210. },
  211. option3: {
  212. // 表格请求数据的地址
  213. requestUrl:
  214. "/api/v1/ams/getAmsSaleOrderApprovedes?apiId=409",
  215. },
  216. option4: {
  217. // 表格请求数据的地址
  218. requestUrl:
  219. "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409",
  220. },
  221. //记录旧的row对象 (销售公司已审批)
  222. oldRow: "",
  223. //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (销售公司已审批)
  224. oldRowCount: 1,
  225. //记录旧的row对象 (财务已审批)
  226. oldRow1: "",
  227. //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (财务已审批)
  228. oldRowCount1: 1,
  229. //记录旧的row对象 (已上报)
  230. oldRow2: "",
  231. //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (已上报)
  232. oldRowCount2: 1,
  233. //记录旧的row对象 (未上报)
  234. oldRow3: "",
  235. //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (未上报)
  236. oldRowCount3: 1,
  237. tableHead: [
  238. {
  239. prop: "materialName",
  240. label: "物资名称",
  241. width: 150,
  242. },
  243. {
  244. prop: "specificationModel",
  245. label: "规格型号",
  246. width: 150,
  247. },
  248. {
  249. prop: "materialNumber",
  250. label: "物资件数",
  251. width: 100,
  252. },
  253. {
  254. prop: "materialWeight",
  255. label: "物资重量",
  256. width: 100,
  257. },
  258. ],
  259. //(销售公司已审批)
  260. tableData: [],
  261. //(财务已审批)
  262. tableData1: [],
  263. //(已上报)
  264. tableData2: [],
  265. //(未上报)
  266. tableData3: [],
  267. };
  268. },
  269. methods: {
  270. handleClick(tab, event) {
  271. console.log(tab, event);
  272. },
  273. onclick() {
  274. console.log(this.input);
  275. },
  276. seeclick(saleOrderId) {
  277. this.$router.push("/saleOrderDetail/" + saleOrderId);
  278. },
  279. btnclick() {
  280. this.$router.push("/addSaleOrder");
  281. },
  282. click(saleOrderId) {
  283. this.$router.push("/editSaleOrder/" + saleOrderId);
  284. },
  285. addClick(saleOrderId){
  286. this.$router.push("/addSaleOrderArrange/" + saleOrderId);
  287. },
  288. sendClick(saleOrderId){
  289. this.$router.push("/addSaleOrderSend/" + saleOrderId);
  290. },
  291. // detailedClick(saleOrderId){
  292. // this.$router.push("saleOrderMaterial/" + saleOrderId);
  293. // },
  294. // -------查看物资详情 (销售公司已审批)
  295. detailclick(row) {
  296. // 记录重复点击次数
  297. if (this.oldRow === row) {
  298. this.oldRowCount += 1;
  299. }
  300. // 切换当前详情表
  301. this.$refs.table.toggleRowExpansion(row);
  302. // 打开前关闭上一个详情表
  303. if (this.oldRow != "") {
  304. if (this.oldRow != row) {
  305. if (this.oldRowCount % 2 === 1) {
  306. this.$refs.table.toggleRowExpansion(this.oldRow);
  307. } else {
  308. this.oldRowCount = 1;
  309. }
  310. } else {
  311. this.oldRow = null;
  312. return;
  313. }
  314. }
  315. // 重置上一个点击对象
  316. this.oldRow = row;
  317. // 根据销售订单id查询物资信息
  318. this.axios
  319. .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
  320. .then((res) => {
  321. this.tableData = res.data.data;
  322. });
  323. },
  324. // -------查看物资详情 (财务已审批)
  325. detailclick1(row) {
  326. // 记录重复点击次数
  327. if (this.oldRow1 === row) {
  328. this.oldRowCount1 += 1;
  329. }
  330. // 切换当前详情表
  331. this.$refs.table1.toggleRowExpansion(row);
  332. // 打开前关闭上一个详情表
  333. if (this.oldRow1 != "") {
  334. if (this.oldRow1 != row) {
  335. if (this.oldRowCount1 % 2 === 1) {
  336. this.$refs.table1.toggleRowExpansion(this.oldRow1);
  337. } else {
  338. this.oldRowCount1 = 1;
  339. }
  340. } else {
  341. this.oldRow1 = null;
  342. return;
  343. }
  344. }
  345. // 重置上一个点击对象
  346. this.oldRow1 = row;
  347. // 根据销售订单id查询物资信息
  348. this.axios
  349. .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
  350. .then((res) => {
  351. this.tableData1 = res.data.data;
  352. });
  353. },
  354. // -------查看物资详情 (已上报)
  355. detailclick2(row) {
  356. // 记录重复点击次数
  357. if (this.oldRow2 === row) {
  358. this.oldRowCount2 += 1;
  359. }
  360. // 切换当前详情表
  361. this.$refs.table2.toggleRowExpansion(row);
  362. // 打开前关闭上一个详情表
  363. if (this.oldRow2 != "") {
  364. if (this.oldRow2 != row) {
  365. if (this.oldRowCount2 % 2 === 1) {
  366. this.$refs.table2.toggleRowExpansion(this.oldRow2);
  367. } else {
  368. this.oldRowCount2 = 1;
  369. }
  370. } else {
  371. this.oldRow2 = null;
  372. return;
  373. }
  374. }
  375. // 重置上一个点击对象
  376. this.oldRow2 = row;
  377. // 根据销售订单id查询物资信息
  378. this.axios
  379. .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
  380. .then((res) => {
  381. this.tableData2 = res.data.data;
  382. });
  383. },
  384. // -------查看物资详情 (未上报)
  385. detailclick3(row) {
  386. // 记录重复点击次数
  387. if (this.oldRow3 === row) {
  388. this.oldRowCount3 += 1;
  389. }
  390. // 切换当前详情表
  391. this.$refs.table3.toggleRowExpansion(row);
  392. // 打开前关闭上一个详情表
  393. if (this.oldRow3 != "") {
  394. if (this.oldRow3 != row) {
  395. if (this.oldRowCount3 % 2 === 1) {
  396. this.$refs.table3.toggleRowExpansion(this.oldRow3);
  397. } else {
  398. this.oldRowCount3 = 1;
  399. }
  400. } else {
  401. this.oldRow3 = null;
  402. return;
  403. }
  404. }
  405. // 重置上一个点击对象
  406. this.oldRow3 = row;
  407. // 根据销售订单id查询物资信息
  408. this.axios
  409. .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
  410. .then((res) => {
  411. this.tableData3 = res.data.data;
  412. });
  413. },
  414. // 上传
  415. uploadclick(saleOrderId) {
  416. this.$confirm("是否上传", "提示", {
  417. confirmButtonText: "确定",
  418. cancelButtonText: "取消",
  419. type: "warning",
  420. center: true,
  421. })
  422. .then(() => {
  423. this.$message({
  424. type: "success",
  425. message: "上传成功!",
  426. });
  427. this.axios
  428. .post(
  429. "/api/v1/ams/uploadSaleOrder?saleOrderId=" +
  430. saleOrderId
  431. )
  432. .then(() => {
  433. this.$router.go(0);
  434. });
  435. })
  436. .catch(() => {
  437. this.$message({
  438. type: "info",
  439. message: "取消上传!",
  440. });
  441. });
  442. },
  443. //删除
  444. deleteclick(scope) {
  445. let saleOrderId = scope;
  446. this.$confirm("是否删除", "提示", {
  447. confirmButtonText: "确定",
  448. cancelButtonText: "取消",
  449. type: "warning",
  450. center: true,
  451. })
  452. .then(() => {
  453. this.$message({
  454. type: "success",
  455. message: "删除成功!",
  456. });
  457. this.axios
  458. .post(
  459. "/api/v1/ams/deleteAmsSaleOrderBySaleOrderId?saleOrderId=" +
  460. saleOrderId
  461. )
  462. .then(() => {
  463. this.$router.go(0);
  464. });
  465. })
  466. .catch(() => {
  467. this.$message({
  468. type: "info",
  469. message: "取消删除!",
  470. });
  471. });
  472. },
  473. },
  474. };
  475. </script>
  476. <style lang='scss' scoped>
  477. .salePlan {
  478. .top {
  479. padding: 1.25rem 0.375rem;
  480. .el-input {
  481. width: 20%;
  482. margin-right: 1.25rem;
  483. }
  484. }
  485. }
  486. </style>