purchaseContract.vue 15 KB

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