dialog.vue 13 KB

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