tender.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  1. <template>
  2. <div>
  3. <el-dialog :append-to-body="true" fullscreen :visible.sync="viewDialog" title="" center >
  4. <el-card class="box-card" shadow="nerver">
  5. <div slot="header" class="clearfix">
  6. <span class="topClass">基本信息</span>
  7. </div>
  8. <el-row type="flex" class="row-bg">
  9. <el-col :span="8" class="flex_text">
  10.   标题 : <span class="flex_name"> {{bidInfo.tenderTitle}}</span>
  11. </el-col>
  12. <el-col :span="8" class="flex_text">
  13.   状态 : <span class="flex_name"> <el-tag effect="plain" v-if="bidInfo.status ==1">进行中</el-tag>
  14. <el-tag effect="plain" v-if="bidInfo.status ==2" type="info">已结束</el-tag>
  15. <el-tag effect="plain" v-if="bidInfo.status ==3" type="danger">已作废</el-tag>
  16. <el-tag effect="plain" v-if="bidInfo.status ==4" type="warning">未开始</el-tag>
  17. </span>
  18. </el-col>
  19. <el-col :span="8" class="flex_text">
  20. 招标类型 : <span class="flex_name"><el-tag v-if="bidInfo.tenderType == 1" >物流</el-tag>
  21. <el-tag v-if="bidInfo.tenderType == 2" >原料</el-tag>
  22. <el-tag v-if="bidInfo.tenderType == 3" >销售</el-tag>
  23. <el-tag v-if="bidInfo.tenderType == 4" >加工承揽</el-tag>
  24. </span>
  25. </el-col>
  26. </el-row>
  27. <el-row type="flex" class="row-bg">
  28. <el-col :span="8" class="flex_text">
  29. 招标规则 : <span class="flex_name"> <el-tag v-if="bidInfo.tenderRule == 1" type="success" effect="plain">价低者得</el-tag>
  30. <el-tag v-if="bidInfo.tenderRule == 2" effect="plain" >价高者得</el-tag></span>
  31. </el-col>
  32. <el-col :span="8" class="flex_text">
  33. 开始时间 : <span class="flex_name"> {{bidInfo.startTime}} </span>
  34. </el-col>
  35. <el-col :span="8" class="flex_text">
  36. 截止时间 : <span class="flex_name">{{bidInfo.endTime}}
  37. </span>
  38. </el-col>
  39. </el-row>
  40. <el-row type="flex" class="row-bg">
  41. <el-col :span="24" class="flex_text">
  42.    备注:<span class="flex_name">{{bidInfo.tenderRemark}}</span>
  43. </el-col>
  44. </el-row>
  45. </el-card>
  46. <el-card class="box-card" shadow="nerver">
  47. <div slot="header" class="clearfix">
  48. <span class="topClass"> 所有标的</span>
  49. </div>
  50. <el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
  51. <el-tab-pane label="标的详情" name="first">
  52. <div slot="header" class="clearfix">
  53. <span class="topClass">投的详情</span>
  54. </div>
  55. <div class="head-container" style="margin: 30px 0 10px 0;">
  56. <span style="fontSize:13px">货品名称</span>
  57. <el-input
  58. v-model="param.goodsName"
  59. clearable
  60. placeholder="请输入货物名称"
  61. style="width: 200px;"
  62. size="small"
  63. class="filter-item"
  64. @keyup.enter.native="getParamFexd"
  65. @clear="getParamFexd"
  66. />
  67. <span style="fontSize:13px;marginLeft:30px">始发地</span>
  68. <el-input
  69. v-model="param.departureName"
  70. clearable
  71. placeholder="请输入始发地"
  72. style="width: 200px;"
  73. size="small"
  74. class="filter-item"
  75. @keyup.enter.native="getParamFexd"
  76. @clear="getParamFexd"
  77. />
  78. <span style="fontSize:13px;marginLeft:30px;">目的地</span>
  79. <el-input
  80. v-model="param.destinationName"
  81. clearable
  82. placeholder="请输入货物名称"
  83. style="width: 200px;"
  84. size="small"
  85. class="filter-item"
  86. @keyup.enter.native="getParamFexd"
  87. @clear="getParamFexd"
  88. />
  89. <!-- 搜索 -->
  90. <span style="fontSize:13px;marginLeft:30px;">是否有人投标</span>
  91. <el-select v-model="param.logisticsIsTender" size="small" @keyup.enter.native="getParamFexd" @clear="getParamFexd" clearable placeholder="请选择">
  92. <el-option label="未投标" value="0"> </el-option>
  93. <el-option label="有投标" value="1"> </el-option>
  94. </el-select>
  95. <span style="fontSize:13px;marginLeft:20px">发标时间</span>
  96. <el-date-picker
  97. v-model="applyDateStart"
  98. size="small"
  99. type="datetimerange"
  100. style="width: 400px;"
  101. range-separator="-"
  102. clearable
  103. value-format="yyyy-MM-dd HH:mm:ss"
  104. :default-time="['00:00:00', '23:59:59']"
  105. start-placeholder="开始日期"
  106. end-placeholder="结束日期"
  107. @change="onApplyDate"
  108. @clear="onApplyDate"
  109. />
  110. <div style="text-align: right;margin-right:40px;margin-top:20px">
  111. <el-button class="filter-item" style=" width:90px; " size="small" type="primary" icon="el-icon-search" @click="getParamFexd">搜索</el-button>
  112. </div>
  113. <!-- <el-button class="filter-item" style="marginLeft:20px;marginBottom:20px" size="small" type="primary" icon="el-icon-search" @click="getParamFexd">搜索</el-button> -->
  114. <div style="height:20px"></div>
  115. <el-table center :data="Paramdata" :header-cell-style="{ background: '#f5f7fa', }" border v-loading="tableLoading" stripe style="width: 100%;">
  116. <el-table-column prop="goodsName" fixed="left" label="货品名称" :show-overflow-tooltip="true" align="center" />
  117. <el-table-column prop="goodsNumber" label="数量(吨)" :show-overflow-tooltip="true" align="center" />
  118. <el-table-column prop="departureName" label="始发地" :show-overflow-tooltip="true" align="center" />
  119. <el-table-column prop="destinationName" label="目的地" :show-overflow-tooltip="true" align="center" />
  120. <el-table-column prop="predictDistance" label="预估运输距离(公里/海里)" width="128" :show-overflow-tooltip="true" align="center" />
  121. <el-table-column prop="transportUnitPrice" label="运输单价含税价(元/吨)" width="120" :show-overflow-tooltip="true" align="center" />
  122. <el-table-column prop="appendix" label="回执" align="center" width="100">
  123. <template slot-scope="scope">
  124. <el-link :disabled="scope.row.receiptPathUrl ? false : true" :href="scope.row.receiptPathUrl" type="primary" target="_target"><i class="el-icon-view"></i> 下载</el-link>
  125. </template>
  126. </el-table-column>
  127. <el-table-column label="状态" align="center" width="100">
  128. <template slot-scope="scope">
  129. <el-tag effect="plain" v-if="scope.row.status ==3">进行中</el-tag>
  130. <el-tag effect="plain" v-if="scope.row.status ==1" type="info">已结束</el-tag>
  131. <el-tag effect="plain" v-if="scope.row.status ==5" type="info">待处理</el-tag>
  132. <el-tag effect="plain" v-if="scope.row.status ==2" type="danger">已作废</el-tag>
  133. <el-tag effect="plain" v-if="scope.row.status ==4" type="warning">未开始</el-tag>
  134. </template>
  135. </el-table-column>
  136. <el-table-column prop="logisticsIsTender" label="是否有人投标" :show-overflow-tooltip="true" align="center" >
  137. <template slot-scope="scope">
  138. <el-tag v-if="scope.row.logisticsIsTender == 0" type="info">未投标</el-tag>
  139. <el-tag v-if="scope.row.logisticsIsTender == 1" type="warning">有投标</el-tag>
  140. </template>
  141. </el-table-column>
  142. <el-table-column prop="tenderLogisticsRule" label="中标规则" :show-overflow-tooltip="true" align="center" >
  143. <template slot-scope="scope">
  144. <el-tag v-if="scope.row.tenderLogisticsRule == 1" type="success" effect="plain">价低者得</el-tag>
  145. <el-tag v-if="scope.row.tenderLogisticsRule == 2" effect="plain" >价高者得</el-tag>
  146. </template>
  147. </el-table-column>
  148. <el-table-column label="运输时间" prop="freightTime" width="200" align="center" :show-overflow-tooltip="true">
  149. </el-table-column>
  150. <el-table-column prop="startTime" width="152" label="投标起始时间" :show-overflow-tooltip="true" align="center" />
  151. <el-table-column prop="endTime" width="152" label="投标结束时间" :show-overflow-tooltip="true" align="center" />
  152. <!-- <el-table-column prop="createTime" width="152" label="创建时间" :show-overflow-tooltip="true" align="center" /> -->
  153. <el-table-column prop="logisticsRemark" width="152" label="备注" :show-overflow-tooltip="true" align="center" />
  154. </el-table>
  155. <div class="pagination">
  156. <el-pagination
  157. :current-page.sync="param.current"
  158. :page-size="param.size"
  159. layout="total, sizes, prev, pager, next, jumper"
  160. :total="total1"
  161. :page-sizes="[1,10, 20, 30, 50]"
  162. background
  163. @size-change="handleSizeChangeParam"
  164. @current-change="handleCurrentChangeParam"
  165. />
  166. </div>
  167. </div>
  168. </el-tab-pane>
  169. <el-tab-pane label="投标详情" name="second">
  170. <!-- <el-card class="box-card" shadow="nerver"> -->
  171. <!-- <div slot="header" class="clearfix">
  172. <span class="topClass">投标详情</span>
  173. </div> -->
  174. <ckTable ref="ckTable" @change="costPlannedAmountChange($event)"></ckTable>
  175. <!-- </el-card> -->
  176. </el-tab-pane>
  177. </el-tabs>
  178. </el-card>
  179. <!-- <el-card class="box-card" shadow="nerver">
  180. <div slot="header" class="clearfix">
  181. <span class="topClass">投标详情</span>
  182. </div>
  183. <ckTable ref="ckTable" @change="costPlannedAmountChange($event)"></ckTable>
  184. </el-card> -->
  185. <div slot="footer" class="paginationParam">
  186. <!-- <el-button @click="viewDialog = false">取消</el-button> -->
  187. <el-button type="primary" @click="viewDialog = false">返回</el-button>
  188. <!-- <el-button :loading="loading" type="primary" @click="viewDialog = false">确认</el-button> -->
  189. </div>
  190. <el-dialog :title="goodsName" width="90%" center :visible.sync="dialogTableVisible" append-to-body>
  191. <ckDialog ref="ckDialog"></ckDialog>
  192. </el-dialog>
  193. </el-dialog>
  194. </div>
  195. </template>
  196. <script>
  197. import { getTableList, getQueryId, getQueryAdd, getQueryEdit, getQueryDelete, loadCustomer,apiFile,getSaleId } from '@/api/bid'
  198. import { Notification, MessageBox } from 'element-ui'
  199. import ckTable from './table.vue'
  200. import ckDialog from './dialog.vue'
  201. export default {
  202. components:{
  203. ckTable,
  204. ckDialog
  205. },
  206. data() {
  207. const checkTel = (rule, value, callback) => {
  208. console.log(this.form.fileUrl)
  209. console.log(value, 'value')
  210. if (this.form.fileUrl == null || this.form.fileUrl == '') {
  211. callback(new Error('请选择附件'))
  212. console.log('没过')
  213. } else {
  214. callback()
  215. console.log('过')
  216. }
  217. }
  218. return {
  219. showType:false,
  220. form: {
  221. tenderType:"",
  222. tenderRule:"",
  223. fileUrl:""
  224. },
  225. applyDateStart:[],
  226. data: [],
  227. fileList: [],
  228. fileData:{},
  229. BASE_API: process.env.BASE_API,
  230. dialog: false,
  231. delLoading: false,
  232. viewDialog: false,
  233. loading: false,
  234. isAdd: false,
  235. currentPage: 1,
  236. pageSize: 10,
  237. total: 0, // 总数量
  238. rules: {
  239. tenderTitle: [
  240. { required: true, message: '标题不为空', trigger: 'blur' }
  241. ],
  242. tenderRule: [
  243. { required: true, message: '请选择招标规则', trigger: 'blur' }
  244. ],
  245. tenderType: [
  246. { required: true, message: '请选择投标类型', trigger: 'blur' }
  247. ],
  248. fileUrl: [
  249. { validator: checkTel, trigger: 'change' }
  250. ],
  251. // startTime: [
  252. // { type:"array",required: true, message: '发布时间不为空', trigger: 'blur' }
  253. // ]
  254. },
  255. tenderType:[
  256. {id:1,name:"物流",value:"logistics"},
  257. {id:2,name:"原料",value:"raw"},
  258. {id:3,name:"销售",value:"sale"},
  259. {id:4,name:"加工承揽",value:"processing"},
  260. ],
  261. tenderRule:[
  262. {id:1,name:"价低者得"},
  263. {id:2,name:"价高者得"},
  264. ],
  265. queryTypeOptions: [
  266. { key: 'name', display_name: '字典名称' },
  267. { key: 'remark', display_name: '描述' }
  268. ],
  269. query: {
  270. type: '',
  271. value: '',
  272. tenderRule:"",
  273. tenderType:"",
  274. startTime:"",
  275. endTime:""
  276. },
  277. param: {
  278. current: 1,
  279. size: 10
  280. },
  281. total1: 0,
  282. Paramdata: [],
  283. bidDate: [],
  284. buton: false,
  285. fileUrl:"",
  286. tableLoading:false,
  287. dialogTableVisible:false,
  288. goodsName:"",
  289. activeName:"first",
  290. bidInfo:{},
  291. saleViewDialog:false,
  292. }
  293. },
  294. created() {
  295. this.getDictData()
  296. },
  297. methods: {
  298. // 投标详情 向父元素传递数据
  299. costPlannedAmountChange(val){
  300. console.log(val,"我是val")
  301. this.dialogTableVisible = true
  302. setTimeout(() => {
  303. this.goodsName = val.goodsName
  304. this.$refs.ckDialog.historyValue = 0
  305. this.$refs.ckDialog.goodsName = ""
  306. this.$refs.ckDialog.priceData = val
  307. this.$refs.ckDialog.handleFind()
  308. console.log(this.$refs.ckDialog)
  309. }, 300);
  310. },
  311. onApplyDate(){
  312. let startTime
  313. let endTime
  314. if(this.applyDateStart != null){
  315. this.param.startTime =this.applyDateStart[0]
  316. this.param.endTime = this.applyDateStart[1]
  317. }else{
  318. this.param.startTime =""
  319. this.param.endTime =""
  320. }
  321. this.getParamFexd()
  322. },
  323. onShowType(){
  324. console.log(this.form.tenderType+"this.form.tenderType ")
  325. console.log(this.form.tenderRule+"this.form.tenderRule")
  326. if(this.form.tenderType ==undefined || this.form.tenderRule == undefined){
  327. this.showType = false
  328. }else{
  329. this.showType = true
  330. }
  331. },
  332. onTenderType(value,index){
  333. console.log(value)
  334. // let value= ""
  335. this.onShowType()
  336. let tenderType =this.tenderType
  337. // id减一得到下标
  338. let data = tenderType[value - 1].value
  339. apiFile(data).then((res)=>{
  340. console.log(res)
  341. this.fileUrl = res.data.data.path
  342. })
  343. },
  344. // 发布时间
  345. oncustom() {
  346. console.log(this.bidDate)
  347. if (this.bidDate != null) {
  348. this.form.startTime = this.bidDate[0]
  349. this.form.endTime = this.bidDate[1]
  350. }
  351. },
  352. onClear() {
  353. this.bidDate = []
  354. console.log(this.form)
  355. },
  356. // 下载
  357. onLoad(row) {
  358. // const params = new URLSearchParams()
  359. // params.append('path', row)
  360. const a = document.createElement('a')
  361. // a.href= /bidding/load
  362. const url = window.location.origin + process.env.BASE_API + '/bidding/load?path=' + encodeURIComponent(row)
  363. a.href = url
  364. a.click()
  365. },
  366. // 搜索
  367. handleFind: function() {
  368. this.currentPage = 1
  369. this.getDictData()
  370. },
  371. // 获取详情
  372. getDictData: function() {
  373. this.loading = true
  374. const params = new URLSearchParams()
  375. params.append('current', this.currentPage)
  376. params.append('size', this.pageSize)
  377. params.append('tenderType', this.query.tenderType)
  378. params.append('tenderTitle', this.query.value)
  379. params.append('tenderRule', this.query.tenderRule)
  380. params.append('startTime',this.query.startTime )
  381. params.append('endTime', this.query.endTime)
  382. // const data = {
  383. // page: this.currentPage,
  384. // size: this.pageSize,
  385. // title: this.query.value
  386. // }
  387. getTableList(params).then(res => {
  388. console.log(res)
  389. // this.data = res.data.data.records
  390. let data = res.data.data.records
  391. console.log(new Date().valueOf(),"当前时间")
  392. data.map((res)=>{
  393. // 开始时间
  394. let startTime = res.startTime
  395. // 投标结束时间
  396. let endTime = res.endTime
  397. const date = new Date(startTime)
  398. const modify = new Date(endTime)
  399. const start = date.valueOf() //开始时间
  400. const end = modify.valueOf() //投标结束时间
  401. const time = new Date().valueOf() //当前时间
  402. console.log(start,"start")
  403. console.log(end,"end")
  404. if(res.isInvalid == 2){
  405. res.status = 3
  406. console.log("作废了")
  407. }else if(time < start){
  408. res.status = 4
  409. console.log("当前时间小于开始时间,未开始")
  410. }else if(time > start && time < end){
  411. res.status = 1
  412. console.log("当前时间大于开始时间并且小于投标结束时间,进行中")
  413. }else if(time > end){
  414. res.status = 2
  415. console.log("当前时间大于投标结束时间,已结束")
  416. }
  417. return res
  418. })
  419. this.data = data
  420. this.total = res.data.data.total
  421. this.loading = false
  422. })
  423. },
  424. // 点击时候
  425. handleUpload(){
  426. console.log("我被固定了")
  427. if(this.form.tenderType ==undefined || this.form.tenderRule == undefined){
  428. this.$message({
  429. message: '请先选择招标类型和招标规则',
  430. type: 'warning'
  431. });
  432. }
  433. // return false
  434. },
  435. // 文件移除的时候
  436. handleRemove(file, fileList) {
  437. this.form.fileUrl = ''
  438. console.log(file, fileList, this.fileList, '移出')
  439. },
  440. // 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
  441. handleChange(file, fileList) {
  442. console.log(file, fileList, '上传')
  443. if (file.response) {
  444. console.log(file.response, 'file')
  445. if (file.response.code == '200') {
  446. this.form.fileUrl = file.response.data.filePath
  447. this.form.tenderParentId = file.response.data.tenderParentId
  448. } else {
  449. Notification.error({
  450. title: file.response.msg,
  451. duration: 1000
  452. })
  453. this.fileList = []
  454. }
  455. }
  456. },
  457. // 点击文件列表中已上传的文件时的钩子
  458. handlePreview(file) {
  459. console.log(file, 'file21')
  460. // 判断添加 还是 编辑
  461. let officeUrl
  462. if(this.isAdd){
  463. officeUrl = 'http://view.officeapps.live.com/op/view.aspx?src='+file.response.data.filePath
  464. }else{
  465. officeUrl = 'http://view.officeapps.live.com/op/view.aspx?src='+this.form.fileUrl
  466. }
  467. // 在新窗口打开编码后 的链接
  468. window.open(officeUrl,'_target')
  469. // window.location.href = file.url
  470. },
  471. handleExceed(files, fileList) {
  472. this.$message.warning(`当前限制选择 1 个附件,本次选择了 ${files.length} 个文件`)
  473. },
  474. hanndleErr(err, files, fileList) {
  475. console.log(err, 'err')
  476. console.log(files, 'err')
  477. console.log(fileList, 'err')
  478. },
  479. beforeRemove(file, fileList) {
  480. return this.$confirm(`确定移除 ${file.name}?`)
  481. },
  482. onFile(){
  483. // let url = "https://fire-development.oss-cn-beijing.aliyuncs.com/bid/dev/客户批量上传模板.xlsx"
  484. if(this.form.tenderType ==undefined || this.form.tenderRule == undefined){
  485. this.$message({
  486. message: '请先选择招标类型和招标规则',
  487. type: 'warning'
  488. });
  489. }else{
  490. window.open(this.fileUrl, '_self');
  491. }
  492. },
  493. // 字典名称提交动作
  494. doSubmit() {
  495. console.log(this.form)
  496. this.$refs['form'].validate((valid) => {
  497. console.log(valid)
  498. if (valid) {
  499. if (this.isAdd) {
  500. // 新增字典
  501. this.buton = true
  502. getQueryAdd(this.form).then((res) => {
  503. if (res.data.code === 200) {
  504. this.dialog = false
  505. this.getDictData()
  506. this.buton = false
  507. this.$message({ message: '操作成功', type: 'success' })
  508. } else {
  509. this.$message({ message: res.data.msg, type: 'error' })
  510. }
  511. this.$refs['form'].resetFields()
  512. }).catch(err => {
  513. this.buton = false
  514. })
  515. } else {
  516. // 更新
  517. getQueryEdit(this.form).then((res) => {
  518. if (res.data.code === 200) {
  519. this.$message({ message: '操作成功', type: 'success' })
  520. } else {
  521. this.$message({ message: res.data.msg, type: 'error' })
  522. }
  523. this.dialog = false
  524. this.getDictData()
  525. })
  526. }
  527. }
  528. })
  529. },
  530. formatDate(date) {
  531. var myyear = date.getFullYear()
  532. var mymonth = date.getMonth() + 1
  533. var myweekday = date.getDate()
  534. if (mymonth < 10) {
  535. mymonth = '0' + mymonth
  536. }
  537. if (myweekday < 10) {
  538. myweekday = '0' + myweekday
  539. }
  540. return myyear + '-' + mymonth + '-' + myweekday
  541. },
  542. // 添加字典
  543. handleAdd: function() {
  544. this.isAdd = true
  545. this.form = {}
  546. const end = new Date()
  547. const start = new Date()
  548. end.setTime(start.getTime() + 3600 * 1000 * 24 * 1)
  549. console.log(this.formatDate(end))
  550. this.form.startTime = this.formatDate(start) + ' 00:00:00'
  551. this.form.endTime = this.formatDate(end) + ' 15:00:00'
  552. this.bidDate = [this.form.startTime, this.form.endTime]
  553. this.form.fileUrl = null
  554. this.fileList = []
  555. // 添加弹框中的附件,进来要隐藏
  556. this.showType = false
  557. this.dialog = true
  558. if (this.$refs['form']) {
  559. this.$refs['form'].resetFields()
  560. }
  561. },
  562. // 编辑字典
  563. handleEdit: function(row) {
  564. if (this.$refs['form']) {
  565. this.$refs['form'].resetFields()
  566. }
  567. const data = JSON.parse(JSON.stringify(row))
  568. this.form = data
  569. this.bidDate = [data.startTime, data.endTime]
  570. // this.form.
  571. // let name = data.appendix.lastIndexOf('/') ;
  572. if (data.fileUrl) {
  573. let name = data.fileUrl.split('/')
  574. name = name.pop()
  575. // let name = data.appendix.replace(/(.*\/)*([^.]+).*/ig, "$2");
  576. this.fileList = [{ name: name, url: data.fileUrl }]
  577. }
  578. // 编辑弹框中的附件,进来要展示
  579. this.showType = true
  580. this.dialog = true
  581. this.isAdd = false
  582. // 下载模板类型
  583. let tenderValue = this.tenderType[data.tenderType-1].value
  584. apiFile(tenderValue).then((res)=>{
  585. console.log(res)
  586. this.fileUrl = res.data.data.path
  587. })
  588. console.log(data)
  589. },
  590. handleClick(row,val){
  591. console.log(row,val)
  592. if(row.name == "second"){
  593. this.$refs.ckTable.tenderParentId = this.param.tenderParentId
  594. this.$refs.ckTable.goodsName = ""
  595. this.$refs.ckTable.handleFind()
  596. }
  597. },
  598. // 详情
  599. handleView(row) {
  600. this.param.tenderParentId = row.tenderParentId
  601. this.bidInfo = row
  602. this.param.current = 1
  603. this.getParam()
  604. setTimeout(() => {
  605. console.log(this.$refs.ckTable.tenderParentId,"1234")
  606. this.$refs.ckTable.tenderParentId = row.tenderParentId
  607. this.$refs.ckTable.getTenantList()
  608. }, 300);
  609. let tenderType = row.tenderType
  610. if(tenderType == 1){
  611. this.viewDialog = true
  612. this.getParam()
  613. console.log("物流")
  614. }else if(tenderType == 3){
  615. this.saleViewDialog = true
  616. console.log("销售")
  617. }
  618. },
  619. getParamFexd(){
  620. this.param.current = 1
  621. this.getParam()
  622. },
  623. getParam(tenderParentId) {
  624. const data = this.param
  625. this.tableLoading = true
  626. // getSaleId
  627. // this.
  628. getQueryId(data).then((res) => {
  629. console.log(res.data.data.records, '')
  630. let data = res.data.data.records
  631. data.map((res)=>{
  632. // 开始时间
  633. let startTime = res.startTime
  634. // 投标结束时间
  635. let endTime = res.endTime
  636. const date = new Date(startTime)
  637. const modify = new Date(endTime)
  638. const start = date.valueOf() //开始时间
  639. const end = modify.valueOf() //投标结束时间
  640. const time = new Date().valueOf() //当前时间
  641. console.log(start,"start")
  642. console.log(end,"end")
  643. if(res.tenderStatus == 1 || res.tenderStatus == 2){
  644. res.status = res.tenderStatus
  645. console.log("我的状态是:" + res.tenderStatus)
  646. }else if(time < start){
  647. res.status = 4
  648. console.log("当前时间小于开始时间,未开始")
  649. }else if(time > start && time < end){
  650. res.status = 3
  651. console.log("当前时间大于开始时间并且小于投标结束时间,进行中")
  652. }else if(time > end){
  653. res.status = 5
  654. console.log("当前时间大于投标结束时间,待处理")
  655. }
  656. return res
  657. })
  658. this.Paramdata = data
  659. this.tableLoading = false
  660. this.total1 = res.data.data.total
  661. })
  662. },
  663. // 删除操作
  664. subDelete(tenderParentId,tenderType) {
  665. // const data = {
  666. // id: val
  667. // }
  668. getQueryDelete(tenderType,tenderParentId).then(res => {
  669. if (res.data.code === 200) {
  670. this.$message({ message: '已作废', type: 'success' })
  671. this.getDictData()
  672. }
  673. }).catch(err => {
  674. console.log(err.response.data.message)
  675. })
  676. this.$refs[tenderParentId].doClose()
  677. },
  678. // 换页
  679. handleCurrentChange: function(val) {
  680. this.currentPage = val
  681. this.getDictData()
  682. },
  683. handleSizeChange(val) {
  684. this.pageSize = val
  685. this.getDictData()
  686. },
  687. handleCurrentChangeParam(val) {
  688. this.param.current = val
  689. this.getParam()
  690. },
  691. handleSizeChangeParam(val) {
  692. this.param.size = val
  693. this.getParam()
  694. }
  695. }
  696. }
  697. </script>
  698. <style scoped lang="scss">
  699. /* 去掉上传附件时候的过度效果 */
  700. ::v-deep .el-upload-list__item{transition: none !important;}
  701. ::v-deep .el-textarea__inner{
  702. padding-bottom: 36px;
  703. }
  704. .padding /deep/ .el-input--medium .el-input__inner {
  705. padding-right: 56px;
  706. }
  707. /deep/ .el-upload-list__item-name {
  708. width: 150px;
  709. }
  710. .ckTable{
  711. width: 100%;
  712. border: #eee;
  713. text-align: center;
  714. tr,td{
  715. border: 0.5px solid#dfe6ec;
  716. line-height: 23px;
  717. }
  718. }
  719. .paginationParam{
  720. // bottom: 0;
  721. // left: 0;
  722. line-height: 80px;
  723. width: 100%;
  724. // left: 45%;
  725. // text-align: right;
  726. z-index: 999;
  727. background: #fff;
  728. }
  729. /deep/ .el-tabs__item{
  730. font-size: 16px !important;
  731. // padding: 35px ;
  732. }
  733. .el-card {
  734. border: 0px solid #fff;
  735. }
  736. .clearfix {
  737. line-height: 20px;
  738. font-size: 18px;
  739. font-weight: 600;
  740. color: #409EFF;
  741. }
  742. /deep/.el-dialog.is-fullscreen {
  743. background-color: #f5f7f9;
  744. }
  745. .box-card{
  746. margin-bottom: 20px;
  747. .row-bg{
  748. padding: 15px 40px 0 40px;
  749. .flex_text{
  750. line-height: 50px;
  751. color: #8C8C8C;
  752. font-size: 14px;
  753. // border:1px solid red;
  754. // font-weight: 600;
  755. }
  756. .flex_name{
  757. font-size: 14px;
  758. padding-left: 25px;
  759. color: #575757;
  760. font-weight: 550;
  761. }
  762. }
  763. }
  764. /deep/ .el-card__body{
  765. padding: 20px 0;
  766. }
  767. /deep/.el-tabs__nav-wrap::after {
  768. background-color: #dfe4ed00;
  769. }
  770. /deep/ .el-dialog--center .el-dialog__body {
  771. text-align: initial;
  772. padding: 25px 25px 0px 30px;
  773. }
  774. /deep/ .el-tabs--border-card{
  775. // border-top:1px ;
  776. border-bottom: 0px;
  777. box-shadow: 0px 0px 0px 0px rgba(0,0,0,0.5)
  778. }
  779. </style>