purchaseContract.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047
  1. <!--现货采购合同-->
  2. <!--2019年5月30日 20:25:16 by jlx-->
  3. <template>
  4. <div>
  5. <BaseHeaderLayout :leftSpan="8">
  6. <template slot="left">
  7. <ws-button type="primary" @click="handleAdd()"
  8. v-hasPermission="`contractManagement.buyContract.buyContractInfo.add`">添加</ws-button>
  9. <ws-button @click="exportlist()" v-hasPermission="
  10. `contractManagement.buyContract.buyContractInfo.view`
  11. ">导出</ws-button>
  12. </template>
  13. <template slot="right">
  14. <span style="width: 142px; display: inline-block; color: #8890b1">状态:</span>
  15. <ws-select v-model="searchTypeText" placeholder="" class="typeselect" @change="selecttaskType"
  16. :value="searchType">
  17. <ws-option v-for="item in taskTypeList" :key="item.value" :label="item.value" :value="item.value"
  18. style="color: #8890b1" />
  19. </ws-select>
  20. <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels range-separator="至"
  21. start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
  22. </el-date-picker>
  23. <el-input v-model="searchKeyWord" placeholder="可按照合同编号、买方名称、卖方名称进行查找" clearable maxlength="500" type="input"
  24. class="findValue" @keyup.enter.native="find()"></el-input>
  25. <ws-button class="find" type="primary" @click="find()"><img width="16" height="16" style="
  26. vertical-align: text-top;
  27. position: relative;
  28. top: 0px;
  29. left: -8px;
  30. " src="../../../public/img/sousuo.png" alt="" /></ws-button>
  31. </template>
  32. </BaseHeaderLayout>
  33. <el-table class="wenzi" :data="contractList.records" style="width: 100%; margin-top: 10px"
  34. height="calc(100% - 105px)">
  35. <el-table-column type="index" label="序号">
  36. <template scope="scope">
  37. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  38. <span v-else>{{ scope.$index + 1 }}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column prop="contractNo" label="合同编号" width="150">
  42. </el-table-column>
  43. <el-table-column prop="goodsName" label="货名" width="80">
  44. </el-table-column>
  45. <!-- <el-table-column prop="grade" label="品级" width="80">
  46. <template slot-scope="scope">
  47. <span v-if="scope.row.grade == '一等品'" class="top-grade">{{
  48. scope.row.grade
  49. }}</span>
  50. <span v-if="scope.row.grade == '二等品'" class="second-class">{{
  51. scope.row.grade
  52. }}</span>
  53. <span v-if="scope.row.grade == '三等品'" class="third-class">{{
  54. scope.row.grade
  55. }}</span>
  56. <span v-if="scope.row.grade == '等外'" class="substandard">{{
  57. scope.row.grade
  58. }}</span>
  59. </template>
  60. </el-table-column> -->
  61. <el-table-column prop="weight" label="重量(吨)"> </el-table-column>
  62. <el-table-column width='130' prop="unitContractPrice" label="合同单价(元)">
  63. </el-table-column>
  64. <!-- <el-table-column prop="packingMethod" label="包装方式"> </el-table-column> -->
  65. <el-table-column prop="buyer" label="买方"> </el-table-column>
  66. <el-table-column prop="seller" label="卖方"> </el-table-column>
  67. <el-table-column width='120' prop="completedQuantity" label="已完成(吨)">
  68. <template slot-scope="scope">
  69. <span style="color: #5473e8; font-weight: 600">{{
  70. scope.row.completedQuantity
  71. }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column width='150' prop="status" label="状态">
  75. <template slot-scope="scope">
  76. <div v-if="scope.row.status != '执行中'&&scope.row.status != '发运结束'">
  77. <!-- <span v-if="scope.row.approveStatus">{{
  78. scope.row.approveStatus
  79. }}</span> -->
  80. <el-select v-if="scope.row.approveStatus" v-model="scope.row.approveStatus" placeholder="" class="statusselect"
  81. @change='selectstatuschange($event,scope.row)'
  82. disabled
  83. :value="scope.row.approveStatus">
  84. <el-option label="待决策人审核" value="待决策人审核"
  85. style="color: #8890b1" />
  86. </el-select>
  87. <el-select v-else v-model="scope.row.status" placeholder="" class="statusselect"
  88. :disabled="scope.row.status=='已完成'||scope.row.status=='已结算'||scope.row.status=='已驳回'"
  89. @change='selectstatuschange($event,scope.row)'
  90. :value="scope.row.status">
  91. <el-option label="待执行" value="待执行"
  92. style="color: #8890b1" />
  93. <el-option label="执行中" value="执行中"
  94. style="color: #8890b1" />
  95. </el-select>
  96. <!-- <el-popover v-else placement="left" :width="285" trigger="click" visible-arrow="false"
  97. @show="history(scope.row)">
  98. <template>
  99. <span slot="reference">
  100. <span v-if="scope.row.status == '待执行'" class="executory"></span>
  101. <span v-if="scope.row.status == '执行中'" class="inExecution"></span>
  102. <span v-if="scope.row.status == '已完成'" class="done"></span>{{ scope.row.status }}
  103. </span>
  104. </template>
  105. <div>
  106. <p style="margin-top: 0; padding-left: 10px">操作历史</p>
  107. <div v-for="(item, index) in historyList" class="flex">
  108. <div class="vertical-text vertical-text-left">
  109. {{ item.updateDate }}
  110. </div>
  111. <div>
  112. <div class="vertical-circle"></div>
  113. <div v-if="index != historyList.length - 1" class="vertical-line"></div>
  114. </div>
  115. <div class="vertical-text">
  116. {{ item.operateUser }}<br />{{ item.dealMsg }}
  117. </div>
  118. </div>
  119. </div>
  120. </el-popover>
  121. <img v-if="!scope.row.approveStatus" width="17" height="18"
  122. style="vertical-align: text-top; position: relative; top: -1px;" src="../../../public/img/edit.png"
  123. @click="editClick(scope.row)" alt="" /> -->
  124. </div>
  125. <div v-else>
  126. <!-- {{scope.row.status}} -->
  127. <el-select v-model="scope.row.status" placeholder="" class="statusselect"
  128. @change='selectstatuschange($event,scope.row)'
  129. :value="scope.row.status"
  130. >
  131. <el-option v-for="item in statusList" :key="item.value" :label="item.value" :value="item.value"
  132. style="color: #8890b1" />
  133. </el-select>
  134. </div>
  135. </template>
  136. </el-table-column>
  137. <el-table-column width='120' prop="signingDate" label="签订日期"> </el-table-column>
  138. <el-table-column width='120' prop="contractExpenditure" label="合同支出"> </el-table-column>
  139. <el-table-column width='120' prop="expenses" label="费用支出"> </el-table-column>
  140. <el-table-column width='130' prop="mildewGrain" label="已付款(元)">
  141. </el-table-column>
  142. <el-table-column prop="amountEdPayable" label="已付运费"> </el-table-column>
  143. <el-table-column width='130' prop="goodsNames" label="已开发票 (元)">
  144. </el-table-column>
  145. <el-table-column prop="addressUrl" label="附件">
  146. <template slot-scope="scope">
  147. <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
  148. src="../../../public/img/fujian.png" @click="fujian(scope.row)" alt="" />
  149. <span v-if="scope.row.addressUrlArray != null">
  150. {{
  151. scope.row.addressUrlArray.length == 0
  152. ? ''
  153. : scope.row.addressUrlArray.length
  154. }}
  155. </span>
  156. </template>
  157. </el-table-column>
  158. <el-table-column prop="address" label="操作" width="160">
  159. <template slot-scope="scope">
  160. <!-- <img width="16" height="17" style="
  161. vertical-align: text-top;
  162. position: relative;
  163. top: -1px;
  164. margin: 0 6px;
  165. " src="../../../public/img/daichu.png"
  166. v-hasPermission="
  167. `contractManagement.nonContract.nonContractInfo.view`"
  168. @click="handlecost(scope.row)" alt="" /> -->
  169. <img width="16" height="16" style="vertical-align: text-top; margin: 0 6px"
  170. src="../../../public/img/chakan.png" @click="handleExamine(scope.row)" v-hasPermission="
  171. `contractManagement.buyContract.buyContractInfo.view`
  172. " alt="" />
  173. <div v-if="
  174. (scope.row.approveStatus != '待决策人审核' &&
  175. !scope.row.approveStatus)
  176. " style="display: inline-block">
  177. <img width="17" height="16" style="vertical-align: text-top; margin: 0 6px"
  178. src="../../../public/img/bianji.png" @click="handleEdit(scope.row)" v-hasPermission="
  179. `contractManagement.buyContract.buyContractInfo.edit`
  180. " alt="" />
  181. </div>
  182. <img width="16" height="17" style="
  183. vertical-align: text-top;
  184. position: relative;
  185. top: -1px;
  186. margin: 0 6px;
  187. " v-if="scope.row.status == '待执行'||scope.row.status == '已驳回'" src="../../../public/img/shanchu.png"
  188. v-hasPermission="
  189. `contractManagement.buyContract.buyContractInfo.delete`
  190. " @click="handleDelete(scope.row)" alt="" />
  191. </template>
  192. </el-table-column>
  193. </el-table>
  194. <el-pagination :page-sizes="[10, 30, 50, 100, 500, 1000, 9999]" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  195. :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
  196. </el-pagination>
  197. <WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
  198. @on-cancel="handleClose">
  199. <div v-if="applstatus">
  200. <ws-upload ref="upload" :size-limit="size" @onChange="onChange" :comp-id="compId" :appendix-ids="appendixIdss"
  201. accept=".jpg, .jpeg, .png, .pdf, .doc, .docx, .zip, .rar"
  202. v-hasPermission="`contractManagement.buyContract.buyContractInfo.appl`"
  203. />
  204. </div>
  205. <ws-upload v-else ref="upload" :comp-id="compId" :appendix-ids="appendixIdss" :editable="false"
  206. accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
  207. </WinseaContentModal>
  208. </div>
  209. </template>
  210. <script>
  211. import {
  212. getList,
  213. export1,
  214. editstatus,
  215. billoperatehis,
  216. deletecontract,
  217. editInfo,
  218. getsettlementprice
  219. } from '@/model/contarct/index'
  220. import {
  221. downloadFile
  222. } from '@/utils/batchDown'
  223. import { hasPermission } from '../../utils/getHasPermission'
  224. import Pagination from '@/components/Pagination'
  225. import WsUpload from '@/components/WsUpload'
  226. import {
  227. dayjs,
  228. EventBus
  229. } from 'base-core-lib'
  230. export default {
  231. name: 'viewSpareMoney',
  232. components: {
  233. WsUpload,
  234. Pagination,
  235. },
  236. watch: {
  237. vesselId(val) {
  238. this.getList()
  239. },
  240. isShow(val) {
  241. this.showType = val
  242. },
  243. },
  244. data() {
  245. return {
  246. id: '',
  247. //弹出框
  248. dialogViewSpareMoney: false,
  249. dialogApproveFormVisible: false,
  250. // 船舶类型
  251. monetaryKey: null,
  252. // 表格显示数据
  253. tableDate: [],
  254. size: 10,
  255. statusList:[{
  256. value:'已完成',
  257. },{value:'发运结束',}],
  258. // 是否显示
  259. showType: true,
  260. // 年
  261. year: '',
  262. deliver_type: 1,
  263. deptBudgetTotal: 0,
  264. currentPage: 1,
  265. pageSize: 9999,
  266. appendixIdsAdd: '',
  267. searchType: 1,
  268. searchTypeText: '未完成',
  269. searchKeyWord: '',
  270. contractType: 2,
  271. goodsType: 1,
  272. startDate: null,
  273. endDate: null,
  274. addressUrls: [],
  275. accesscard: false,
  276. // 提交类型
  277. submitType: true,
  278. deptCircularPage: {},
  279. date: {
  280. year: dayjs().format('YYYY'),
  281. month: dayjs().format('MM'),
  282. },
  283. contractList: [],
  284. deptBudgetList: {},
  285. historyList: [],
  286. appendixIdss: [],
  287. fileList: [],
  288. compId: localStorage.getItem('ws-pf_compId'),
  289. pickerBeginDateBefore: {
  290. disabledDate: (time) => {
  291. return time.getTime() > Date.now()
  292. },
  293. },
  294. accessoryTFs: false,
  295. taskTypeList: [{
  296. value: '未完成',
  297. type: 1,
  298. },
  299. {
  300. value: '已完成',
  301. type: 2,
  302. },
  303. {
  304. value: '全部合同',
  305. type: '',
  306. },
  307. ],
  308. pickerOptions: {
  309. shortcuts: [{
  310. text: '本周',
  311. onClick(picker) {
  312. const end = new Date()
  313. const start = new Date()
  314. var thisDay = start.getDay()
  315. var thisDate = start.getDate()
  316. if (thisDay != 0) {
  317. start.setDate(thisDate - thisDay)
  318. }
  319. picker.$emit('pick', [start, end])
  320. },
  321. },
  322. {
  323. text: '本月',
  324. onClick(picker) {
  325. const end = new Date()
  326. const start = new Date()
  327. start.setDate(1)
  328. picker.$emit('pick', [start, end])
  329. },
  330. },
  331. {
  332. text: '本季度',
  333. onClick(picker) {
  334. var oDate = new Date()
  335. var thisYear = oDate.getFullYear()
  336. var thisMonth = oDate.getMonth() + 1
  337. var n = Math.ceil(thisMonth / 3) // 季度
  338. var Month = n * 3 - 1
  339. var start = new Date(thisYear, Month - 2, 1)
  340. var end = new Date()
  341. picker.$emit('pick', [start, end])
  342. },
  343. },
  344. ],
  345. },
  346. applstatus:false,
  347. value1: '',
  348. value2: '',
  349. }
  350. },
  351. activated() {
  352. this.applstatus=hasPermission('contractManagement.buyContract.buyContractInfo.appl')
  353. console.log(this.applstatus)
  354. //cg.viewBudget
  355. //cg.viewSpareMoney
  356. // this.getVesselData();
  357. this.getList()
  358. this.showType = this.isShow
  359. },
  360. methods: {
  361. handlecost(row){
  362. this.$router.push({
  363. name: 'buyContractcost',
  364. query: {
  365. id: row.id,
  366. contractNo: row.contractNo,
  367. status:row.status,
  368. seller:row.seller
  369. },
  370. })
  371. },
  372. onChange() {
  373. this.$refs.upload
  374. .handleSaveBill()
  375. .then(async (response) => {
  376. this.deptBudgetList.addressUrl = response
  377. this.deptBudgetList.id = this.id
  378. this.deptBudgetList.flag = 1
  379. editInfo(this.deptBudgetList)
  380. .toPromise()
  381. .then((response) => {
  382. this.accessoryTFs = false
  383. this.$message.success('上传成功')
  384. this.getList()
  385. })
  386. })
  387. .catch((res) => {
  388. EventBus.$emit('error', (JSON.parse(res) || {}).message)
  389. this.$refs.upload.clearFiles()
  390. })
  391. },
  392. dateFormat(fmt, date) {
  393. let ret
  394. const opt = {
  395. 'Y+': date.getFullYear().toString(), // 年
  396. 'm+': (date.getMonth() + 1).toString(), // 月
  397. 'd+': date.getDate().toString(), // 日
  398. 'H+': date.getHours().toString(), // 时
  399. // "M+": date.getMinutes().toString(), // 分
  400. // "S+": date.getSeconds().toString() // 秒
  401. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  402. }
  403. for (let k in opt) {
  404. ret = new RegExp('(' + k + ')').exec(fmt)
  405. if (ret) {
  406. fmt = fmt.replace(
  407. ret[1],
  408. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  409. )
  410. }
  411. }
  412. return fmt
  413. },
  414. handleClose() {
  415. this.dialogViewSpareMoney = false
  416. },
  417. selectstatuschange(e,row){
  418. var data={}
  419. var text=`是否将状态改为${e}`
  420. getsettlementprice({contractNo:row.contractNo}).toPromise()
  421. .then((response) => {
  422. if(e=='发运结束'){
  423. data={id: row.id,endFlag:1}
  424. }else if(e=='已完成'){
  425. data={id:row.id,settlementPrice:response}
  426. text=`合同单价${response}元/吨,确定合同已完成?`
  427. }else{
  428. data={id: row.id}
  429. }
  430. this.$confirm(text, {
  431. confirmButtonText: '确定',
  432. cancelButtonText: '取消',
  433. type: 'warning',
  434. })
  435. .then(() => {
  436. editstatus(data)
  437. .toPromise()
  438. .then((response) => {
  439. this.$notify.success({
  440. title: '成功',
  441. message: '状态修改成功',
  442. })
  443. this.getList()
  444. })
  445. .catch((response) => {
  446. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  447. })
  448. })
  449. .catch(() => {
  450. row.status=row.currectstatus
  451. return false
  452. })
  453. })
  454. .catch((response) => {
  455. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  456. })
  457. },
  458. handleSizeChange(val) {
  459. console.log(`每页 ${val} 条`)
  460. this.pageSize = val
  461. this.getList()
  462. },
  463. handleCurrentChange(val) {
  464. this.currentPage = val
  465. console.log(`当前页: ${val}`)
  466. this.getList()
  467. },
  468. getList() {
  469. getList({
  470. compId: localStorage.getItem('ws-pf_compId'),
  471. contractType: this.contractType,
  472. goodsType: this.goodsType,
  473. currentPage: this.currentPage,
  474. pageSize: this.pageSize,
  475. searchType: this.searchType,
  476. searchKeyWord: this.searchKeyWord,
  477. startDate: this.startDate,
  478. endDate: this.endDate,
  479. contrPage: this.contrPage,
  480. })
  481. .toPromise()
  482. .then((response) => {
  483. for (var i = 0; i < response.records.length; i++) {
  484. if(response.records[i].status){
  485. response.records[i].currectstatus=response.records[i].status
  486. }
  487. if (response.records[i].completedQuantity) {
  488. response.records[i].completedQuantity = response.records[i].completedQuantity.toFixed(3)
  489. }
  490. if (response.records[i].addressUrl != null) {
  491. if (response.records[i].addressUrl) {
  492. response.records[i].addressUrlArray =
  493. response.records[i].addressUrl.split(',')
  494. }
  495. } else {
  496. response.records[i].addressUrlArray = []
  497. }
  498. }
  499. this.deptCircularPage.currentPage = response.current
  500. this.deptCircularPage.pageSize = response.size
  501. this.deptBudgetTotal = response.total
  502. this.contractList = response
  503. for (var i = 0; i < response.records.length; i++) {
  504. var arr = new Array()
  505. this.addressUrls[i] = new Array()
  506. if (this.contractList.records[i].addressUrl != null) {
  507. arr = this.contractList.records[i].addressUrl.split(',')
  508. this.addressUrls[i] = arr
  509. }
  510. }
  511. })
  512. },
  513. // 上传附件
  514. uploadSuccess(data, files, url) {
  515. console.log(data, files, url)
  516. // this.deptBudgetList.
  517. // this.formData.append('files', files)
  518. // this.feedbackObj.uploadNameAttachment = data.appendixName
  519. // this.feedbackObj.pathUploadAttachment = data.appendixPath
  520. // // this.newAppendixs = files
  521. // this.onChangeFlag = true
  522. },
  523. editClick(row) {
  524. var status = ''
  525. if (row.status == '待执行' || row.status == '已完成') {
  526. status = '执行中'
  527. } else if (row.status == '执行中'||row.status == '发运结束') {
  528. status = '已完成'
  529. }
  530. this.$confirm(`是否将状态改为${status}`, '提示', {
  531. confirmButtonText: '确定',
  532. cancelButtonText: '取消',
  533. type: 'warning',
  534. })
  535. .then(() => {
  536. editstatus({
  537. id: row.id,
  538. })
  539. .toPromise()
  540. .then((response) => {
  541. this.$notify.success({
  542. title: '成功',
  543. message: '状态修改成功',
  544. })
  545. this.getList()
  546. })
  547. .catch((response) => {
  548. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  549. })
  550. })
  551. .catch(() => {
  552. return false
  553. })
  554. },
  555. selecttaskType(e) {
  556. for (var i = 0; i < this.taskTypeList.length; i++) {
  557. if (this.taskTypeList[i].value == e) {
  558. this.searchType = this.taskTypeList[i].type
  559. this.find()
  560. }
  561. }
  562. },
  563. fujian(row) {
  564. this.id = row.id
  565. this.accessoryTFs = true
  566. this.appendixIdss = row.addressUrl
  567. console.log(this.appendixIdss)
  568. },
  569. handleExamine(row) {
  570. console.log(row)
  571. this.$router.push({
  572. name: 'purchaseContractExamine',
  573. query: {
  574. id: row.id,
  575. status: row.status,
  576. },
  577. })
  578. },
  579. handleAdd() {
  580. this.$router.push({
  581. path: 'purchaseContractAdd',
  582. })
  583. },
  584. handleEdit(row) {
  585. this.$router.push({
  586. name: 'purchaseContractEdit',
  587. query: {
  588. id: row.id,
  589. },
  590. })
  591. },
  592. // 关闭 dialog时 处理文件url 初始化upload组件
  593. history(row) {
  594. console.log(row)
  595. billoperatehis({
  596. id: row.id,
  597. })
  598. .toPromise()
  599. .then((response) => {
  600. this.historyList = response
  601. })
  602. },
  603. find() {
  604. if (this.value2) {
  605. this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
  606. this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
  607. } else {
  608. this.startDate = ''
  609. this.endDate = ''
  610. }
  611. this.currentPage = 1
  612. this.getList()
  613. },
  614. async exportlist() {
  615. const {
  616. data
  617. } = await export1({
  618. compId: localStorage.getItem('ws-pf_compId'),
  619. contractType: this.contractType,
  620. goodsType: this.goodsType,
  621. currentPage: this.currentPage,
  622. pageSize: this.pageSize,
  623. searchType: this.searchType,
  624. searchKeyWord: this.searchKeyWord,
  625. startDate: this.startDate,
  626. endDate: this.endDate,
  627. }, {}, {
  628. responseType: 'blob',
  629. }).toPromise()
  630. downloadFile({
  631. res: data,
  632. fileName: `${
  633. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  634. }_采购合同`,
  635. type: 'xls',
  636. })
  637. },
  638. // deletecontract(){},
  639. //删除
  640. handleDelete(row) {
  641. var text = ''
  642. if (row.deliverType == 1) {
  643. text =
  644. '删除该合同将同时永久删除合同对应的临时仓库相关数据,是否确定删除?'
  645. } else {
  646. text = '合同删除后不可恢复,是否继续删除?'
  647. }
  648. this.$confirm(text, '提示', {
  649. confirmButtonText: '确定',
  650. cancelButtonText: '取消',
  651. type: 'warning',
  652. })
  653. .then(() => {
  654. deletecontract({
  655. id: row.id,
  656. })
  657. .toPromise()
  658. .then((response) => {
  659. this.$notify.success({
  660. title: '成功',
  661. message: '删除成功',
  662. })
  663. this.getList()
  664. })
  665. .catch((response) => {})
  666. })
  667. .catch(() => {
  668. return false
  669. })
  670. },
  671. },
  672. }
  673. </script>
  674. <style lang="scss" scoped>
  675. .vertical-text-left {
  676. width: 62px;
  677. text-align: right;
  678. }
  679. .flex {
  680. display: flex;
  681. }
  682. .el-range-editor.el-input__inner {
  683. margin-left: 10px;
  684. }
  685. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  686. width: 30px;
  687. margin-left: -10px;
  688. border-top-left-radius: 0px;
  689. border-bottom-left-radius: 0px;
  690. }
  691. .el-button--primary {
  692. background-color: #5878e8;
  693. border-color: #5878e8;
  694. }
  695. .el-button--default {
  696. border: 1px solid #5473e8;
  697. color: #5473e8;
  698. }
  699. // .warning {
  700. // width: 100%;
  701. // height: 2px;
  702. // background: red;
  703. // }
  704. .executory,
  705. .inExecution,
  706. .done {
  707. width: 6px;
  708. height: 6px;
  709. display: inline-block;
  710. border-radius: 50%;
  711. position: relative;
  712. top: -1px;
  713. }
  714. .executory {
  715. background: #ff9f24;
  716. }
  717. .inExecution {
  718. background: #5878e8;
  719. }
  720. .done {
  721. background: #50cad4;
  722. }
  723. // .top-grade {
  724. // background: linear-gradient(90deg, #5678e9, #7993f6);
  725. // color: #fff;
  726. // padding: 3px;
  727. // border-radius: 2px;
  728. // }
  729. // .second-class {
  730. // background: linear-gradient(90deg, #50cdd9, #82e2ea);
  731. // color: #fff;
  732. // padding: 3px;
  733. // border-radius: 2px;
  734. // }
  735. // .third-class {
  736. // background: linear-gradient(90deg, #ffa735, #ffbf70);
  737. // color: #fff;
  738. // padding: 3px;
  739. // border-radius: 2px;
  740. // }
  741. // .substandard {
  742. // background: linear-gradient(90deg, #b2b4bb, #ced0d5);
  743. // color: #fff;
  744. // padding: 3px;
  745. // border-radius: 2px;
  746. // }
  747. .wrap {
  748. width: 400px;
  749. position: absolute;
  750. top: 131px;
  751. left: 794px;
  752. transform-origin: right center;
  753. z-index: 2005;
  754. }
  755. .vertical-line {
  756. height: 64px;
  757. border-left: 2px solid #e9ecf7;
  758. margin-left: 4px;
  759. padding: 0 3px;
  760. // border-image: -webkit-linear-gradient(#00eba7, #08b8e6) 30 30;
  761. // border-image: -moz-linear-gradient(#00eba7, #08b8e6) 30 30;
  762. // border-image: linear-gradient(#00eba7, #08b8e6) 30 30;
  763. }
  764. .el-pagination {
  765. padding: 10px 15px;
  766. margin-bottom: 0;
  767. text-align: center;
  768. }
  769. /deep/.el-pager li.active {
  770. color: #5878e8;
  771. cursor: default;
  772. }
  773. /deep/.el-pager li:hover {
  774. color: #5878e8;
  775. cursor: default;
  776. }
  777. .vertical-circle {
  778. width: 10px;
  779. height: 10px;
  780. border: 2px solid #5878e8;
  781. background-color: #ffffff;
  782. -webkit-border-radius: 100px;
  783. }
  784. .vertical-circle:first-child {
  785. color: red;
  786. }
  787. .vertical-text {
  788. margin: 0 10px;
  789. color: #8890b1;
  790. font-size: 12px;
  791. margin-top: -4px;
  792. }
  793. /deep/.el-table .el-table__header .cell,
  794. /deep/.el-table .el-table__body .cell {
  795. text-align: center;
  796. }
  797. .typeselect {
  798. width: 500px;
  799. }
  800. .padding-xs {
  801. padding: 15px;
  802. text-align: right;
  803. }
  804. .clearfix:after {
  805. content: '';
  806. display: block;
  807. clear: both;
  808. }
  809. .el-table {
  810. font-size: 16px;
  811. }
  812. .taskType {
  813. width: 100%;
  814. background-color: #fff;
  815. margin-top: 2px;
  816. margin-bottom: 10px;
  817. list-style: none;
  818. // padding-bottom: 20px;
  819. li {
  820. float: left;
  821. border: 1px solid #6ea0f3;
  822. border-radius: 5px;
  823. max-width: 190px;
  824. padding: 0 5px;
  825. text-align: center;
  826. margin: 10px 20px;
  827. cursor: pointer;
  828. font-size: 14px;
  829. p {
  830. margin: 8px 0px;
  831. span {
  832. color: #e74c3c;
  833. }
  834. }
  835. }
  836. li:hover {
  837. background-color: #e4eeff;
  838. color: #1d6ced;
  839. }
  840. }
  841. .el-date-editor--date {
  842. margin: 0 10px;
  843. }
  844. .findValue {
  845. margin: 0 10px;
  846. }
  847. /deep/.findValue .el-input__inner {
  848. border-top-right-radius: 0px;
  849. border-bottom-right-radius: 0px;
  850. }
  851. // .button-container {
  852. // display: flex;
  853. // flex-wrap: nowrap;
  854. // justify-content: space-between;
  855. // align-items: center;
  856. // background-color: #fff;
  857. // width: 100%;
  858. // height: 50px;
  859. // padding: 0 10px;
  860. // &>div {
  861. // margin-left: 10px;
  862. // display: flex;
  863. // flex-wrap: nowrap;
  864. // flex-direction: row;
  865. // &>span {
  866. // line-height: 50px;
  867. // }
  868. // }
  869. // /deep/.auditFlow-box {
  870. // position: unset;
  871. // margin-left: 10px;
  872. // &/deep/.auditFlow-icon {
  873. // width: auto;
  874. // padding-right: 30px;
  875. // }
  876. // &/deep/.auditFlow-main {
  877. // position: absolute;
  878. // }
  879. // }
  880. // }
  881. // .box-app {
  882. // display: inline-block;
  883. // float: left;
  884. // margin-left: 30px;
  885. // line-height: 50px;
  886. // }
  887. /deep/.el-dialog {
  888. .el-form-item {
  889. margin-bottom: 0 !important;
  890. .el-input--medium {
  891. textarea {
  892. min-height: 100px !important;
  893. }
  894. }
  895. }
  896. }
  897. .collapse-bottom {
  898. margin-bottom: 20px;
  899. }
  900. .input-main .textarea .el-textarea__inner {
  901. width: 100%;
  902. z-index: 1;
  903. }
  904. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  905. /* height: 82px;*/
  906. /*}*/
  907. // 控制select为只读的时候显示样式
  908. // .hide-sel {
  909. // .el-input__inner {
  910. // border: 0px;
  911. // }
  912. // .el-icon-arrow-up {
  913. // display: none;
  914. // }
  915. // .el-textarea__inner {
  916. // background-color: #fff !important;
  917. // border: 0;
  918. // }
  919. // .el-date-editor {
  920. // i {
  921. // display: none;
  922. // }
  923. // }
  924. // .is-disabled {
  925. // .el-input__inner:hover {
  926. // background-color: #fff !important;
  927. // border: 0;
  928. // }
  929. // color: #606266;
  930. // .el-input__inner {
  931. // background-color: #fff !important;
  932. // border: 0;
  933. // color: #606266;
  934. // }
  935. // .el-textarea__inner {
  936. // background-color: #fff !important;
  937. // border: 0;
  938. // color: #606266;
  939. // }
  940. // }
  941. // }
  942. // 控制select为只读的时候显示样式
  943. /deep/.ws-class-table-col {
  944. height: auto;
  945. padding: 0px 2px;
  946. /deep/.el-input__inner {
  947. padding: 0px 2px;
  948. }
  949. }
  950. /deep/.is-disabled {
  951. .el-input__prefix,
  952. .el-input__suffix {
  953. display: none;
  954. }
  955. .el-input__inner {
  956. background-color: #fff;
  957. border-color: #fff !important;
  958. color: #000 !important;
  959. font-size: 14px;
  960. cursor: text;
  961. padding: 0 !important;
  962. }
  963. }
  964. /deep/.typeselect .el-input__inner {
  965. color: #8890b1;
  966. }
  967. /deep/.statusselect .el-input__inner {
  968. color: #8890b1;
  969. width:100%;
  970. }
  971. </style>