purchaseContract.vue 14 KB

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