purchaseContract.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  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. <!-- 附件弹框 -->
  152. <!-- <WinseaContentModal
  153. v-model="accessoryTFs"
  154. :title="$t('system.noticeCircular.information')"
  155. @on-cancel="handleClose"
  156. >
  157. <ws-upload
  158. ref="uploads"
  159. table-name="ism_circular_management_info "
  160. :vesselId="my_vesselId ? my_vesselId : ''"
  161. oss-key="circularLetter"
  162. :editable="false"
  163. :appendix-ids="appendixIdss"
  164. :comp-id="compId"
  165. />
  166. <template slot="footer" class="dialog-footer">
  167. <ws-button @click="hiddenHistory">{{
  168. $t('crew.interviewManagement.button.cancel')
  169. }}</ws-button>
  170. </template>
  171. </WinseaContentModal> -->
  172. </div>
  173. </template>
  174. <script>
  175. import {
  176. getList,
  177. export1,
  178. editstatus,
  179. billoperatehis,
  180. deletecontract,
  181. } from '@/model/contarct/index'
  182. import { downloadFile } from '@/utils/batchDown'
  183. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  184. export default {
  185. name: 'viewSpareMoney',
  186. watch: {
  187. vesselId(val) {
  188. this.getList()
  189. },
  190. isShow(val) {
  191. this.showType = val
  192. },
  193. },
  194. data() {
  195. return {
  196. //弹出框
  197. dialogViewSpareMoney: false,
  198. dialogApproveFormVisible: false,
  199. // 船舶类型
  200. monetaryKey: null,
  201. // 表格显示数据
  202. tableDate: [],
  203. // 是否显示
  204. showType: true,
  205. // 年
  206. year: '',
  207. currentPage: 1,
  208. pageSize: 10,
  209. searchType: 1,
  210. searchTypeText: '未完成',
  211. searchKeyWord: '',
  212. contractType: 2,
  213. startDate: null,
  214. endDate: null,
  215. // 提交类型
  216. submitType: true,
  217. date: {
  218. year: dayjs().format('YYYY'),
  219. month: dayjs().format('MM'),
  220. },
  221. contractList: [],
  222. deptBudgetList: {},
  223. historyList: [],
  224. pickerBeginDateBefore: {
  225. disabledDate: (time) => {
  226. return time.getTime() > Date.now()
  227. },
  228. },
  229. accessoryTFs: false,
  230. taskTypeList: [
  231. { value: '未完成', type: 1 },
  232. { value: '已完成', type: 2 },
  233. { value: '全部合同', type: '' },
  234. ],
  235. }
  236. },
  237. activated() {
  238. //cg.viewBudget
  239. //cg.viewSpareMoney
  240. // this.getVesselData();
  241. this.getList()
  242. this.showType = this.isShow
  243. },
  244. methods: {
  245. getList() {
  246. getList({
  247. compId: sessionStorage.getItem('ws-pf_compId'),
  248. contractType: this.contractType,
  249. currentPage: this.currentPage,
  250. pageSize: this.pageSize,
  251. searchType: this.searchType,
  252. searchKeyWord: this.searchKeyWord,
  253. startDate: this.startDate,
  254. endDate: this.endDate,
  255. contrPage: this.contrPage,
  256. })
  257. .toPromise()
  258. .then((response) => {
  259. this.contractList = response
  260. })
  261. },
  262. editClick(row) {
  263. var status = ''
  264. if (row.status == '待执行' || row.status == '已完成') {
  265. status = '执行中'
  266. } else if (row.status == '执行中') {
  267. status = '已完成'
  268. }
  269. this.$confirm(`是否将状态改为${status}`, '提示', {
  270. confirmButtonText: '确定',
  271. cancelButtonText: '取消',
  272. type: 'warning',
  273. })
  274. .then(() => {
  275. editstatus({ id: row.id })
  276. .toPromise()
  277. .then((response) => {
  278. this.$notify.success({
  279. title: '成功',
  280. message: '状态修改成功',
  281. })
  282. this.getList()
  283. })
  284. .catch((response) => {
  285. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  286. })
  287. })
  288. .catch(() => {
  289. return false
  290. })
  291. },
  292. selecttaskType(e) {
  293. for (var i = 0; i < this.taskTypeList.length; i++) {
  294. if (this.taskTypeList[i].value == e) {
  295. this.searchType = this.taskTypeList[i].type
  296. }
  297. }
  298. },
  299. fujian() {
  300. if (
  301. row.receiveAttachmentPath === null ||
  302. row.receiveAttachmentPath === ''
  303. ) {
  304. EventBus.$emit(
  305. 'warning',
  306. this.$t('system.noticeCircular.NoInformation')
  307. )
  308. } else {
  309. this.accessoryTFs = true
  310. }
  311. this.appendixIdss = row.receiveAttachmentPath
  312. },
  313. handleExamine(row) {
  314. console.log(row)
  315. this.$router.push({
  316. name: 'purchaseContractExamine',
  317. params: { id: row.id },
  318. })
  319. },
  320. handleAdd() {
  321. this.$router.push({ path: 'purchaseContractAdd' })
  322. },
  323. handleEdit(row) {
  324. this.$router.push({
  325. name: 'purchaseContractEdit',
  326. params: { id: row.id },
  327. })
  328. },
  329. // 关闭 dialog时 处理文件url 初始化upload组件
  330. handleCloe() {
  331. this.dialogViewSpareMoney = false
  332. },
  333. history(row) {
  334. console.log(row)
  335. billoperatehis({ id: row.id })
  336. .toPromise()
  337. .then((response) => {
  338. this.historyList = response
  339. })
  340. },
  341. find() {
  342. this.getList()
  343. },
  344. async exportlist() {
  345. const { data } = await export1(
  346. {
  347. compId: sessionStorage.getItem('ws-pf_compId'),
  348. contractType: this.contractType,
  349. currentPage: this.currentPage,
  350. pageSize: this.pageSize,
  351. searchType: this.searchType,
  352. searchKeyWord: this.searchKeyWord,
  353. startDate: this.startDate,
  354. endDate: this.endDate,
  355. },
  356. {},
  357. { responseType: 'blob' }
  358. ).toPromise()
  359. downloadFile({
  360. res: data,
  361. fileName: `${
  362. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  363. }_采购合同`,
  364. type: 'xls',
  365. })
  366. },
  367. // deletecontract(){},
  368. //删除
  369. handleDelete(row){
  370. var handleDelete = ' '//sfdkd
  371. if (row.handleDelete == '待执行' || row.handleDelete == '已完成') {
  372. handleDelete = '执行中'
  373. } else if (row.handleDelete == '执行中') {
  374. handleDelete = '已完成'
  375. }
  376. this.$confirm(`合同删除后不可恢复,是否继续删除?`, '提示', {
  377. confirmButtonText: '确定',
  378. cancelButtonText: '取消',
  379. type: 'warning',
  380. })
  381. .then(() => {
  382. deletecontract({id: row.id })
  383. .toPromise()
  384. .then((response) => {
  385. this.$notify.success({
  386. title: '成功',
  387. message: '删除成功',
  388. })
  389. this.getList()
  390. })
  391. .catch((response) => {
  392. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  393. })
  394. })
  395. .catch(() => {
  396. return false
  397. })
  398. }
  399. },
  400. }
  401. </script>
  402. <style lang="scss" scoped>
  403. .vertical-line {
  404. height: 100px;
  405. border-left: 2px solid;
  406. margin-left: 4px;
  407. // border-image: -webkit-linear-gradient(#00eba7, #08b8e6) 30 30;
  408. // border-image: -moz-linear-gradient(#00eba7, #08b8e6) 30 30;
  409. // border-image: linear-gradient(#00eba7, #08b8e6) 30 30;
  410. }
  411. .vertical-circle {
  412. float: left;
  413. width: 10px;
  414. height: 10px;
  415. border: 2px solid white;
  416. background-color: #08b8e6;
  417. -webkit-border-radius: 100px;
  418. }
  419. .vertical-circle:first-child {
  420. color: red;
  421. }
  422. .vertical-text {
  423. float: left;
  424. margin-top: -7px;
  425. }
  426. /deep/.el-table .el-table__header .cell,
  427. /deep/.el-table .el-table__body .cell {
  428. text-align: center;
  429. }
  430. .typeselect {
  431. width: 500px;
  432. }
  433. .padding-xs {
  434. padding: 15px;
  435. text-align: right;
  436. }
  437. .clearfix:after {
  438. content: '';
  439. display: block;
  440. clear: both;
  441. }
  442. .el-table {
  443. font-size: 16px;
  444. }
  445. .taskType {
  446. width: 100%;
  447. background-color: #fff;
  448. margin-top: 2px;
  449. margin-bottom: 10px;
  450. list-style: none;
  451. // padding-bottom: 20px;
  452. li {
  453. float: left;
  454. border: 1px solid #6ea0f3;
  455. border-radius: 5px;
  456. max-width: 190px;
  457. padding: 0 5px;
  458. text-align: center;
  459. margin: 10px 20px;
  460. cursor: pointer;
  461. font-size: 14px;
  462. p {
  463. margin: 8px 0px;
  464. span {
  465. color: #e74c3c;
  466. }
  467. }
  468. }
  469. li:hover {
  470. background-color: #e4eeff;
  471. color: #1d6ced;
  472. }
  473. }
  474. .el-date-editor--date {
  475. margin: 0 10px;
  476. }
  477. .findValue {
  478. margin: 0 10px;
  479. }
  480. .button-container {
  481. display: flex;
  482. flex-wrap: nowrap;
  483. justify-content: space-between;
  484. align-items: center;
  485. background-color: #fff;
  486. width: 100%;
  487. height: 50px;
  488. padding: 0 10px;
  489. & > div {
  490. margin-left: 10px;
  491. display: flex;
  492. flex-wrap: nowrap;
  493. flex-direction: row;
  494. & > span {
  495. line-height: 50px;
  496. }
  497. }
  498. /deep/.auditFlow-box {
  499. position: unset;
  500. margin-left: 10px;
  501. &/deep/.auditFlow-icon {
  502. width: auto;
  503. padding-right: 30px;
  504. }
  505. &/deep/.auditFlow-main {
  506. position: absolute;
  507. }
  508. }
  509. }
  510. .box-app {
  511. display: inline-block;
  512. float: left;
  513. margin-left: 30px;
  514. line-height: 50px;
  515. }
  516. /deep/.el-dialog {
  517. .el-form-item {
  518. margin-bottom: 0 !important;
  519. .el-input--medium {
  520. textarea {
  521. min-height: 100px !important;
  522. }
  523. }
  524. }
  525. }
  526. .collapse-bottom {
  527. margin-bottom: 20px;
  528. }
  529. .input-main .textarea .el-textarea__inner {
  530. width: 100%;
  531. z-index: 1;
  532. }
  533. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  534. /* height: 82px;*/
  535. /*}*/
  536. // 控制select为只读的时候显示样式
  537. .hide-sel {
  538. .el-input__inner {
  539. border: 0px;
  540. }
  541. .el-icon-arrow-up {
  542. display: none;
  543. }
  544. .el-textarea__inner {
  545. background-color: #fff !important;
  546. border: 0;
  547. }
  548. .el-date-editor {
  549. i {
  550. display: none;
  551. }
  552. }
  553. .is-disabled {
  554. .el-input__inner:hover {
  555. background-color: #fff !important;
  556. border: 0;
  557. }
  558. color: #606266;
  559. .el-input__inner {
  560. background-color: #fff !important;
  561. border: 0;
  562. color: #606266;
  563. }
  564. .el-textarea__inner {
  565. background-color: #fff !important;
  566. border: 0;
  567. color: #606266;
  568. }
  569. }
  570. }
  571. // 控制select为只读的时候显示样式
  572. /deep/.ws-class-table-col {
  573. height: auto;
  574. padding: 0px 2px;
  575. /deep/.el-input__inner {
  576. padding: 0px 2px;
  577. }
  578. }
  579. /deep/.is-disabled {
  580. .el-input__prefix,
  581. .el-input__suffix {
  582. display: none;
  583. }
  584. .el-input__inner {
  585. background-color: #fff;
  586. border-color: #fff !important;
  587. color: #000 !important;
  588. font-size: 14px;
  589. cursor: text;
  590. padding: 0 !important;
  591. }
  592. }
  593. </style>