dialog.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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. userDataList:[],
  165. startTime:"",
  166. endTime:"",
  167. isShow:true
  168. }
  169. },
  170. created() {
  171. this.onCustmerName()
  172. console.log('res')
  173. },
  174. methods: {
  175. // 置中标
  176. changeBid(){
  177. console.log(this.dataForm)
  178. console.log(this.priceData,"priceData")
  179. getContract(this.dataForm.tenderProcessingId,this.dataForm.biddingProcessingId,this.priceData.tenderType).then((res)=>{
  180. if(res.data.code == 200){
  181. this.$message({
  182. message: '操作成功',
  183. type: 'success'
  184. });
  185. this.dialogVisible = false
  186. this.getTenantList()
  187. }
  188. })
  189. },
  190. // 点击时候
  191. handleUpload(){
  192. console.log(this.SelectionList,"我被固定了")
  193. // if(this.SelectionList.length == 0){
  194. // this.$message({
  195. // message: '请先选择已中标的客户',
  196. // type: 'warning'
  197. // });
  198. // }
  199. // return false
  200. },
  201. // 文件移除的时候
  202. handleRemove(file, fileList) {
  203. this.form.fileUrl = ''
  204. console.log(file, fileList, this.fileList, '移出')
  205. },
  206. // 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
  207. handleChange(file, fileList) {
  208. console.log(file, fileList, '上传')
  209. if (file.response) {
  210. console.log(file.response, 'file')
  211. if (file.response.code == '200') {
  212. this.$message({
  213. message: '合同发送成功',
  214. type: 'success'
  215. });
  216. // this.form.fileUrl = file.response.data.filePath
  217. // this.form.tenderParentId = file.response.data.tenderParentId
  218. } else {
  219. Notification.error({
  220. title: file.response.msg,
  221. duration: 1000
  222. })
  223. }
  224. }
  225. },
  226. onCustmerName(){
  227. getCustomerName().then((res)=>{
  228. console.log(res)
  229. this.userDataList = res.data.data
  230. })
  231. },
  232. onshow(){
  233. this.isShow = !this.isShow
  234. },
  235. parseTime,
  236. getTenantList: function() {
  237. console.log(this.priceData)
  238. const params = new URLSearchParams()
  239. params.append('tenderParentId', this.priceData.tenderParentId)
  240. params.append('customerId', this.goodsName)
  241. params.append('isHistory', this.historyValue)
  242. params.append('biddingProcessingId', this.priceData.tenderProcessingId)
  243. params.append('current', this.current)
  244. params.append('size', this.size)
  245. this.loading =true
  246. getBiddingList(params).then(response => {
  247. console.log(response)
  248. this.loading = false
  249. let data = response.data.data.records
  250. console.log(new Date().valueOf(),"当前时间")
  251. data.map((res)=>{
  252. // 投标时间
  253. let startTime = this.priceData.endTime
  254. const date = new Date(startTime)
  255. const start = date.valueOf() //开始时间
  256. const time = new Date().valueOf() //当前时间
  257. console.log(start,"start")
  258. if(res.biddingStatus < 7){
  259. console.log("我不满足")
  260. if(time < start){
  261. res.biddingStatus = 5
  262. console.log("当前时间小于投标时间,已投递")
  263. }else if(time > start){
  264. res.biddingStatus = 6
  265. console.log("当前时间小于投标时间,审核中")
  266. }
  267. }
  268. return res
  269. })
  270. console.log(data)
  271. this.tableData = data
  272. console.log('1' + response.data.data.records)
  273. this.total = response.data.data.total
  274. })
  275. },
  276. onApplyDate(){
  277. let startTime
  278. let endTime
  279. if(this.applyDateStart != null){
  280. this.startTime =this.applyDateStart[0]
  281. this.endTime = this.applyDateStart[1]
  282. }else{
  283. this.startTime =""
  284. this.endTime =""
  285. }
  286. this.getTenantList()
  287. },
  288. handleFind: function() {
  289. this.current = 1
  290. this.getTenantList()
  291. },
  292. handleSizeChange: function(val) {
  293. this.size = val
  294. this.getTenantList()
  295. },
  296. // 换页
  297. handleCurrentChange: function(val) {
  298. const page = val.toString()
  299. this.current = page
  300. this.getTenantList()
  301. },
  302. // 查看
  303. // lookRecord:function(row){
  304. // this.lookCord=row
  305. // this.dialogVisible = true
  306. // console.log(row)
  307. // },
  308. handleOneChange(row,i){
  309. console.log(row,i)
  310. this.$refs.multipleTable.toggleRowSelection(row);
  311. },
  312. handleSelectionChange(row){
  313. console.log(row)
  314. this.SelectionList = row
  315. }
  316. }
  317. }
  318. </script>
  319. <style scoped lang="scss" >
  320. .ckTable{
  321. width: 100%;
  322. border: #eee;
  323. text-align: center;
  324. tr,td{
  325. border: 0.5px solid#dfe6ec;
  326. line-height: 23px;
  327. }
  328. }
  329. .el-dropdown-link {
  330. cursor: pointer;
  331. color: #1282f3;
  332. }
  333. .el-icon-arrow-down {
  334. font-size: 12px;
  335. }
  336. .el-scrollbar__wrap {
  337. overflow-y: hidden;
  338. }
  339. .el-card {
  340. border: 0px solid #fff;
  341. .topClass{
  342. font-weight: 600;
  343. font-size: 17px;
  344. }
  345. }
  346. .el-icon-document{
  347. font-size: 70px;
  348. color:#409EFF;
  349. line-height: 130px;
  350. }
  351. /deep/.el-card__body {
  352. padding: 20px 10px 0 10px !important;
  353. }
  354. /deep/ .el-table__expanded-cell[class*=cell]{
  355. padding: 0;
  356. }
  357. .pagination{
  358. padding-bottom: 30px;
  359. }
  360. </style>