tender.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  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-col :span="8" class="flex_text">
  40.    备注:<span class="flex_name">{{bidInfo.tenderRemark}}</span>
  41. </el-col>
  42. </el-row>
  43. <el-row type="flex" class="row-bg">
  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 class="head-container" style="margin: 30px 0 10px 0;">
  53. <span style="fontSize:13px">产品名称</span>
  54. <el-input
  55. v-model="param.productName"
  56. clearable
  57. placeholder="请输入产品名称"
  58. style="width: 200px;"
  59. size="small"
  60. class="filter-item"
  61. @keyup.enter.native="getParamFexd"
  62. @clear="getParamFexd"
  63. />
  64. <span style="fontSize:13px;marginLeft:20px">编码</span>
  65. <el-input
  66. v-model="param.productEncode"
  67. clearable
  68. placeholder="请输入编码"
  69. style="width: 200px;"
  70. size="small"
  71. class="filter-item"
  72. @keyup.enter.native="getParamFexd"
  73. @clear="getParamFexd"
  74. />
  75. <!-- <span style="fontSize:13px;marginLeft:20px">加工地点</span>
  76. <el-input
  77. v-model="param.processingLocation"
  78. clearable
  79. placeholder="请输入加工地点"
  80. style="width: 200px;"
  81. size="small"
  82. class="filter-item"
  83. @keyup.enter.native="getParamFexd"
  84. @clear="getParamFexd"
  85. /> -->
  86. <span style="fontSize:13px;marginLeft:20px">发标时间</span>
  87. <el-date-picker
  88. v-model="applyDateStart"
  89. size="small"
  90. type="datetimerange"
  91. style="width: 400px;"
  92. range-separator="-"
  93. clearable
  94. value-format="yyyy-MM-dd HH:mm:ss"
  95. :default-time="['00:00:00', '23:59:59']"
  96. start-placeholder="开始日期"
  97. end-placeholder="结束日期"
  98. @change="onApplyDate"
  99. @clear="onApplyDate"
  100. />
  101. <div style="text-align: right;margin-right:40px">
  102. <el-button class="filter-item" style=" width:90px; " size="small" type="primary" icon="el-icon-search" @click="getParamFexd">搜索</el-button>
  103. </div>
  104. <div style="height:20px"></div>
  105. <el-table center :data="Paramdata" :header-cell-style="{ background: '#f5f7fa', }" border v-loading="tableLoading" stripe style="width: 100%;">
  106. <el-table-column prop="tenderCode" width="150" fixed="left" label="标的编号" :show-overflow-tooltip="true" align="center" />
  107. <el-table-column prop="productName" fixed="left" label="产品名称" :show-overflow-tooltip="true" align="center" />
  108. <el-table-column prop="productEncode" width="150" label="产品内部编码" :show-overflow-tooltip="true" align="center" />
  109. <el-table-column prop="processingLocation" label="加工地点(所在加工厂) " :show-overflow-tooltip="true" align="center" />
  110. <el-table-column prop="number" label="数量(吨)" :show-overflow-tooltip="true" align="center" />
  111. <el-table-column prop="lowestPrice" width="90" label="最低价(元/吨)" :show-overflow-tooltip="true" align="center" />
  112. <el-table-column prop="highestPrice" width="90" label="最高价(元/吨)" :show-overflow-tooltip="true" align="center" />
  113. <el-table-column prop="biddingStartPrice" width="100" label="投标起价(元)" :show-overflow-tooltip="true" align="center" />
  114. <el-table-column prop="deposit" width="100" label="履约保证金" :show-overflow-tooltip="true" align="center" />
  115. <el-table-column label="状态" align="center" width="100">
  116. <template slot-scope="scope">
  117. <el-tag effect="plain" v-if="scope.row.status ==3">进行中</el-tag>
  118. <el-tag effect="plain" v-if="scope.row.status ==1" type="info">已结束</el-tag>
  119. <el-tag effect="plain" v-if="scope.row.status ==5" type="info">待处理</el-tag>
  120. <el-tag effect="plain" v-if="scope.row.status ==2" type="danger">已作废</el-tag>
  121. <el-tag effect="plain" v-if="scope.row.status ==4" type="warning">未开始</el-tag>
  122. </template>
  123. </el-table-column>
  124. <el-table-column prop="tenderSaleRule" width="100" label="中标规则" :show-overflow-tooltip="true" align="center" >
  125. <template slot-scope="scope">
  126. <el-tag v-if="scope.row.tenderSaleRule == 1" type="success" effect="plain">价低者得</el-tag>
  127. <el-tag v-if="scope.row.tenderSaleRule == 2" effect="plain" >价高者得</el-tag>
  128. </template>
  129. </el-table-column>
  130. <el-table-column prop="startTime" width="152" label="投标起始时间" :show-overflow-tooltip="true" align="center" />
  131. <el-table-column prop="endTime" width="152" label="投标结束时间" :show-overflow-tooltip="true" align="center" />
  132. <!-- <el-table-column prop="createTime" label="创建时间" width="152" :show-overflow-tooltip="true" align="center" /> -->
  133. <el-table-column prop="saleRemark" label="备注" width="162" :show-overflow-tooltip="true" align="center" />
  134. <el-table-column label="操作" width="150" align="center" fixed="right">
  135. <template slot-scope="scope">
  136. <el-button slot="reference" type="text" :disabled="scope.row.status !=3" icon="el-icon-plus" @click="handleAdd(scope.row)">投标</el-button>
  137. <!-- <el-button slot="reference" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)">投标</el-button> -->
  138. </template>
  139. </el-table-column>
  140. </el-table>
  141. <div class="pagination">
  142. <el-pagination
  143. :current-page.sync="param.current"
  144. :page-size="param.size"
  145. layout="total, sizes, prev, pager, next, jumper"
  146. :total="total1"
  147. :page-sizes="[10, 20, 30, 50]"
  148. background
  149. @size-change="handleSizeChangeParam"
  150. @current-change="handleCurrentChangeParam"
  151. />
  152. </div>
  153. <!-- <div style="height:60px"></div> -->
  154. </div>
  155. </el-tab-pane>
  156. <el-tab-pane label="投标详情" name="second">
  157. <!-- <el-card class="box-card" shadow="nerver"> -->
  158. <!-- <div slot="header" class="clearfix">
  159. <span class="topClass">投标详情</span>
  160. </div> -->
  161. <ckTable ref="ckTable" @change="costPlannedAmountChange($event)" @onAdd="changeAdd($event)"></ckTable>
  162. <!-- </el-card> -->
  163. </el-tab-pane>
  164. </el-tabs>
  165. </el-card>
  166. <el-dialog :append-to-body="true" :close-on-click-modal="false" :visible.sync="dialog" :title="isAdd ? '投标' : '修标'" width="50%">
  167. <el-form ref="form" :model="form" :rules="rules1" label-width="80px">
  168. <el-row :gutter="20">
  169. <el-col :span="6" :xs="24" :sm="12" :md="12" :lg="12">
  170. <el-form-item label="产品名称">
  171. <!-- <span>{{form.biddingLogisticsRemark}}</span> -->
  172. <el-tag>{{form.goodsName}}</el-tag>
  173. <!-- <el-input v-model="form.goodsName" style="width:50%" readonly></el-input> -->
  174. </el-form-item>
  175. </el-col>
  176. <el-col :span="6" :xs="24" :sm="12" :md="12" :lg="12">
  177. <el-form-item label="产品编码">
  178. <el-tag>{{form.tenderCode}}</el-tag>
  179. </el-form-item>
  180. </el-col>
  181. </el-row>
  182. <!-- <el-form-item label="数量" prop="quantity">
  183. <el-input v-model="form.quantity" readonly style="width: 70%;" placeholder="数量"><template slot="append">(吨)</template></el-input>
  184. </el-form-item>
  185. <el-form-item label="合计" prop="quantity">
  186. <el-input :value="form.biddingPrice ? (form.quantity *form.biddingPrice).toFixed(4) : 0" readonly style="width: 70%;" placeholder="请输入金额"><template slot="append">(元)</template></el-input>
  187. </el-form-item>
  188. <el-form-item label="投标价格" prop="biddingPrice">
  189. <div class="mo-input--number">
  190. <el-input-number style="width:100%" v-model="form.biddingPrice" step-strictly controls-position="right" :step="form.biddingStartPrice" :min="form.lowestPrice" :max="form.highestPrice"></el-input-number>
  191. <div class="define-append">(吨/元)</div>
  192. </div>
  193. <div style="color:#909399;fontSize:15px"> * <span style="color:#909399;fontSize:13px;position: relative;top:-5px">价格范围:{{form.lowestPrice}} ~ {{form.highestPrice}}(元),起价:{{form.biddingStartPrice}}(元) </span> </div>
  194. </el-form-item>
  195. <el-form-item label="上传凭证" >
  196. <el-upload
  197. class="upload-demo"
  198. :limit="1"
  199. :on-preview="handlePreview"
  200. :on-change="handleChange"
  201. :on-remove="handleRemove"
  202. :before-remove="beforeRemove"
  203. :on-exceed="handleExceed"
  204. :action="BASE_API+'/common/bidding/voucher'"
  205. name="multipartFile"
  206. list-type="text"
  207. :file-list="fileList"
  208. multiple
  209. >
  210. <el-button class="el-icon-upload" >上传凭证</el-button>
  211. </el-upload>
  212. </el-form-item>
  213. <el-form-item label="联系电话" prop="phone">
  214. <el-input v-model="form.phone" style="width: 73%;" placeholder="请输入联系电话"></el-input>
  215. </el-form-item>
  216. <el-form-item label="备注" prop="biddingLogisticsRemark">
  217. <el-input
  218. v-model="form.remark"
  219. type="textarea"
  220. style="width: 73%;"
  221. :autosize="{ minRows: 2, maxRows: 10}"
  222. maxlength="500"
  223. show-word-limit
  224. placeholder="请输入内容"
  225. />
  226. </el-form-item> -->
  227. <el-row :gutter="20" style="margin-top:20px">
  228. <el-col :span="6" :xs="24" :sm="12" :md="12" :lg="12">
  229. <el-form-item label="数量" prop="quantity">
  230. <el-input v-model="form.quantity" readonly style="width: 80%;" placeholder="数量"><template slot="append">(吨)</template></el-input>
  231. </el-form-item>
  232. </el-col>
  233. <el-col :span="6" :xs="24" :sm="12" :md="12" :lg="12">
  234. <el-form-item label="投标价格" prop="biddingPrice">
  235. <div class="mo-input--number">
  236. <!-- <el-input-number style="width:100%" @change="handleNumberChange" v-model.number="form.biddingPrice" step-strictly controls-position="right" :min="form.lowestPrice" :max="form.highestPrice"></el-input-number> -->
  237. <el-input-number style="width:100%" @change="handleNumberChange" v-model.number="form.biddingPrice" controls-position="right" :step="form.biddingStartPrice" :min="form.lowestPrice" :max="form.highestPrice"></el-input-number>
  238. <!-- <el-input-number style="width:100%" @change="handleNumberChange" v-model.number="biddingPrice" step-strictly controls-position="right" :step="13" :min="208" :max="308"></el-input-number> -->
  239. <div class="define-append">(吨/元)</div>
  240. </div>
  241. <div style="color:#909399;fontSize:15px"> * <span style="color:#909399;fontSize:13px;position: relative;top:-5px">价格范围:{{form.lowestPrice}} ~ {{form.highestPrice}}(元),起价:{{form.biddingStartPrice}}(元) </span> </div>
  242. </el-form-item>
  243. </el-col>
  244. </el-row>
  245. <el-row :gutter="20">
  246. <el-col :span="6" :xs="24" :sm="12" :md="12" :lg="12">
  247. <el-form-item label="合计" prop="quantity">
  248. <el-input :value="form.biddingPrice ? (form.quantity *form.biddingPrice).toFixed(4) : 0" readonly style="width: 80%;" placeholder="请输入金额"><template slot="append">(元)</template></el-input>
  249. </el-form-item>
  250. </el-col>
  251. <el-col :span="6" :xs="24" :sm="12" :md="12" :lg="12">
  252. <el-form-item label="上传凭证" prop="voucherFile" class="is-required">
  253. <el-upload
  254. class="upload-demo"
  255. :limit="1"
  256. :on-preview="handlePreview"
  257. :on-change="handleChange"
  258. :on-remove="handleRemove"
  259. :before-remove="beforeRemove"
  260. :on-exceed="handleExceed"
  261. :action="BASE_API+'/common/bidding/voucher'"
  262. name="multipartFile"
  263. list-type="text"
  264. :file-list="fileList"
  265. multiple
  266. >
  267. <el-button class="el-icon-upload" >上传凭证</el-button>
  268. </el-upload>
  269. </el-form-item>
  270. </el-col>
  271. </el-row>
  272. <el-row :gutter="20" style="margin-top:20px">
  273. <el-col :span="6" :xs="24" :sm="12" :md="12" :lg="12">
  274. <el-form-item label="联系电话" >
  275. <el-input v-model="form.phone" style="width: 80%;" maxlength="11" placeholder="请输入联系电话"></el-input>
  276. </el-form-item>
  277. </el-col>
  278. <el-col :span="6" :xs="24" :sm="12" :md="12" :lg="12">
  279. <el-form-item label="备注" prop="biddingLogisticsRemark">
  280. <el-input
  281. v-model="form.remark"
  282. type="textarea"
  283. style="width: 93%;"
  284. :autosize="{ minRows: 2, maxRows: 10}"
  285. maxlength="500"
  286. show-word-limit
  287. placeholder="请输入内容"
  288. />
  289. </el-form-item>
  290. </el-col>
  291. </el-row>
  292. </el-form>
  293. <div slot="footer" class="dialog-footer">
  294. <el-button @click="dialog = false">取消</el-button>
  295. <el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
  296. </div>
  297. </el-dialog>
  298. <div slot="footer" class="paginationParam" style="paddingRight:">
  299. <!-- <el-button @click="viewDialog = false">取消</el-button> -->
  300. <el-button :loading="loading" type="primary" @click="viewDialog = false">返回</el-button>
  301. </div>
  302. <el-dialog :title="goodsName" width="90%" center :visible.sync="dialogTableVisible" append-to-body>
  303. <ckDialog ref="ckDialog"></ckDialog>
  304. </el-dialog>
  305. </el-dialog>
  306. </div>
  307. </template>
  308. <script>
  309. import { getTableList, getSaleAdd, getQueryEdit, getSaleId } from '@/api/tender'
  310. import { Notification, MessageBox } from 'element-ui'
  311. import ckTable from './table.vue'
  312. import ckDialog from './dialog.vue'
  313. export default {
  314. components:{
  315. ckTable,
  316. ckDialog
  317. },
  318. data() {
  319. const checkTel = (rule, value, callback) => {
  320. if (value == null) {
  321. callback(new Error('请选择附件'))
  322. } else {
  323. callback()
  324. }
  325. }
  326. const checkTel1 = (rule, value, callback) => {
  327. console.log(this.form.voucherFile)
  328. console.log(value, 'value')
  329. if (this.form.voucherFile == null || this.form.voucherFile == '') {
  330. callback(new Error('请选择凭证'))
  331. console.log('没过')
  332. } else {
  333. callback()
  334. console.log('过')
  335. }
  336. }
  337. return {
  338. form: {
  339. voucherFile:"",
  340. biddingPrice:0
  341. },
  342. data: [{}],
  343. active:0,
  344. BASE_API: process.env.BASE_API,
  345. dialog: false,
  346. loading: false,
  347. delLoading: false,
  348. tableLoading:false,
  349. viewDialog: false,
  350. isAdd: false,
  351. currentPage: 1,
  352. pageSize: 10,
  353. total: 0, // 总数量
  354. rules1:{
  355. departureStation:[
  356. { required: true, message: '始发车站不为空', trigger: 'blur' },
  357. ],
  358. destinationStation:[
  359. { required: true, message: '目的车站不为空', trigger: 'blur' },
  360. ],
  361. biddingPrice:[
  362. { required: true, message: '投标价格不为空', trigger: 'blur' },
  363. ],
  364. packingWay:[
  365. { required: true, message: '包装方式不为空', trigger: 'blur' },
  366. ],
  367. phone:[
  368. { required: true, message: '联系电话不为空', trigger: 'blur' },
  369. ],
  370. transportMode:[
  371. { required: true, message: '运输方式不为空', trigger: 'blur' },
  372. ],
  373. voucherFile: [
  374. { validator: checkTel1, trigger: 'change' }
  375. ]
  376. },
  377. rules: {
  378. price: [
  379. { required: true, message: '报价金额不为空', trigger: 'blur' },
  380. ],
  381. appendix: [
  382. // { type:"array",required: true, message: '附件不为空', trigger: 'blur' },
  383. { validator: checkTel, trigger: 'blur' }
  384. ]
  385. },
  386. query: {
  387. type: '',
  388. value: '',
  389. tenderRule:"",
  390. tenderType:"",
  391. startTime:"",
  392. endTime:""
  393. },
  394. fileList: [],
  395. param: {
  396. current: 1,
  397. size: 10
  398. },
  399. total1: 0,
  400. Paramdata: [],
  401. applyDateStart:[],
  402. dialogTableData:[],
  403. tenderRule:[
  404. {id:1,name:"价低者得"},
  405. {id:2,name:"价高者得"},
  406. ],
  407. packingWay:[
  408. {id:1,name:"散粮"},
  409. {id:2,name:"袋装"},
  410. {id:3,name:"散装"},
  411. {id:4,name:"集装箱"},
  412. ],
  413. transportMode:[
  414. {id:1,name:"汽运"},
  415. {id:2,name:"火车运输"},
  416. {id:3,name:"船运"},
  417. {id:4,name:"汽运/火车运输/船运"},
  418. {id:5,name:"汽运/火车运输"},
  419. {id:6,name:"汽运/船运"},
  420. ],
  421. activeName: 'first',
  422. dialogTableVisible:false,
  423. goodsName:"",
  424. bidInfo:{},
  425. biddingPrice:null,
  426. biddingStartPrice:null,
  427. lowestPrice :null,
  428. highestPrice:null
  429. }
  430. },
  431. created() {
  432. // this.getDictData()
  433. },
  434. methods: {
  435. changeAdd(row){
  436. console.log(row)
  437. this.handleAdd(row)
  438. },
  439. // 投标详情 向父元素传递数据
  440. costPlannedAmountChange(val){
  441. console.log(val)
  442. this.dialogTableVisible = true
  443. setTimeout(() => {
  444. this.goodsName = val.goodsName
  445. this.$refs.ckDialog.priceData = val
  446. this.$refs.ckDialog.handleFind()
  447. console.log(this.$refs.ckDialog)
  448. }, 300);
  449. },
  450. handleNumberChange(val,row){
  451. console.log(val,row)
  452. // if(val > row){
  453. // console.log("我是加")
  454. // this.form.biddingPrice = row + this.form.biddingStartPrice
  455. // }else if (val < row){
  456. // console.log("我是减")
  457. // this.form.biddingPrice = row - this.form.biddingStartPrice
  458. // }
  459. },
  460. // 价格投标不能大于合计
  461. onlogistiicsPrice(val){
  462. console.log(val)
  463. if(val>this.form.transportUnitPrice){
  464. this.form.logisticsBiddingPrice = this.form.transportUnitPrice
  465. console.log("我是大于")
  466. }
  467. if(val.indexOf('.') !== -1 && val == '.'){
  468. this.form.logisticsBiddingPrice =0
  469. }
  470. if(val== "+" || val== "-"){
  471. this.form.logisticsBiddingPrice = 0
  472. }
  473. if(val<0){
  474. this.form.logisticsBiddingPrice = 0
  475. }
  476. },
  477. onApplyDate(){
  478. let startTime
  479. let endTime
  480. if(this.applyDateStart != null){
  481. this.param.startTime =this.applyDateStart[0]
  482. this.param.endTime = this.applyDateStart[1]
  483. }else{
  484. this.param.startTime =""
  485. this.param.endTime =""
  486. }
  487. this.getParamFexd()
  488. },
  489. next() {
  490. console.log(this.$refs.ckTable)
  491. if (this.active++ > 2) this.active = 0;
  492. this.dialogTableData = this.$refs.ckTable.SelectionList
  493. },
  494. handleSelectionChange(row){
  495. },
  496. // 获取详情
  497. getDictData: function() {
  498. this.loading = true
  499. const params = new URLSearchParams()
  500. params.append('current', this.currentPage)
  501. params.append('size', this.pageSize)
  502. params.append('tenderType', this.query.tenderType)
  503. params.append('tenderTitle', this.query.value)
  504. params.append('tenderRule', this.query.tenderRule)
  505. params.append('startTime',this.query.startTime )
  506. params.append('endTime', this.query.endTime)
  507. getTableList(params).then(res => {
  508. console.log(res)
  509. // this.data = res.data.data.records
  510. let data = res.data.data.records
  511. console.log(new Date().valueOf(),"当前时间")
  512. data.map((res)=>{
  513. // 开始时间
  514. let startTime = res.startTime
  515. // 投标结束时间
  516. let endTime = res.endTime
  517. const date = new Date(startTime)
  518. const modify = new Date(endTime)
  519. const start = date.valueOf() //开始时间
  520. const end = modify.valueOf() //投标结束时间
  521. const time = new Date().valueOf() //当前时间
  522. console.log(start,"start")
  523. console.log(end,"end")
  524. if(res.isInvalid == 2){
  525. res.status = 3
  526. console.log("作废了")
  527. }else if(time < start){
  528. res.status = 4
  529. console.log("当前时间小于开始时间,未开始")
  530. }else if(time > start && time < end){
  531. res.status = 1
  532. console.log("当前时间大于开始时间并且小于结束时间,进行中")
  533. }else if(time > end){
  534. res.status = 2
  535. console.log("当前时间大于结束时间,已结束")
  536. }
  537. return res
  538. })
  539. this.data = data
  540. this.total = res.data.data.total
  541. this.loading = false
  542. })
  543. },
  544. // 搜索
  545. handleFind: function() {
  546. this.currentPage = 1
  547. this.getDictData()
  548. },
  549. // 文件移除的时候
  550. handleRemove(file, fileList) {
  551. this.form.voucherFile = ''
  552. console.log(file, fileList, this.fileList, '移出')
  553. },
  554. // 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
  555. handleChange(file, fileList) {
  556. console.log(file, fileList, '上传')
  557. if (file.response) {
  558. console.log(file.response, 'file')
  559. if (file.response.code == '200') {
  560. this.form.voucherFile = file.response.data.filePath
  561. } else {
  562. Notification.error({
  563. title: file.response.msg,
  564. duration: 1000
  565. })
  566. this.fileList = []
  567. }
  568. }
  569. },
  570. // 点击文件列表中已上传的文件时的钩子
  571. handlePreview(file) {
  572. console.log(file, 'file1')
  573. // window.location.href = file.url
  574. },
  575. handleExceed(files, fileList) {
  576. this.$message.warning(`当前限制选择 1 个附件,本次选择了 ${files.length} 个文件`)
  577. },
  578. beforeRemove(file, fileList) {
  579. return this.$confirm(`确定移除 ${file.name}?`)
  580. },
  581. // 下载
  582. onLoad(row) {
  583. // const params = new URLSearchParams()
  584. // params.append('path', row)
  585. const a = document.createElement('a')
  586. // a.href= /bidding/load
  587. const url = window.location.origin + process.env.BASE_API + '/bidding/load?path=' + encodeURIComponent(row)
  588. a.href = url
  589. a.click()
  590. },
  591. // 字典名称提交动作
  592. doSubmit() {
  593. this.$refs['form'].validate((valid) => {
  594. if (valid) {
  595. if (this.isAdd) {
  596. // 新增字典
  597. console.log(this.form)
  598. this.loading = true
  599. getSaleAdd(this.form).then((res) => {
  600. if (res.data.code === 200) {
  601. this.$message({ message: '操作成功', type: 'success' })
  602. } else {
  603. this.$message({ message: res.data.msg, type: 'error' })
  604. }
  605. this.dialog = false
  606. this.loading = false
  607. // this.getDictData()
  608. this.$refs['form'].resetFields()
  609. }).catch(err => {
  610. this.loading = false
  611. })
  612. } else {
  613. // 更新字典
  614. getQueryEdit(this.form).then((res) => {
  615. if (res.data.code === 200) {
  616. this.$message({ message: '操作成功', type: 'success' })
  617. } else {
  618. this.$message({ message: res.data.msg, type: 'error' })
  619. }
  620. this.dialog = false
  621. this.getDictData()
  622. })
  623. }
  624. }
  625. })
  626. },
  627. // 添加字典
  628. handleAdd: function(row) {
  629. this.form = {}
  630. this.fileList = []
  631. this.form.tenderSaleId = row.tenderSaleId
  632. this.form.tenderParentId = this.param.tenderParentId
  633. this.form.quantity = row.number
  634. this.form.goodsName = row.productName
  635. this.form.tenderCode = row.tenderCode
  636. this.$set(this.form, "biddingPrice", row.lowestPrice)
  637. this.form.biddingStartPrice = row.biddingStartPrice
  638. this.form.lowestPrice = row.lowestPrice
  639. // this.form.highestPrice = row.highestPrice
  640. this.$set(this.form, "highestPrice", row.highestPrice)
  641. // this.form.biddingPrice = row.lowestPrice
  642. this.dialog = true
  643. this.isAdd = true
  644. console.log(row,"row")
  645. console.log(this.form)
  646. if (this.$refs['form']) {
  647. this.$refs['form'].resetFields()
  648. }
  649. },
  650. // 编辑字典
  651. handleEdit: function(row) {
  652. if (this.$refs['form']) {
  653. this.$refs['form'].resetFields()
  654. }
  655. this.dialog = true
  656. this.isAdd = false
  657. this.form = row.bidding
  658. this.form.priceQuotes = row.priceQuotes
  659. if (this.form.appendix) {
  660. let name = this.form.appendix.split('bidding/')
  661. name = name.pop()
  662. // let name = data.appendix.replace(/(.*\/)*([^.]+).*/ig, "$2");
  663. this.fileList = [{ name: name, url: this.form.appendix }]
  664. }
  665. },
  666. handleClick(row,val){
  667. console.log(row,val)
  668. if(row.name == "second"){
  669. this.$refs.ckTable.tenderParentId = this.param.tenderParentId
  670. this.$refs.ckTable.productName =""
  671. this.$refs.ckTable.handleFind()
  672. }
  673. },
  674. handleView(row) {
  675. let tenderType = row.tenderType
  676. if(tenderType == 1){
  677. this.$refs.ckTender.viewDialog = true
  678. setTimeout(() => {
  679. this.$refs.ckTender.activeName="first"
  680. this.$refs.ckTender.param.tenderParentId = row.tenderParentId
  681. this.$refs.ckTender.bidInfo = row
  682. this.$refs.ckTender.param.current = 1
  683. this.$refs.ckTender.getParam()
  684. console.log("物流")
  685. }, 300);
  686. }else if(tenderType == 3){
  687. this.saleViewDialog = true
  688. console.log("销售")
  689. }
  690. },
  691. // 所有标的搜索
  692. getParamFexd(){
  693. this.param.current = 1
  694. this.getParam()
  695. },
  696. // 所有标的列表数据
  697. getParam() {
  698. const data = this.param
  699. this.tableLoading = true
  700. getSaleId(data).then((res) => {
  701. console.log(res.data.data.records, '')
  702. let data = res.data.data.records
  703. data.map((res)=>{
  704. // 开始时间
  705. let startTime = res.startTime
  706. // 投标结束时间
  707. let endTime = res.endTime
  708. const date = new Date(startTime)
  709. const modify = new Date(endTime)
  710. const start = date.valueOf() //开始时间
  711. const end = modify.valueOf() //投标结束时间
  712. const time = new Date().valueOf() //当前时间
  713. console.log(start,"start")
  714. console.log(end,"end")
  715. if(res.tenderStatus == 1 || res.tenderStatus == 2){
  716. res.status = res.tenderStatus
  717. console.log("我的状态是:" + res.tenderStatus)
  718. }else if(time < start){
  719. res.status = 4
  720. console.log("当前时间小于开始时间,未开始")
  721. }else if(time > start && time < end){
  722. res.status = 3
  723. console.log("当前时间大于开始时间并且小于结束时间,进行中")
  724. }else if(time > end){
  725. res.status = 5
  726. console.log("当前时间大于结束时间,待处理")
  727. }
  728. return res
  729. })
  730. this.Paramdata = data
  731. this.tableLoading = false
  732. this.total1 = res.data.data.total
  733. })
  734. },
  735. // 换页
  736. handleCurrentChange: function(val) {
  737. this.currentPage = val
  738. this.getDictData()
  739. },
  740. handleSizeChange(val) {
  741. this.pageSize = val
  742. this.getDictData()
  743. },
  744. handleCurrentChangeParam(val) {
  745. this.param.current = val
  746. this.getParam()
  747. },
  748. handleSizeChangeParam(val) {
  749. this.param.size = val
  750. this.getParam()
  751. }
  752. }
  753. }
  754. </script>
  755. <style scoped lang="scss">
  756. /* 去掉上传附件时候的过度效果 */
  757. ::v-deep .el-upload-list__item{transition: none !important;}
  758. ::v-deep .el-textarea__inner{
  759. padding-bottom: 36px;
  760. }
  761. .btn_fixed{
  762. position: fixed;
  763. bottom: 0;
  764. left: 0;
  765. padding: 15px 50px;
  766. width: 100%;
  767. text-align: right;
  768. background: #f5f5f5;
  769. }
  770. .ckTable{
  771. width: 100%;
  772. border: #eee;
  773. text-align: center;
  774. tr,td{
  775. border: 0.5px solid#dfe6ec;
  776. line-height: 23px;
  777. }
  778. }
  779. .paginationParam{
  780. // position: fixed;
  781. // bottom: 50px;
  782. bottom: 0;
  783. left: 0;
  784. line-height: 80px;
  785. width: 100%;
  786. // left: 45%;
  787. // text-align: right;
  788. z-index: 999;
  789. background: #fff;
  790. }
  791. /deep/ .el-tabs__item{
  792. font-size: 16px !important;
  793. // padding: 35px ;
  794. }
  795. .el-card {
  796. border: 0px solid #fff;
  797. }
  798. .clearfix {
  799. line-height: 20px;
  800. font-size: 18px;
  801. font-weight: 600;
  802. color: #409EFF;
  803. }
  804. /deep/.el-dialog.is-fullscreen {
  805. background-color: #f5f7f9;
  806. }
  807. .box-card{
  808. margin-bottom: 20px;
  809. .row-bg{
  810. padding: 15px 40px 0 40px;
  811. .flex_text{
  812. line-height: 50px;
  813. color: #8C8C8C;
  814. font-size: 14px;
  815. // border:1px solid red;
  816. // font-weight: 600;
  817. }
  818. .flex_name{
  819. font-size: 14px;
  820. padding-left: 25px;
  821. color: #575757;
  822. font-weight: 550;
  823. }
  824. }
  825. }
  826. /deep/ .el-card__body{
  827. padding: 20px 0;
  828. }
  829. /deep/.el-tabs__nav-wrap::after {
  830. background-color: #dfe4ed00;
  831. }
  832. /deep/ .el-dialog--center .el-dialog__body {
  833. text-align: initial;
  834. padding: 25px 25px 0px 30px;
  835. }
  836. /deep/ .el-tabs--border-card{
  837. // border-top:1px ;
  838. border-bottom: 0px;
  839. box-shadow: 0px 0px 0px 0px rgba(0,0,0,0.5)
  840. }
  841. .mo-input--number {
  842. border: 1px solid #DCDFE6;
  843. width: 70%;
  844. display: flex;
  845. border-radius: 4px;
  846. .el-input-number--mini{
  847. flex: 1;
  848. }
  849. ::v-deep .el-input__inner{
  850. border: none!important;
  851. }
  852. }
  853. .define-append{
  854. background-color: #F5F7FA;
  855. color: #909399;
  856. vertical-align: middle;
  857. display: table-cell;
  858. position: relative;
  859. border-left: 1px solid #DCDFE6;
  860. border-radius: 4px;
  861. padding: 0 20px;
  862. // width: 1px;
  863. white-space: nowrap;
  864. }
  865. </style>