salesContract.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. <!--销售合同-->
  2. <!--2019年5月30日 20:25:16 by jlx-->
  3. <template>
  4. <div>
  5. <BaseHeaderLayout :leftSpan="10">
  6. <template slot="left">
  7. <ws-button
  8. type="primary"
  9. :disable="checkBtn"
  10. @click="handleAdd()"
  11. v-hasPermission="
  12. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  13. "
  14. >添加</ws-button
  15. >
  16. <ws-button
  17. :disable="checkBtn"
  18. @click="enquiry(3)"
  19. v-hasPermission="
  20. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  21. "
  22. >导出</ws-button
  23. >
  24. </template>
  25. <template slot="right">
  26. <ws-select
  27. v-model="searchTypeText"
  28. placeholder=""
  29. class="typeselect"
  30. @change="selecttaskType"
  31. :value="searchType"
  32. >
  33. <ws-option
  34. v-for="item in taskTypeList"
  35. :key="item.value"
  36. :label="item.value"
  37. :value="item.value"
  38. />
  39. </ws-select>
  40. <ws-date-picker
  41. :picker-options="pickerBeginDateBefore"
  42. v-model="startDate"
  43. type="date"
  44. default-value="1980-01-01"
  45. placeholder="起始日期"
  46. format="yyyy-MM-dd"
  47. value-format="yyyy-MM-dd"
  48. />
  49. <span>至</span>
  50. <ws-date-picker
  51. :picker-options="pickerBeginDateBefore"
  52. v-model="endDate"
  53. type="date"
  54. default-value="1980-01-01"
  55. placeholder="截止日期"
  56. format="yyyy-MM-dd"
  57. value-format="yyyy-MM-dd"
  58. />
  59. <ws-input
  60. v-model="searchKeyWord"
  61. placeholder="可按照合同编号、买方名称、卖方名称进行查找"
  62. clearable
  63. maxlength="500"
  64. type="input"
  65. class="findValue"
  66. ></ws-input>
  67. <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
  68. <ws-button
  69. type="primary"
  70. :disable="checkBtn"
  71. @click="find()"
  72. v-hasPermission="
  73. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  74. "
  75. >查找</ws-button
  76. >
  77. </template>
  78. </BaseHeaderLayout>
  79. <el-table :data="tableData.records" style="width: 100%; margin-top: 10px">
  80. <el-table-column type="index" label="序号">
  81. <template scope="scope">
  82. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  83. <span v-else>{{ scope.$index + 1 }}</span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column prop="contractNo" label="合同编号" width="80">
  87. </el-table-column>
  88. <el-table-column prop="goodsName" label="货名" width="80">
  89. </el-table-column>
  90. <el-table-column prop="grade" label="品级"> </el-table-column>
  91. <el-table-column prop="weight" label="重量(吨)"> </el-table-column>
  92. <el-table-column prop="unitContractPrice" label="合同单价(元)">
  93. </el-table-column>
  94. <el-table-column prop="packingMethod" label="包装方式"> </el-table-column>
  95. <el-table-column prop="buyer" label="买方"> </el-table-column>
  96. <el-table-column prop="seller" label="卖方"> </el-table-column>
  97. <el-table-column prop="imperfectGrain" label="已完成(吨)">
  98. <template slot-scope="scope">
  99. <span v-if="scope.row.proportion >= 90" style="color: red">{{
  100. scope.row.imperfectGrain
  101. }}</span>
  102. <span
  103. v-if="scope.row.proportion < 90"
  104. style="color: #5473e8; font-weight: 600"
  105. >{{ scope.row.imperfectGrain }}</span
  106. >
  107. </template>
  108. </el-table-column>
  109. <el-table-column prop="status" label="状态">
  110. <template slot-scope="scope">
  111. <el-popover
  112. placement="left"
  113. :width="400"
  114. trigger="click"
  115. @show="history(scope.row)"
  116. >
  117. <template>
  118. <span slot="reference">{{ scope.row.status }}</span>
  119. </template>
  120. <div>
  121. <p>操作历史</p>
  122. <div v-for="(item, index) in historyList">
  123. <div class="vertical-circle"></div>
  124. <div class="vertical-text">
  125. {{ item.operateUser }}{{ item.dealMsg }}<br />{{
  126. item.updateDate
  127. }}
  128. </div>
  129. <div
  130. v-if="index != historyList.length - 1"
  131. class="vertical-line"
  132. ></div>
  133. </div>
  134. </div>
  135. </el-popover>
  136. <i class="el-icon-edit" @click="editClick(scope.row)"></i>
  137. </template>
  138. </el-table-column>
  139. <el-table-column prop="signingDate" label="签订日期"> </el-table-column>
  140. <el-table-column prop="mildewGrain" label="未回款(元)">
  141. </el-table-column>
  142. <el-table-column prop="addressUrl" label="附件">
  143. <template slot-scope="scope">
  144. <i @click="fujian(scope.row)" class="el-icon-paperclip iconCss"></i>
  145. <span></span>
  146. </template>
  147. </el-table-column>
  148. <el-table-column prop="address" label="操作" width="300">
  149. <template slot-scope="scope">
  150. <el-button
  151. type="success"
  152. size="small"
  153. @click="handleExamine(scope.row)"
  154. >查看</el-button
  155. >
  156. <el-button type="primary" size="small" @click="handleEdit(scope.row)"
  157. >编辑</el-button
  158. >
  159. <el-button type="danger" size="small" @click="handleDelete(scope.row)"
  160. >删除</el-button
  161. >
  162. </template>
  163. </el-table-column>
  164. </el-table>
  165. <el-pagination
  166. @size-change="handleSizeChange"
  167. @current-change="handleCurrentChange"
  168. :current-page="currentPage"
  169. :page-size="deptCircularPage.pageSize"
  170. layout="total, sizes, prev, pager, next, jumper"
  171. :total="deptBudgetTotal"
  172. >
  173. </el-pagination>
  174. <!-- 附件弹框 -->
  175. <WinseaContentModal
  176. v-model="accessoryTFs"
  177. :title="$t('system.noticeCircular.information')"
  178. @on-cancel="handleClose"
  179. >
  180. <p>查看附件</p>
  181. <ws-upload
  182. ref="upload"
  183. table-name="maintain_work_order"
  184. oss-key="mainPlan"
  185. :comp-id="compId"
  186. :appendix-ids="appendixIdsAdd"
  187. :vesselId="deptBudgetList.addressUrl"
  188. :size-limit="size"
  189. @uploadSuccess="uploadSuccess"
  190. accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
  191. />
  192. </WinseaContentModal>
  193. </div>
  194. </template>
  195. <script>
  196. import {
  197. getList,
  198. export1,
  199. editstatus,
  200. billoperatehis,
  201. deletecontract,
  202. } from '@/model/contarct/index'
  203. import { downloadFile } from '@/utils/batchDown'
  204. import Pagination from '@/components/Pagination'
  205. import WsUpload from '@/components/WsUpload'
  206. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  207. export default {
  208. name: 'viewSpareMoney',
  209. components: {
  210. WsUpload,
  211. Pagination,
  212. },
  213. watch: {
  214. vesselId(val) {
  215. this.getVesselData()
  216. },
  217. isShow(val) {
  218. this.showType = val
  219. },
  220. },
  221. data() {
  222. return {
  223. //弹出框
  224. dialogViewSpareMoney: false,
  225. dialogApproveFormVisible: false,
  226. // 船舶类型
  227. monetaryKey: null,
  228. // 表格显示数据
  229. tableDate: [],
  230. // 是否显示
  231. showType: true,
  232. // 年
  233. year: '',
  234. // 提交类型
  235. contractType: 1,
  236. currentPage: 1,
  237. pageSize: 10,
  238. searchType: 1,
  239. searchKeyWord: '',
  240. startDate: null,
  241. endDate: null,
  242. appendixIdsAdd: '',
  243. contractType: 1,
  244. currentPage: 1,
  245. pageSize: 10,
  246. searchType: 1,
  247. searchKeyWord: '',
  248. startDate: null,
  249. endDate: null,
  250. historyList: {},
  251. submitType: true,
  252. contractForm: {},
  253. categoryIndex: 0,
  254. rulesVendor: {},
  255. deptBudgetTotal: 0,
  256. size: 10,
  257. compId: sessionStorage.getItem('ws-pf_compId'),
  258. deptCircularPage: {},
  259. accessoryTFs: false,
  260. pickerBeginDateBefore: {
  261. disabledDate: (time) => {
  262. return time.getTime() > Date.now()
  263. },
  264. },
  265. tableData: [],
  266. taskTypeList: [
  267. { value: '未完成', type: 1 },
  268. { value: '已完成', type: 2 },
  269. { value: '待回款', type: 3 },
  270. { value: '全部合同', type: '' },
  271. ],
  272. deptBudgetList: {
  273. seafarerName: '',
  274. crtDutyId: '',
  275. crtDutyName: '',
  276. seafarerSexKey: '',
  277. mobilePhone: '',
  278. birthday: '',
  279. dutyId: '',
  280. dutyName: '',
  281. intendedShipId: '',
  282. intendedShipName: '',
  283. interviewPersons: '',
  284. interviewDates: '',
  285. interviewType: '',
  286. interviewResult: '1',
  287. interviewOpinion: '',
  288. aliasName: '',
  289. },
  290. searchTypeText: '未完成',
  291. }
  292. },
  293. activated() {
  294. this.deletecontract()
  295. this.getList()
  296. this.showType = this.isShow
  297. },
  298. methods: {
  299. handleClose() {
  300. this.accessoryTFs = false
  301. },
  302. history(row) {
  303. console.log(row)
  304. billoperatehis({ id: row.id })
  305. .toPromise()
  306. .then((response) => {
  307. this.historyList = response
  308. })
  309. },
  310. handleSizeChange(val) {
  311. console.log(`每页 ${val} 条`)
  312. this.pageSize = val
  313. this.getList()
  314. },
  315. handleCurrentChange(val) {
  316. this.currentPage = val
  317. console.log(`当前页: ${val}`)
  318. this.getList()
  319. },
  320. uploadSuccess(data, files, url) {
  321. console.log(data, files, url)
  322. // this.deptBudgetList.
  323. // this.formData.append('files', files)
  324. // this.feedbackObj.uploadNameAttachment = data.appendixName
  325. // this.feedbackObj.pathUploadAttachment = data.appendixPath
  326. // // this.newAppendixs = files
  327. // this.onChangeFlag = true
  328. },
  329. // deletecontract(){
  330. // deletecontract({
  331. // }).toPromise()
  332. // .then((response) => {
  333. // this.tableData = response
  334. // })
  335. // },
  336. getList() {
  337. getList({
  338. compId: sessionStorage.getItem('ws-pf_compId'),
  339. contractType: this.contractType,
  340. currentPage: this.currentPage,
  341. pageSize: this.pageSize,
  342. searchType: this.searchType,
  343. searchKeyWord: this.searchKeyWord,
  344. startDate: this.startDate,
  345. endDate: this.endDate,
  346. contrPage: this.contrPage,
  347. })
  348. .toPromise()
  349. .then((response) => {
  350. for (var i = 0; i < response.records.length; i++) {
  351. if (
  352. response.records[i].imperfectGrain != '' &&
  353. response.records[i].weight != ''
  354. ) {
  355. response.records[i].proportion =
  356. Math.floor(
  357. (response.records[i].imperfectGrain /
  358. response.records[i].weight) *
  359. 10000
  360. ) / 100
  361. } else {
  362. response.records[i].proportion = 0
  363. }
  364. }
  365. this.tableData = response
  366. this.deptCircularPage.currentPage = response.current
  367. this.deptCircularPage.pageSize = response.size
  368. this.deptBudgetTotal = response.total
  369. this.contractList = response
  370. })
  371. },
  372. // 上传附件
  373. uploadSuccess(data, files, url) {
  374. console.log(data, files, url)
  375. },
  376. // this.deptBudgetList.
  377. // this.formData.append('files', files)
  378. // this.feedbackObj.uploadNameAttachment = data.appendixName
  379. // this.feedbackObj.pathUploadAttachment = data.appendixPath
  380. // // this.newAppendixs = files
  381. // this.onChangeFlag = true
  382. selecttaskType(e) {
  383. for (var i = 0; i < this.taskTypeList.length; i++) {
  384. if (this.taskTypeList[i].value == e) {
  385. this.searchType = this.taskTypeList[i].type
  386. }
  387. }
  388. },
  389. find() {
  390. this.currentPage = 1
  391. this.getList()
  392. },
  393. editClick(row) {
  394. var status = ''
  395. if (row.status == '待执行' || row.status == '已完成') {
  396. status = '执行中'
  397. } else if (row.status == '执行中') {
  398. status = '已完成'
  399. }
  400. this.$confirm(`是否将状态改为${status}`, '提示', {
  401. confirmButtonText: '确定',
  402. cancelButtonText: '取消',
  403. type: 'warning',
  404. })
  405. .then(() => {
  406. editstatus({ id: row.id })
  407. .toPromise()
  408. .then((response) => {
  409. this.$notify.success({
  410. title: '成功',
  411. message: '状态修改成功',
  412. })
  413. this.getList()
  414. })
  415. .catch((response) => {
  416. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  417. })
  418. })
  419. .catch(() => {
  420. return false
  421. })
  422. },
  423. fujian(row) {
  424. if (
  425. row.receiveAttachmentPath === null ||
  426. row.receiveAttachmentPath === ''
  427. ) {
  428. EventBus.$emit(
  429. 'warning',
  430. this.$t('system.noticeCircular.NoInformation')
  431. )
  432. } else {
  433. this.accessoryTFs = true
  434. }
  435. this.appendixIdss = row.receiveAttachmentPath
  436. },
  437. // 关闭 dialog时 处理文件url 初始化upload组件
  438. handleExamine(row) {
  439. console.log(row)
  440. this.$router.push({
  441. name: 'salesContractExamine',
  442. query: { id: row.id, status: row.status },
  443. })
  444. },
  445. handleAdd() {
  446. this.$router.push({ path: 'salesContractAdd' })
  447. },
  448. deletecontract() {},
  449. filtlistQuery() {},
  450. searchDialog() {},
  451. vesselIdSelected() {},
  452. seelctShips() {},
  453. checkBtn() {},
  454. handleEdit(row) {
  455. this.$router.push({
  456. name: 'salesContractEdit',
  457. query: { id: row.id },
  458. })
  459. },
  460. approve() {},
  461. listQuery() {},
  462. total() {},
  463. clearfiltQuery() {},
  464. selectCrtDuty() {},
  465. handleDelete(row) {
  466. var handleDelete = ''
  467. if (row.handleDelete == '待执行' || row.handleDelete == '已完成') {
  468. handleDelete = '执行中'
  469. } else if (row.handleDelete == '执行中') {
  470. handleDelete = '已完成'
  471. }
  472. this.$confirm(`合同删除后不可恢复,是否继续删除?`, '提示', {
  473. confirmButtonText: '确定',
  474. cancelButtonText: '取消',
  475. type: 'warning',
  476. })
  477. .then(() => {
  478. deletecontract({ id: row.id })
  479. .toPromise()
  480. .then((response) => {
  481. this.$notify.success({
  482. title: '成功',
  483. message: '删除成功',
  484. })
  485. this.getList()
  486. })
  487. .catch((response) => {
  488. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  489. })
  490. })
  491. .catch(() => {
  492. return false
  493. })
  494. },
  495. },
  496. }
  497. </script>
  498. <style lang="scss" scoped>
  499. .el-pagination {
  500. padding: 10px 15px;
  501. margin-bottom: 0;
  502. text-align: right;
  503. }
  504. .typeselect {
  505. width: 500px;
  506. }
  507. .padding-xs {
  508. padding: 15px;
  509. text-align: right;
  510. }
  511. .clearfix:after {
  512. content: '';
  513. display: block;
  514. clear: both;
  515. }
  516. .taskType {
  517. width: 100%;
  518. background-color: #fff;
  519. margin-top: 2px;
  520. margin-bottom: 10px;
  521. list-style: none;
  522. // padding-bottom: 20px;
  523. li {
  524. float: left;
  525. border: 1px solid #6ea0f3;
  526. border-radius: 5px;
  527. max-width: 190px;
  528. padding: 0 5px;
  529. text-align: center;
  530. margin: 10px 20px;
  531. cursor: pointer;
  532. font-size: 14px;
  533. p {
  534. margin: 8px 0px;
  535. span {
  536. color: #e74c3c;
  537. }
  538. }
  539. }
  540. li:hover {
  541. background-color: #e4eeff;
  542. color: #1d6ced;
  543. }
  544. }
  545. .el-date-editor--date {
  546. margin: 0 10px;
  547. }
  548. .findValue {
  549. margin: 0 10px;
  550. }
  551. .button-container {
  552. display: flex;
  553. flex-wrap: nowrap;
  554. justify-content: space-between;
  555. align-items: center;
  556. background-color: #fff;
  557. width: 100%;
  558. height: 50px;
  559. padding: 0 10px;
  560. & > div {
  561. margin-left: 10px;
  562. display: flex;
  563. flex-wrap: nowrap;
  564. flex-direction: row;
  565. & > span {
  566. line-height: 50px;
  567. }
  568. }
  569. /deep/.auditFlow-box {
  570. position: unset;
  571. margin-left: 10px;
  572. &/deep/.auditFlow-icon {
  573. width: auto;
  574. padding-right: 30px;
  575. }
  576. &/deep/.auditFlow-main {
  577. position: absolute;
  578. }
  579. }
  580. }
  581. .vertical-line {
  582. height: 100px;
  583. border-left: 2px solid;
  584. margin-left: 4px;
  585. }
  586. .vertical-circle {
  587. float: left;
  588. width: 10px;
  589. height: 10px;
  590. border: 2px solid white;
  591. background-color: #08b8e6;
  592. -webkit-border-radius: 100px;
  593. }
  594. .vertical-circle:first-child {
  595. color: red;
  596. }
  597. .vertical-text {
  598. float: left;
  599. margin-top: -7px;
  600. }
  601. .box-app {
  602. display: inline-block;
  603. float: left;
  604. margin-left: 30px;
  605. line-height: 50px;
  606. }
  607. /deep/.el-dialog {
  608. .el-form-item {
  609. margin-bottom: 0 !important;
  610. .el-input--medium {
  611. textarea {
  612. min-height: 100px !important;
  613. }
  614. }
  615. }
  616. }
  617. .collapse-bottom {
  618. margin-bottom: 20px;
  619. }
  620. .input-main .textarea .el-textarea__inner {
  621. width: 100%;
  622. z-index: 1;
  623. }
  624. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  625. /* height: 82px;*/
  626. /*}*/
  627. // 控制select为只读的时候显示样式
  628. .hide-sel {
  629. .el-input__inner {
  630. border: 0px;
  631. }
  632. .el-icon-arrow-up {
  633. display: none;
  634. }
  635. .el-textarea__inner {
  636. background-color: #fff !important;
  637. border: 0;
  638. }
  639. .el-date-editor {
  640. i {
  641. display: none;
  642. }
  643. }
  644. .is-disabled {
  645. .el-input__inner:hover {
  646. background-color: #fff !important;
  647. border: 0;
  648. }
  649. color: #606266;
  650. .el-input__inner {
  651. background-color: #fff !important;
  652. border: 0;
  653. color: #606266;
  654. }
  655. .el-textarea__inner {
  656. background-color: #fff !important;
  657. border: 0;
  658. color: #606266;
  659. }
  660. }
  661. }
  662. // 控制select为只读的时候显示样式
  663. /deep/.ws-class-table-col {
  664. height: auto;
  665. padding: 0px 2px;
  666. /deep/.el-input__inner {
  667. padding: 0px 2px;
  668. }
  669. }
  670. /deep/.is-disabled {
  671. .el-input__prefix,
  672. .el-input__suffix {
  673. display: none;
  674. }
  675. .el-input__inner {
  676. background-color: #fff;
  677. border-color: #fff !important;
  678. color: #000 !important;
  679. font-size: 14px;
  680. cursor: text;
  681. padding: 0 !important;
  682. }
  683. }
  684. /deep/.el-table .el-table__header .cell,
  685. /deep/.el-table .el-table__body .cell {
  686. text-align: center;
  687. }
  688. </style>