dialog.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. <template>
  2. <div class="" style="margin: 30px 0 10px 0;">
  3. <!-- 查询和其他操作 -->
  4. <div class="" style="margin: 10px 0 30px 0;">
  5. <span style="font-size:14px">客户名称:</span>
  6. <el-select v-model="goodsName" filterable style="width: 200px;" clearable size="small" placeholder="请选择" @clear="handleFind">
  7. <el-option v-for="item in userDataList" :key="item.customerId" :label="item.customerName" :value="item.customerId" />
  8. </el-select>
  9. <span style="font-size:14px;margin-left:20px">是否为历史记录:</span>
  10. <el-select v-model="historyValue" style="width: 200px;" @keyup.enter.native="handleFind" @clear="handleFind" size="small" clearable value-key="areaId" filterable placeholder="请选择">
  11. <el-option
  12. v-for="item in history"
  13. :key="item.id"
  14. :label="item.name"
  15. :value="item.id"
  16. />
  17. </el-select>
  18. <el-button style=" width:90px; " size="small" type="primary" icon="el-icon-search" @click="handleFind">查询
  19. </el-button>
  20. <!-- <el-upload
  21. :disabled="!showType"
  22. class="upload-demo"
  23. :limit="1"
  24. :on-change="handleChange"
  25. :on-remove="handleRemove"
  26. :show-file-list="false"
  27. name="multipartFile"
  28. style="display:inline-block"
  29. :action="BASE_API+'/common/tender/file/'"
  30. list-type="text"
  31. :data="fileData"
  32. :file-list="fileList"
  33. multiple
  34. >
  35. <el-button @click="handleUpload" class="el-icon-upload" size="small" type="primary" style="width:90px; ">发送文件</el-button>
  36. </el-upload> -->
  37. </div>
  38. <el-table ref="multipleTable" v-loading="loading" :data="tableData" @selection-change="handleSelectionChange" @row-click="handleHighlightChangeTable" :header-cell-style="{ background: '#f5f7fa', }" style="width: 100%" border >
  39. <!-- <el-table-column
  40. :selectable="selectable"
  41. :max="1"
  42. type="selection"
  43. width="55">
  44. </el-table-column> -->
  45. <el-table-column label="客户名称" prop="customerName" fixed="left" width="150" align="center" :show-overflow-tooltip="true">
  46. </el-table-column>
  47. <el-table-column label="运输方式" prop="goodsName" align="center" :show-overflow-tooltip="true">
  48. <template slot-scope="scope">
  49. <span v-if="scope.row.transportMode == 1">陆运</span>
  50. <!-- <span v-if="scope.row.transportMode == 2">汽运</span> -->
  51. <span v-if="scope.row.transportMode == 2">火车运输</span>
  52. <span v-if="scope.row.transportMode == 3">船运</span>
  53. <span v-if="scope.row.transportMode == 4">汽运/火车运输/船运</span>
  54. <span v-if="scope.row.transportMode == 5">汽运/火车运输</span>
  55. <span v-if="scope.row.transportMode == 6">汽运/船运</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="投标价格" prop="logisticsBiddingPrice" width="150" align="center" :show-overflow-tooltip="true">
  59. </el-table-column>
  60. <el-table-column label="数量(吨)" prop="quantity" width="150" align="center" :show-overflow-tooltip="true">
  61. </el-table-column>
  62. <el-table-column label="总价" prop="logisticsTotalPrice" width="150" align="center" :show-overflow-tooltip="true">
  63. </el-table-column>
  64. <el-table-column label="联系电话" prop="phone" width="150" align="center" :show-overflow-tooltip="true">
  65. </el-table-column>
  66. <el-table-column :show-overflow-tooltip="true" label="包装方式" width="100" align="center">
  67. <template slot-scope="scope">
  68. <span v-if="scope.row.packingWay == 0">未知</span>
  69. <span v-if="scope.row.packingWay == 1">散粮</span>
  70. <span v-if="scope.row.packingWay == 2">袋装</span>
  71. <span v-if="scope.row.packingWay == 3">散装</span>
  72. <span v-if="scope.row.packingWay == 4">集装箱</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="状态" align="center" width="100">
  76. <template slot-scope="scope">
  77. <el-tag effect="plain" v-if="scope.row.biddingStatus == 5">已投递</el-tag>
  78. <el-tag effect="plain" v-if="scope.row.biddingStatus ==6" type="info">审核中</el-tag>
  79. <el-tag effect="plain" v-if="scope.row.biddingStatus ==7" type="warning">已中标</el-tag>
  80. <el-tag effect="plain" v-if="scope.row.biddingStatus ==8" type="danger">未中标</el-tag>
  81. <el-tag effect="plain" v-if="scope.row.biddingStatus ==9" type="danger">已作废</el-tag>
  82. </template>
  83. </el-table-column>
  84. <el-table-column prop="appendix" label="凭证" align="center" width="100">
  85. <template slot-scope="scope">
  86. <el-link :disabled="scope.row.voucherFile ? false : true" :href="scope.row.voucherFile" type="primary" target="_target"><i class="el-icon-view"></i> 下载</el-link>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="始发车站" prop="departureStation" width="190" align="center" :show-overflow-tooltip="true">
  90. </el-table-column>
  91. <el-table-column label="目的车站" prop="destinationStation" width="150" align="center" :show-overflow-tooltip="true">
  92. </el-table-column>
  93. <el-table-column label="投标时间" prop="logisticsBiddingTime" width="150" align="center" :show-overflow-tooltip="true">
  94. </el-table-column>
  95. <el-table-column label="备注" prop="biddingLogisticsRemark" width="150" align="center" :show-overflow-tooltip="true">
  96. </el-table-column>
  97. <el-table-column label="操作" width="250" fixed="right" align="center">
  98. <template slot-scope="scope">
  99. <el-button slot="reference" :disabled="scope.row.biddingStatus !=6" icon="el-icon-check" type="text" @click="dialogVisible=true;dataForm=scope.row">中标</el-button>
  100. <!-- <el-button slot="reference" icon="el-icon-check" type="text" @click="dialogVisible=true">中标</el-button> -->
  101. <el-upload
  102. :disabled="scope.row.biddingStatus !=7"
  103. class="upload-demo"
  104. :on-change="handleChange"
  105. :on-remove="handleRemove"
  106. :show-file-list="false"
  107. name="multipartFile"
  108. style="display:inline-block"
  109. :action="BASE_API+'/common/tender/contract/send/' + scope.row.customerId"
  110. list-type="text"
  111. :data="fileData"
  112. :file-list="fileList"
  113. multiple
  114. >
  115. <el-button @click="handleUpload" :disabled="scope.row.biddingStatus !=7" class="el-icon-upload2" size="small" type="text" style="width:90px;font-size:14px ">发送合同</el-button>
  116. </el-upload>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <!--分页-->
  121. <div class="pagination">
  122. <el-pagination
  123. :current-page="current"
  124. :page-sizes="[1,10, 20, 30, 50]"
  125. :page-size="size"
  126. layout="total, sizes, prev, pager, next, jumper"
  127. background
  128. :total="total"
  129. @size-change="handleSizeChange"
  130. @current-change="handleCurrentChange"
  131. />
  132. </div>
  133. <el-dialog
  134. title=""
  135. :visible.sync="dialogVisible"
  136. width="35%"
  137. top="35vh"
  138. append-to-body
  139. >
  140. <span style="font-size:16px">此操作将“{{dataForm.customerName}}”,置中标</span>
  141. <span slot="footer" class="dialog-footer">
  142. <el-button @click="dialogVisible = false">取 消</el-button>
  143. <el-upload
  144. class="upload-demo"
  145. :on-change="handleChange"
  146. :on-remove="handleRemove"
  147. :show-file-list="false"
  148. name="multipartFile"
  149. style="display:inline-block"
  150. :action="BASE_API+'/common/tender/contract/send/' + dataForm.customerId"
  151. list-type="text"
  152. :data="fileData"
  153. :file-list="fileList"
  154. multiple
  155. >
  156. <el-button @click="changeBid" type="primary" >确定并发送合同</el-button>
  157. </el-upload>
  158. <el-button type="primary" @click="changeBid">确 定</el-button>
  159. </span>
  160. </el-dialog>
  161. </div>
  162. </template>
  163. <script>
  164. import { Listarea } from '@/api/dataForm'
  165. import { parseTime } from '@/utils/index'
  166. import { getLogisticsInfo,getCustomerName ,getContract} from '@/api/bid'
  167. import { Notification, MessageBox } from 'element-ui'
  168. export default {
  169. data() {
  170. return {
  171. // size: 'small',
  172. tableData: [],
  173. priceData: {},
  174. SelectionList:[],
  175. goodsName: '',
  176. tenderParentId: '',
  177. applyDateStart:[],
  178. customerType: [
  179. { id: 1, name: '有限责任公司(自然人独资)' },
  180. { id: 2, name: '有限责任公司(自然人投资或控股)' },
  181. { id: 3, name: '股份有限公司' },
  182. { id: 4, name: '有限合伙企业' },
  183. { id: 5, name: '外商独资公司' },
  184. { id: 6, name: '个人独资企业' },
  185. { id: 7, name: '国有独资公司' },
  186. { id: 8, name: '其他' }
  187. ],
  188. history:[
  189. {id:0,name:"否"},
  190. {id:1,name:"是"}
  191. ],
  192. historyValue:"",
  193. areaList: [],
  194. query: {
  195. goodsName: '',
  196. tenderParentId:""
  197. },
  198. formLabelWidth: '90px',
  199. isEditForm: false,
  200. current: 1,
  201. size: 10,
  202. total: 0, // 总数量
  203. dataForm: {
  204. },
  205. loading: false,
  206. dialogVisible: false,
  207. batchVisible:false,
  208. BASE_API: process.env.BASE_API,
  209. fileList: [],
  210. roles:[],
  211. userDataList:[],
  212. startTime:"",
  213. endTime:"",
  214. isShow:true,
  215. showType:false,
  216. fileData:{}
  217. }
  218. },
  219. created() {
  220. this.onCustmerName()
  221. console.log(this.priceData,"priceData")
  222. },
  223. methods: {
  224. // 置中标
  225. changeBid(){
  226. console.log(this.dataForm)
  227. console.log(this.priceData,"priceData")
  228. getContract(this.dataForm.tenderLogisticsId,this.dataForm.biddingLogisticsId,this.priceData.tenderType).then((res)=>{
  229. if(res.data.code == 200){
  230. this.$message({
  231. message: '操作成功',
  232. type: 'success'
  233. });
  234. this.dialogVisible = false
  235. this.getTenantList()
  236. }
  237. })
  238. },
  239. // 点击时候
  240. handleUpload(){
  241. console.log(this.SelectionList,"我被固定了")
  242. // if(this.SelectionList.length == 0){
  243. // this.$message({
  244. // message: '请先选择已中标的客户',
  245. // type: 'warning'
  246. // });
  247. // }
  248. // return false
  249. },
  250. // 文件移除的时候
  251. handleRemove(file, fileList) {
  252. this.form.fileUrl = ''
  253. console.log(file, fileList, this.fileList, '移出')
  254. },
  255. // 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
  256. handleChange(file, fileList) {
  257. console.log(file, fileList, '上传')
  258. if (file.response) {
  259. console.log(file.response, 'file')
  260. if (file.response.code == '200') {
  261. this.$message({
  262. message: '合同发送成功',
  263. type: 'success'
  264. });
  265. // this.form.fileUrl = file.response.data.filePath
  266. // this.form.tenderParentId = file.response.data.tenderParentId
  267. } else {
  268. Notification.error({
  269. title: file.response.msg,
  270. duration: 1000
  271. })
  272. }
  273. }
  274. },
  275. onCustmerName(){
  276. getCustomerName().then((res)=>{
  277. console.log(res)
  278. this.userDataList = res.data.data
  279. })
  280. },
  281. onshow(){
  282. this.isShow = !this.isShow
  283. },
  284. parseTime,
  285. getTenantList: function() {
  286. console.log(this.priceData)
  287. const params = new URLSearchParams()
  288. params.append('customerId', this.goodsName)
  289. params.append('isHistory', this.historyValue)
  290. params.append('tenderLogisticsId', this.priceData.logisticsBidId)
  291. params.append('current', this.current)
  292. params.append('size', this.size)
  293. this.loading =true
  294. getLogisticsInfo(params).then(response => {
  295. console.log(response)
  296. this.loading = false
  297. let data = response.data.data.records
  298. data.map((res)=>{
  299. // 投标时间
  300. let startTime = this.priceData.endTime
  301. const date = new Date(startTime)
  302. const start = date.valueOf() //开始时间
  303. const time = new Date().valueOf() //当前时间
  304. console.log(start,"start")
  305. if(res.biddingStatus < 7){
  306. console.log("我不满足")
  307. if(time < start){
  308. res.biddingStatus = 5
  309. console.log("当前时间小于投标时间,已投递")
  310. }else if(time > start){
  311. res.biddingStatus = 6
  312. console.log("当前时间小于投标时间,审核中")
  313. }
  314. }
  315. return res
  316. })
  317. this.tableData = data
  318. this.total = response.data.data.total
  319. })
  320. },
  321. onApplyDate(){
  322. let startTime
  323. let endTime
  324. if(this.applyDateStart != null){
  325. this.startTime =this.applyDateStart[0]
  326. this.endTime = this.applyDateStart[1]
  327. }else{
  328. this.startTime =""
  329. this.endTime =""
  330. }
  331. this.getTenantList()
  332. },
  333. handleFind: function() {
  334. this.current = 1
  335. this.getTenantList()
  336. },
  337. handleSizeChange: function(val) {
  338. this.size = val
  339. this.getTenantList()
  340. },
  341. // 换页
  342. handleCurrentChange: function(val) {
  343. const page = val.toString()
  344. this.current = page
  345. this.getTenantList()
  346. },
  347. // 查看
  348. // lookRecord:function(row){
  349. // this.lookCord=row
  350. // this.dialogVisible = true
  351. // console.log(row)
  352. // },
  353. handleOneChange(row,i){
  354. console.log(row,i)
  355. this.$refs.multipleTable.toggleRowSelection(row);
  356. },
  357. selectable(row){
  358. console.log(row,"我是selectable")
  359. if(row.biddingStatus == 7){
  360. return true
  361. }
  362. },
  363. handleSelectionChange(list){
  364. console.log(list)
  365. if (list.length > 1) {
  366. this.$refs.multipleTable.clearSelection();
  367. return;
  368. }
  369. this.SelectionList = [...list];
  370. if(this.SelectionList.length >0){
  371. this.showType = true
  372. }else{
  373. this.showType = false
  374. }
  375. },
  376. handleHighlightChangeTable(row){
  377. if(row.biddingStatus == 7){
  378. this.$refs.multipleTable.toggleRowSelection(row);
  379. }
  380. },
  381. }
  382. }
  383. </script>
  384. <style scoped lang="scss" >
  385. .ckTable{
  386. width: 100%;
  387. border: #eee;
  388. text-align: center;
  389. tr,td{
  390. border: 0.5px solid#dfe6ec;
  391. line-height: 23px;
  392. }
  393. }
  394. .el-dropdown-link {
  395. cursor: pointer;
  396. color: #1282f3;
  397. }
  398. .el-icon-arrow-down {
  399. font-size: 12px;
  400. }
  401. .el-scrollbar__wrap {
  402. overflow-y: hidden;
  403. }
  404. .el-card {
  405. border: 0px solid #fff;
  406. .topClass{
  407. font-weight: 600;
  408. font-size: 17px;
  409. }
  410. }
  411. .el-icon-document{
  412. font-size: 70px;
  413. color:#409EFF;
  414. line-height: 130px;
  415. }
  416. /deep/.el-card__body {
  417. padding: 20px 10px 0 10px !important;
  418. }
  419. /deep/ .el-table__expanded-cell[class*=cell]{
  420. padding: 0;
  421. }
  422. .pagination{
  423. padding-bottom: 30px;
  424. }
  425. </style>