purchaseContract.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  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. @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.getVesselData()
  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. mounted() {
  236. //cg.viewBudget
  237. //cg.viewSpareMoney
  238. // this.getVesselData();
  239. this.getList()
  240. this.showType = this.isShow
  241. },
  242. methods: {
  243. getList() {
  244. getList({
  245. compId: sessionStorage.getItem('ws-pf_compId'),
  246. contractType: this.contractType,
  247. currentPage: this.currentPage,
  248. pageSize: this.pageSize,
  249. searchType: this.searchType,
  250. searchKeyWord: this.searchKeyWord,
  251. startDate: this.startDate,
  252. endDate: this.endDate,
  253. contrPage:this.contrPage,
  254. })
  255. .toPromise()
  256. .then((response) => {
  257. this.contractList = response
  258. })
  259. },
  260. editClick(row) {
  261. var status = ''
  262. if (row.status == '待执行' || row.status == '已完成') {
  263. status = '执行中'
  264. } else if (row.status == '执行中') {
  265. status = '已完成'
  266. }
  267. this.$confirm(`是否将状态改为${status}`, '提示', {
  268. confirmButtonText: '确定',
  269. cancelButtonText: '取消',
  270. type: 'warning',
  271. })
  272. .then(() => {
  273. editstatus({ id: row.id })
  274. .toPromise()
  275. .then((response) => {
  276. this.$notify.success({
  277. title: '成功',
  278. message: '状态修改成功',
  279. })
  280. this.getList()
  281. })
  282. .catch((response) => {
  283. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  284. })
  285. })
  286. .catch(() => {
  287. return false
  288. })
  289. },
  290. selecttaskType(e) {
  291. for (var i = 0; i < this.taskTypeList.length; i++) {
  292. if (this.taskTypeList[i].value == e) {
  293. this.searchType = this.taskTypeList[i].type
  294. }
  295. }
  296. },
  297. fujian() {
  298. if (
  299. row.receiveAttachmentPath === null ||
  300. row.receiveAttachmentPath === ''
  301. ) {
  302. EventBus.$emit(
  303. 'warning',
  304. this.$t('system.noticeCircular.NoInformation')
  305. )
  306. } else {
  307. this.accessoryTFs = true
  308. }
  309. this.appendixIdss = row.receiveAttachmentPath
  310. },
  311. handleExamine(row) {
  312. console.log(row)
  313. this.$router.push({
  314. name: 'purchaseContractExamine',
  315. params: { id: row.id },
  316. })
  317. },
  318. handleAdd() {
  319. this.$router.push({ path: 'purchaseContractAdd' })
  320. },
  321. handleEdit(row) {
  322. this.$router.push({ path: 'purchaseContractEdit' })
  323. },
  324. // 关闭 dialog时 处理文件url 初始化upload组件
  325. handleCloe() {
  326. this.dialogViewSpareMoney = false
  327. },
  328. history(row) {
  329. console.log(row)
  330. billoperatehis({ id: row.id })
  331. .toPromise()
  332. .then((response) => {
  333. this.historyList = response
  334. })
  335. },
  336. find() {
  337. this.getList()
  338. },
  339. async exportlist() {
  340. const { data } = await export1(
  341. {
  342. compId: sessionStorage.getItem('ws-pf_compId'),
  343. contractType: this.contractType,
  344. currentPage: this.currentPage,
  345. pageSize: this.pageSize,
  346. searchType: this.searchType,
  347. searchKeyWord: this.searchKeyWord,
  348. startDate: this.startDate,
  349. endDate: this.endDate,
  350. },
  351. {},
  352. { responseType: 'blob' }
  353. ).toPromise()
  354. downloadFile({
  355. res: data,
  356. fileName: `${
  357. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  358. }_采购合同`,
  359. type: 'xls',
  360. })
  361. },
  362. },
  363. }
  364. </script>
  365. <style lang="scss" scoped>
  366. .vertical-line {
  367. height: 100px;
  368. border-left: 2px solid;
  369. margin-left: 4px;
  370. // border-image: -webkit-linear-gradient(#00eba7, #08b8e6) 30 30;
  371. // border-image: -moz-linear-gradient(#00eba7, #08b8e6) 30 30;
  372. // border-image: linear-gradient(#00eba7, #08b8e6) 30 30;
  373. }
  374. .vertical-circle {
  375. float: left;
  376. width: 10px;
  377. height: 10px;
  378. border: 2px solid white;
  379. background-color: #08b8e6;
  380. -webkit-border-radius: 100px;
  381. }
  382. .vertical-circle:first-child {
  383. color: red;
  384. }
  385. .vertical-text {
  386. float: left;
  387. margin-top: -7px;
  388. }
  389. /deep/.el-table .el-table__header .cell,
  390. /deep/.el-table .el-table__body .cell {
  391. text-align: center;
  392. }
  393. .typeselect {
  394. width: 500px;
  395. }
  396. .padding-xs {
  397. padding: 15px;
  398. text-align: right;
  399. }
  400. .clearfix:after {
  401. content: '';
  402. display: block;
  403. clear: both;
  404. }
  405. .el-table {
  406. font-size: 16px;
  407. }
  408. .taskType {
  409. width: 100%;
  410. background-color: #fff;
  411. margin-top: 2px;
  412. margin-bottom: 10px;
  413. list-style: none;
  414. // padding-bottom: 20px;
  415. li {
  416. float: left;
  417. border: 1px solid #6ea0f3;
  418. border-radius: 5px;
  419. max-width: 190px;
  420. padding: 0 5px;
  421. text-align: center;
  422. margin: 10px 20px;
  423. cursor: pointer;
  424. font-size: 14px;
  425. p {
  426. margin: 8px 0px;
  427. span {
  428. color: #e74c3c;
  429. }
  430. }
  431. }
  432. li:hover {
  433. background-color: #e4eeff;
  434. color: #1d6ced;
  435. }
  436. }
  437. .el-date-editor--date {
  438. margin: 0 10px;
  439. }
  440. .findValue {
  441. margin: 0 10px;
  442. }
  443. .button-container {
  444. display: flex;
  445. flex-wrap: nowrap;
  446. justify-content: space-between;
  447. align-items: center;
  448. background-color: #fff;
  449. width: 100%;
  450. height: 50px;
  451. padding: 0 10px;
  452. & > div {
  453. margin-left: 10px;
  454. display: flex;
  455. flex-wrap: nowrap;
  456. flex-direction: row;
  457. & > span {
  458. line-height: 50px;
  459. }
  460. }
  461. /deep/.auditFlow-box {
  462. position: unset;
  463. margin-left: 10px;
  464. &/deep/.auditFlow-icon {
  465. width: auto;
  466. padding-right: 30px;
  467. }
  468. &/deep/.auditFlow-main {
  469. position: absolute;
  470. }
  471. }
  472. }
  473. .box-app {
  474. display: inline-block;
  475. float: left;
  476. margin-left: 30px;
  477. line-height: 50px;
  478. }
  479. /deep/.el-dialog {
  480. .el-form-item {
  481. margin-bottom: 0 !important;
  482. .el-input--medium {
  483. textarea {
  484. min-height: 100px !important;
  485. }
  486. }
  487. }
  488. }
  489. .collapse-bottom {
  490. margin-bottom: 20px;
  491. }
  492. .input-main .textarea .el-textarea__inner {
  493. width: 100%;
  494. z-index: 1;
  495. }
  496. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  497. /* height: 82px;*/
  498. /*}*/
  499. // 控制select为只读的时候显示样式
  500. .hide-sel {
  501. .el-input__inner {
  502. border: 0px;
  503. }
  504. .el-icon-arrow-up {
  505. display: none;
  506. }
  507. .el-textarea__inner {
  508. background-color: #fff !important;
  509. border: 0;
  510. }
  511. .el-date-editor {
  512. i {
  513. display: none;
  514. }
  515. }
  516. .is-disabled {
  517. .el-input__inner:hover {
  518. background-color: #fff !important;
  519. border: 0;
  520. }
  521. color: #606266;
  522. .el-input__inner {
  523. background-color: #fff !important;
  524. border: 0;
  525. color: #606266;
  526. }
  527. .el-textarea__inner {
  528. background-color: #fff !important;
  529. border: 0;
  530. color: #606266;
  531. }
  532. }
  533. }
  534. // 控制select为只读的时候显示样式
  535. /deep/.ws-class-table-col {
  536. height: auto;
  537. padding: 0px 2px;
  538. /deep/.el-input__inner {
  539. padding: 0px 2px;
  540. }
  541. }
  542. /deep/.is-disabled {
  543. .el-input__prefix,
  544. .el-input__suffix {
  545. display: none;
  546. }
  547. .el-input__inner {
  548. background-color: #fff;
  549. border-color: #fff !important;
  550. color: #000 !important;
  551. font-size: 14px;
  552. cursor: text;
  553. padding: 0 !important;
  554. }
  555. }
  556. </style>