myOrderList.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. <template>
  2. <div class="app-container">
  3. <div class="title-container">
  4. <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
  5. </div>
  6. <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="selectMyOrderPage">
  7. <template slot="left">
  8. <PermissionButton menu-code="_views_assets_add_order" class-name="filter-item" type="danger"
  9. icon="el-icon-circle-plus-outline" :page-jump="true" round style="float: left"
  10. :page-query="{ 'couldEdit': true, 'saveOrderBtn': '保存订单', 'showBtn': true, 'couldBack': true }" />
  11. <el-input style="margin-left: 20px;width: 300px;float: left;" class="filter-item"
  12. v-model="listQuery.keyWord" placeholder="项目编号/报告号/项目名称/业务来源" clearable>
  13. </el-input>
  14. <el-select v-model="listQuery.principalId" filterable placeholder="项目负责人(可搜索)"
  15. style=" width: 200px;margin-left: 10px;float: left;">
  16. <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id"></el-option>
  17. </el-select>
  18. <el-select v-model="listQuery.delivery" filterable placeholder="送达状态"
  19. style=" width: 200px;margin-left: 10px;float: left;">
  20. <el-option v-for="(s, value) in deliverys" :label="s.label" :value="s.value"></el-option>
  21. </el-select>
  22. <el-button class="filter-item" style="margin-left: 10px;float: left;" type="primary" @click="searchList"
  23. round>搜索
  24. </el-button>
  25. <el-button class="filter-item" style="float: left;" round type="success" @click="resetParams()">重置
  26. </el-button>
  27. </template>
  28. <parentTable ref="table" v-loading="listLoading" :data="pageData.records" slot="table" style="width: 100%;">
  29. <el-table-column label="项目编号" align="center" width="150">
  30. <template slot-scope="{row}">
  31. <span>{{ row.orderId }}</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="分单类型" align="center" width="150">
  35. <template slot-scope="{row}">
  36. <span>{{ row.allotType }}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="意见书号" align="center" width="250">
  40. <template slot-scope="{row}">
  41. <span>{{ row.statementNo }}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="报告号" align="center" width="250">
  45. <template slot-scope="{row}">
  46. <span>{{ row.reportNo }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="项目名称" align="center" width="150">
  50. <template slot-scope="{row}">
  51. <span>{{ row.name }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="业务类型" align="center" width="150">
  55. <template slot-scope="{row}">
  56. <span>{{ row.assetsBusinessGener }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="客户名称" align="center" width="150">
  60. <template slot-scope="{row}">
  61. <span>{{ row.customerName }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="业务来源" align="center" width="150">
  65. <template slot-scope="{row}">
  66. <span>{{ row.customerSubName }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="委托人" align="center" width="150">
  70. <template slot-scope="{row}">
  71. <span>{{ row.bailor }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="委托人联系电话" align="center" width="150">
  75. <template slot-scope="{row}">
  76. <span>{{ row.bailorContactTel }}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="当前节点" align="center" width="150">
  80. <template slot-scope="{row}">
  81. <span>{{ row.currentNodeName }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="当前节点负责人" align="center" width="150">
  85. <template slot-scope="{row}">
  86. <span>{{ row.handlerName }}</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="项目负责人" align="center" width="150">
  90. <template slot-scope="{row}">
  91. <span>{{ row.principalName }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="客户经理" align="center" width="150">
  95. <template slot-scope="{row}">
  96. <span>{{ row.clientManagerName }}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="评估结论对应的评估值(万)" align="center" width="200">
  100. <template slot-scope="{row}">
  101. <span>{{ row.estimatedValue }}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="订单应收款(元)" align="center" width="150">
  105. <template slot-scope="{row}">
  106. <span>{{ row.shouldAmount }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="订单实收款(元)" align="center" width="150">
  110. <template slot-scope="{row}">
  111. <span>{{ row.realAmount }}</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="标准收费(元)" align="center" width="150">
  115. <template slot-scope="{row}">
  116. <span>{{ row.standardAmount }}</span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="折扣比例" align="center" width="150">
  120. <template slot-scope="{row}">
  121. <span>{{ row.discount }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="实际开票金额" align="center" width="150">
  125. <template slot-scope="{row}">
  126. <span>{{ row.invoiceRealAmount }}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="操作" align="center" width="200" fixed="right">
  130. <template slot-scope="{row}">
  131. <el-button type="text" @click="orderDetail(row)">详情</el-button>
  132. <el-button type="text" size="small" @click="openShouldAmountDialog(row)">应收款</el-button>
  133. <el-button v-if="row.currentNodeCode === 'REPORT_OUT_APPLY'" type="text"
  134. @click="openRepertoryOutWarehouse(row)">
  135. 申请提前出库
  136. </el-button>
  137. <!-- <el-button v-if="row.currentNodeCode === 'REPORT_OUT_APPLY'" type="text"
  138. @click="canceladdRepertoryOutWarehouse(row)">
  139. 撤销出库申请
  140. </el-button> -->
  141. </template>
  142. </el-table-column>
  143. </parentTable>
  144. </y-page-list-layout>
  145. <el-dialog :visible.sync="shouldAmountDialog" width="35%" center top="35vh" custom-class="doWarehouseClass"
  146. @closed="cleanData">
  147. <el-form ref="fund" :model="fund" style="margin-left:40px">
  148. <el-row>
  149. <el-col :xs="24" :sm="12" :lg="24" :span="12">
  150. <el-form-item label="应收款金额(元):" prop="shouldAmount" label-width="160px"
  151. class="postInfo-container-item"
  152. :rules="{ required: true, message: '应收款金额不能为空', trigger: 'blur' }">
  153. <el-input-number :precision="2" :min="null" :value-on-clear="0"
  154. v-model.number="fund.shouldAmount" type="number" style="width:300px" class="filter-item" />
  155. </el-form-item>
  156. </el-col>
  157. </el-row>
  158. <el-row>
  159. <el-col :xs="24" :sm="12" :lg="24" :span="12">
  160. <el-form-item label="备注:" prop="remark" label-width="160px" class="postInfo-container-item">
  161. <el-input style="width:300px" type="textarea" v-model="fund.remark"></el-input>
  162. </el-form-item>
  163. </el-col>
  164. </el-row>
  165. </el-form>
  166. <span slot="footer" class="dialog-footer">
  167. <el-button @click="shouldAmountDialog = false">取 消</el-button>
  168. <el-button type="primary" @click="saveShouldAmount()">确 定</el-button>
  169. </span>
  170. </el-dialog>
  171. <el-dialog :visible.sync="repertoryOutWarehouseVisible">
  172. <el-form ref="outWarehouse" :model="outWarehouse" style="margin-left:40px; margin-right: 200px;">
  173. <el-row>
  174. <el-col>
  175. <el-form-item label="出库原因:" prop="remark" label-width="160px" class="postInfo-container-item">
  176. <el-input type="textarea" placeholder="请输入申请提前出库原因" v-model="outWarehouse.remark"></el-input>
  177. </el-form-item>
  178. </el-col>
  179. </el-row>
  180. </el-form>
  181. <span slot="footer" class="dialog-footer">
  182. <el-button @click="repertoryOutWarehouseVisible = false">取 消</el-button>
  183. <el-button type="primary" @click="addRepertoryOutWarehouse()">确 定</el-button>
  184. </span>
  185. </el-dialog>
  186. </div>
  187. </template>
  188. <script>
  189. import YPageListLayout from '@/components/YPageListLayout'
  190. import Breadcrumb from '@/components/Breadcrumb'
  191. import PermissionButton from '@/components/PermissionButton/PermissionButton'
  192. export default {
  193. name: 'AssetsAllList',
  194. components: {
  195. Breadcrumb,
  196. YPageListLayout,
  197. PermissionButton,
  198. },
  199. data() {
  200. return {
  201. pageData: { records: [] },
  202. listLoading: false,
  203. listQuery: {
  204. page: 1,
  205. size: 10,
  206. current: 1,
  207. // 节点code
  208. nodeCode: null,
  209. // 客户经理id
  210. clientManagerId: this.$store.getters.userInfo.id,
  211. // 项目负责人id
  212. principalId: null,
  213. // 业务类型
  214. assetsBusinessGener: null,
  215. // 关键字
  216. keyWord: null,
  217. // 送达状态
  218. delivery: null
  219. },
  220. // 用户下拉列表
  221. allUsers: [],
  222. // 送达状态下拉列表
  223. deliverys: [
  224. {
  225. value: '1',
  226. label: '已送达'
  227. }, {
  228. value: '0',
  229. label: '未送达'
  230. },
  231. ],
  232. shouldAmountDialog: false,
  233. fund: {
  234. id: null,
  235. businessType: null,
  236. orderName: null,
  237. orderId: null,
  238. shouldAmount: null,
  239. remark: null,
  240. businessType: null,
  241. businessId: null,
  242. businessSubId: null,
  243. productionFundId: null,
  244. evaluateAmount: null
  245. },
  246. repertoryOutWarehouseVisible: false,
  247. outWarehouse: {
  248. id: null,
  249. productionFundId: null,
  250. reportNo: null,
  251. statementNo: null,
  252. remark: null,
  253. realAmount: null
  254. },
  255. businessId: null,
  256. businessSubId: null,
  257. businessMinId: null,
  258. recordId: null,
  259. currentNodeId: null
  260. }
  261. },
  262. created() {
  263. // 获取用户下拉列表
  264. this.getAllUser();
  265. // 获取我的资产业务订单
  266. this.selectMyOrderPage();
  267. },
  268. methods: {
  269. // 无条件分页查询
  270. selectMyOrderPage() {
  271. this.$api.assets.selectMyOrderPage(this.listQuery).then(res => {
  272. if (res.code === 200) {
  273. this.pageData = res.data;
  274. }
  275. })
  276. },
  277. // 条件查询
  278. searchList() {
  279. // 重置分页
  280. this.listQuery.page = 1
  281. this.listQuery.size = 10
  282. this.selectMyOrderPage()
  283. },
  284. // 重置搜索条件
  285. resetParams() {
  286. this.$router.push({ query: {} });
  287. this.listQuery = {
  288. current: 1,
  289. size: 10,
  290. }
  291. this.selectMyOrderPage();
  292. },
  293. // 获取所有用户下拉列表
  294. getAllUser() {
  295. this.$api.user.simpleAll().then(res => {
  296. if (res.code === 200) {
  297. this.allUsers = res.data;
  298. }
  299. })
  300. },
  301. orderDetail(row) {
  302. this.$router.push({
  303. path: "/assets/orderDetail",
  304. query: {
  305. row: JSON.stringify(row),
  306. back: '/assets/allList'
  307. }
  308. })
  309. },
  310. openShouldAmountDialog(row) {
  311. this.shouldAmountDialog = true;
  312. this.fund.id = row.orderFundId;
  313. this.fund.businessType = 'ASSET_BUSINESS';
  314. this.fund.businessId = row.assetsId;
  315. this.fund.orderFundId = row.orderFundId;
  316. this.fund.shouldAmount = row.shouldAmount;
  317. this.fund.remark = row.remark;
  318. this.fund.orderId = row.orderId;
  319. this.fund.orderName = row.name;
  320. },
  321. saveShouldAmount() {
  322. this.$refs.fund.validate(valid => {
  323. if (valid) {
  324. if (this.fund.orderFundId) {
  325. this.$api.orderFund.edit(this.fund).then(res => {
  326. if (res.code === 200 && res.data) {
  327. this.$notify({
  328. title: '成功',
  329. message: '订单应收款已修改',
  330. type: 'success',
  331. duration: 1000
  332. });
  333. this.selectMyOrderPage();
  334. this.shouldAmountDialog = false;
  335. } else {
  336. this.$notify({
  337. title: '失败',
  338. message: '订单应收款保存错误',
  339. type: 'error',
  340. duration: 1000
  341. });
  342. }
  343. })
  344. } else {
  345. this.$api.orderFund.add(this.fund).then(res => {
  346. if (res.code === 200 && res.data) {
  347. this.$notify({
  348. title: '成功',
  349. message: '订单应收款已新增',
  350. type: 'success',
  351. duration: 1000
  352. });
  353. this.selectMyOrderPage();
  354. this.shouldAmountDialog = false;
  355. } else {
  356. this.$notify({
  357. title: '失败',
  358. message: '订单应收款保存错误',
  359. type: 'error',
  360. duration: 1000
  361. });
  362. }
  363. })
  364. }
  365. }
  366. })
  367. },
  368. cleanData() {
  369. this.fund.shouldAmount = null;
  370. this.fund.id = null;
  371. this.fund.businessType = null;
  372. this.fund.remark = null;
  373. this.fund.businessType = null;
  374. this.fund.businessId = null;
  375. this.fund.businessSubId = null;
  376. this.fund.productionFundId = null;
  377. this.fund.remark = null;
  378. this.fund.evaluateAmount = null
  379. },
  380. openRepertoryOutWarehouse(row) {
  381. this.repertoryOutWarehouseVisible = true;
  382. this.outWarehouse.reportNo = row.reportNo;
  383. this.outWarehouse.businessType = 'ASSET_BUSINESS';
  384. this.businessId = row.assetsId;
  385. this.businessSubId = row.statementNo;
  386. this.businessMinId = row.reportNo;
  387. this.recordId = row.recordId;
  388. this.currentNodeId = row.currentNodeId;
  389. },
  390. // 新增出库申请
  391. addRepertoryOutWarehouse() {
  392. if (this.outWarehouse.remark !== null && this.outWarehouse.remark !== '') {
  393. let taskRecordDTO = new Object();
  394. taskRecordDTO.recordId = this.recordId;;
  395. taskRecordDTO.taskData = this.outWarehouse;
  396. this.$api.productionOutWarehouse.add(taskRecordDTO).then(res => {
  397. if (res.code === 200 && res.data) {
  398. this.$notify({
  399. title: '成功',
  400. message: '出库申请已提交',
  401. type: 'success',
  402. duration: 2000
  403. });
  404. this.commitNode('PASS', this.outWarehouse.remark);
  405. this.repertoryOutWarehouseVisible = false;
  406. } else {
  407. this.$notify({
  408. title: '失败',
  409. message: '出库申请提交失败',
  410. type: 'error',
  411. duration: 2000
  412. });
  413. }
  414. })
  415. } else {
  416. this.$notify({
  417. title: '警告',
  418. message: '出库原因是必填项',
  419. type: 'error',
  420. duration: 2000
  421. });
  422. }
  423. },
  424. // 撤销出库申请
  425. canceladdRepertoryOutWarehouse(row) {
  426. this.$confirm('请确认是否撤销此出库申请?', '提示', {
  427. confirmButtonText: '确定',
  428. cancelButtonText: '取消',
  429. type: 'warning',
  430. center: true
  431. }).then(() => {
  432. this.$api.productionOutWarehouse.detail(row.warehouseId).then(res => {
  433. if (res.departmentCheckState !== '审核中') {
  434. this.$notify({
  435. title: '警告',
  436. message: '出库申请'+ res.departmentCheckState +',无法撤销。',
  437. type: 'error',
  438. duration: 2000
  439. });
  440. return;
  441. }
  442. })
  443. if (row.id) {
  444. this.$api.productionOutWarehouse.cancel(row.id).then(res => {
  445. if (res.code === 200 && res.data) {
  446. this.$notify({
  447. title: '成功',
  448. message: '出库申请已撤销',
  449. type: 'success',
  450. duration: 2000
  451. });
  452. // 撤销成功退回节点
  453. this.commitNode('REVERSE');
  454. }
  455. })
  456. }
  457. })
  458. },
  459. // 提交节点
  460. commitNode(state, remark) {
  461. let commit = new Object;
  462. commit.instanceNodeId = this.currentNodeId;
  463. commit.state = state;
  464. commit.comments = remark;
  465. commit.businessMinId = this.businessMinId;
  466. commit.businessSubId = this.businessSubId;
  467. this.$api.workflow.commit(commit).then(res => {
  468. if (res.code === 200 && res.data) {
  469. this.$notify({
  470. title: '成功',
  471. message: '工作流节点提交成功。',
  472. type: 'success',
  473. duration: 2000
  474. });
  475. } else {
  476. this.$notify({
  477. title: '失败',
  478. message: '工作流节点提交失败,请联系管理员。',
  479. type: 'error',
  480. duration: 2000
  481. });
  482. }
  483. })
  484. }
  485. }
  486. }
  487. </script>
  488. <style lang="scss" scoped></style>