purchaseContract.vue 14 KB

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