dialog.vue 13 KB

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