edit.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <template>
  2. <div>
  3. <Toptitle :title="this.$route.query.type==1?'新增':this.$route.query.type==2?'编辑':this.$route.query.type==3?'变更':'详情'">
  4. <Button type="primary" @click="back" style="margin-right:10px">返回</Button>
  5. <Button type="primary" @click="postData" v-if="$route.query.type!=4">保存</Button>
  6. </Toptitle>
  7. <div style="height:90%;overflow:auto">
  8. <Form :label-width='100' class="content">
  9. <FormItem label='项目编码:'>
  10. <Input placeholder="请输入项目编码" v-model="formData.order_no" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2" :disabled='$route.query.type!=1'/>
  11. <span class="form_span" v-else>{{formData.order_no}}</span>
  12. </FormItem>
  13. <FormItem label='项目名称:'>
  14. <Input placeholder="请输入项目名称" class="form_item" clearable v-model="formData.project_title" v-if="$route.query.type==1||$route.query.type==2"/>
  15. <span class="form_span" v-else>{{formData.project_title}}</span>
  16. </FormItem>
  17. <FormItem label='项目地址:'>
  18. <Input placeholder="请输入项目地址" class="form_item" clearable v-model="formData.project_address" v-if="$route.query.type==1||$route.query.type==2"/>
  19. <span class="form_span" v-else>{{formData.project_address}}</span>
  20. </FormItem>
  21. <FormItem label='联系人:'>
  22. <Input placeholder="请输入联系人" class="form_item" clearable v-model="formData.connect_person" v-if="$route.query.type==1||$route.query.type==2"/>
  23. <span class="form_span" v-else>{{formData.connect_person}}</span>
  24. </FormItem>
  25. <FormItem label='联系电话:'>
  26. <Input placeholder="请输入联系电话" class="form_item" clearable v-model="formData.connect_phone" v-if="$route.query.type==1||$route.query.type==2"/>
  27. <span class="form_span" v-else>{{formData.connect_phone}}</span>
  28. </FormItem>
  29. <FormItem label='项目阶段:'>
  30. <Select filterable clearable multiple v-model="formData.phase" placeholder="请选择" class="form_item" v-if="$route.query.type!=4" @on-change='changePhase'>
  31. <Option v-for="(item,index) in agreementList" :key="index" :value="item.id" :label="item.title"></Option>
  32. </Select>
  33. <span class="form_span" v-else>{{getPhase()}}</span>
  34. </FormItem>
  35. <FormItem label='项目日期:'>
  36. <DatePicker type="date" placeholder="年/月/日" class="form_item" v-model="formData.project_date" v-if="$route.query.type==1||$route.query.type==2"></DatePicker>
  37. <span class="form_span" v-else>{{formData.project_date}}</span>
  38. </FormItem>
  39. <FormItem label='客户名称:'>
  40. <Input v-model="formData.customer" placeholder="请输入客户名称" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2"/>
  41. <span class="form_span" v-else>{{formData.customer}}</span>
  42. </FormItem>
  43. <FormItem label='紧急程度:'>
  44. <Select v-model="formData.warning_state" filterable clearable class="form_item" v-if="$route.query.type==1||$route.query.type==2">
  45. <Option :value="1">普通</Option>
  46. <Option :value="2">紧急</Option>
  47. <Option :value="3">非常紧急</Option>
  48. </Select>
  49. <span class="form_span" v-else>{{formData.warning_state==1?'普通':formData.warning_state==2?'紧急':formData.warning_state==3?'非常紧急':''}}</span>
  50. </FormItem>
  51. <FormItem label='金螳螂ID:'>
  52. <Input v-model="formData.customer_id" placeholder="请输入金螳螂ID" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2"/>
  53. <span class="form_span" v-else>{{formData.customer_id}}</span>
  54. </FormItem>
  55. <FormItem label='投标金额:'>
  56. <Input v-model="formData.bid_price" placeholder="自动生成" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2" :disabled='true'/>
  57. <span class="form_span" v-else>{{formData.bid_price}}</span>
  58. </FormItem>
  59. <FormItem label='合同金额:'>
  60. <Input placeholder="自动生成" v-model="formData.agreement_price" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2" disabled/>
  61. <span class="form_span" v-else>{{formData.agreement_price}}</span>
  62. </FormItem>
  63. <FormItem label='核量金额:'>
  64. <Input v-model="formData.quantity_price" placeholder="请输入核量金额" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2"/>
  65. <span class="form_span" v-else>{{formData.quantity_price}}</span>
  66. </FormItem>
  67. <FormItem label='备注:'>
  68. <Input v-model="formData.remark" placeholder="请输入备注" class="form_item" clearable v-if="$route.query.type==1||$route.query.type==2"/>
  69. <span class="form_span" v-else>{{formData.remark}}</span>
  70. </FormItem>
  71. <FormItem label='附件:' style="width:100%">
  72. <Button type="primary" @click="addStage" v-if='$route.query.type==1||$route.query.type==2'>添加阶段</Button>
  73. <span v-else></span>
  74. </FormItem>
  75. <FormItem :label='`${item.title}:`' style="width:100%" v-for="(item,index) in showList" :key="index">
  76. <div class="total_img">
  77. <div v-for="(_item,_index) in item.url" :key="_index" class="img_item">
  78. <img @click="looks(_item.url,_item.is_pic)" :src="_item.is_pic?$store.state.ip + _item.url:require('./../../assets/imgs/file.jpg')" alt="" class="img_content"/>
  79. <Icon
  80. v-if="$route.query.type!=4"
  81. size="20"
  82. @click="delItems(_index, item.url)"
  83. class="delete-img"
  84. type="ios-close-circle"
  85. />
  86. <div class="img_title"><a @click="exportData(`${$store.state.ip}${_item.url}`,_item.is_pic,_item.name)">{{_item.name}}</a></div>
  87. </div>
  88. <Upload
  89. v-if="$route.query.type!=4"
  90. multiple
  91. :headers="headers"
  92. :show-upload-list="false"
  93. :on-success="handleSuccess"
  94. :action="$store.state.ip+'/api/upload_file'">
  95. <div class="upd_file" @click="recordIndex(index)">
  96. <Icon type="ios-cloud-upload-outline" class="ico" size='50'/>
  97. </div>
  98. </Upload>
  99. </div>
  100. </FormItem>
  101. </Form>
  102. <Card>
  103. <p slot="title">
  104. 清单
  105. </p>
  106. <div slot="extra" v-if="$route.query.type!=4" style="display:flex">
  107. <Upload
  108. v-if="$route.query.type!=3||$route.query.type!=4"
  109. multiple
  110. :headers="headers"
  111. :show-upload-list="false"
  112. :on-success="handleTotalTableSuccess"
  113. :action="$store.state.ip+'/api/upload_image'"
  114. style="margin-right:10px"
  115. >
  116. <Button type="primary" size='small'>批量上传图片</Button>
  117. </Upload>
  118. <Button type="primary" style="margin-right:10px" @click="totalDel" size='small'>批量删除</Button>
  119. <Upload
  120. style="display:inline"
  121. name="your_file"
  122. :show-upload-list="false"
  123. :headers="headers"
  124. :on-error="uploadError"
  125. :on-success="uploadSuccess"
  126. :action="$store.state.ip + '/api/contract_import'"
  127. >
  128. <Button type="primary" style="margin-right:10px;" size='small'
  129. >导入</Button
  130. >
  131. </Upload>
  132. </div>
  133. <Table :data='tableData' :columns='$route.query.type==1||$route.query.type==2?tableColumns:editTableColumns' border max-height='620' @on-selection-change='handleSelect' show-summary :summary-method="handleSummary">
  134. <template slot="set" slot-scope="{index}">
  135. <a @click="del(index)">删除</a>
  136. </template>
  137. <template slot="bp_id" slot-scope="{row,index}">
  138. <Select v-model="row.bp_id" @on-change='selectBpId($event,index)' filterable clearable :transfer='true'>
  139. <Option v-for="(item,index) in bp_list" :key="index" :value="item.id" :label='item.title'/>
  140. </Select>
  141. </template>
  142. <template slot="product_img" slot-scope="{row,index}">
  143. <div>
  144. <Upload
  145. v-if="!row.product_img&&($route.query.type!=3||$route.query.type!=4)"
  146. :headers="headers"
  147. :show-upload-list="false"
  148. :on-success="handleTableSuccess"
  149. :action="$store.state.ip+'/api/upload_image'">
  150. <a @click="updTableImg(index)">上传</a>
  151. </Upload>
  152. <div v-if="tableData[index].product_img" class="img_box">
  153. <img @click="looks(row.product_img,true)" :src="$store.state.ip + tableData[index].product_img" alt="" class="img_table_content"/>
  154. <Icon
  155. v-if="$route.query.type!=4"
  156. size="20"
  157. @click="delTableItems(row,index)"
  158. class="delete-img"
  159. type="ios-close-circle"
  160. />
  161. </div>
  162. </div>
  163. </template>
  164. <template slot="total_bid_price" slot-scope="{row,index}">
  165. <Input v-model="row.total_bid_price" @on-change='changeTotalBidPrice($event,index)' type="number" @on-blur='checkPrice(row,index)'/>
  166. </template>
  167. </Table>
  168. </Card>
  169. </div>
  170. <Modal title="添加阶段" v-model="show_stage" @on-ok='sureAdd'>
  171. <div class="model_agreement">
  172. <span >阶段名称:</span>
  173. <Select v-model="list" filterable multiple>
  174. <Option :disabled='item.is_show' v-for="(item,index) in agreementList" :key="index" :label="item.title" :value="item.title"/>
  175. </Select>
  176. </div>
  177. </Modal>
  178. </div>
  179. </template>
  180. <script>
  181. export default {
  182. data(){
  183. return{
  184. tableIndex:null,
  185. bp_list:[],
  186. showPicIndex:null,
  187. showList:[],
  188. list:[],
  189. show_stage:false,
  190. headers: { 'Authorization': localStorage.getItem('token') },
  191. selectData:[],
  192. agreementList:[{title:'立项',is_show:false,id:1},{title:'评审',is_show:false,id:2},{title:'报价',is_show:false,id:3},{title:'投标',is_show:false,id:4},{title:'中标',is_show:false,id:5},{title:'废标',is_show:false,id:6}],
  193. formData:{
  194. bid_price:'',
  195. order_no:'',
  196. project_title:'',
  197. project_address:'',
  198. connect_person:'',
  199. connect_phone:'',
  200. phase:[],
  201. project_date:'',
  202. customer:'',
  203. customer_id:'',
  204. warning_state:'',
  205. agreement_price:'',
  206. quantity_price:'',
  207. remark:'',
  208. },
  209. tableData:[],
  210. tableColumns:[
  211. {type:'selection',minWidth:40,align:'center',key:'select'},
  212. {title:'序号',type:'index',align:'center',minWidth:80,key:'index'},
  213. {title:'区域',minWidth:100,align:'center',key:'region'},
  214. {title:'产品分类',minWidth:100,align:'center',key:'bp_id',slot:'bp_id'},
  215. {title:'产品名称',minWidth:100,align:'center',key:'product_title'},
  216. {title:'产品图片',minWidth:100,align:'center',key:'product_img',slot:'product_img'},
  217. {title:'产品特征',minWidth:200,align:'center',key:'product_feature'},
  218. {title:'计量单位',minWidth:60,align:'center',key:'unit'},
  219. {title:'工程量',minWidth:80,align:'center',key:'num'},
  220. {title:'投标单价',minWidth:100,align:'center',key:'bid_price'},
  221. {title:'投标金额',minWidth:100,align:'center',key:'total_bid_price',slot:'total_bid_price'},
  222. {title:'操作',minWidth:60,align:'center',key:'set',slot:'set'}
  223. ],
  224. editTableColumns:[
  225. {title:'序号',type:'index',align:'center',minWidth:80,key:'index'},
  226. {title:'区域',minWidth:100,align:'center',key:'region'},
  227. {title:'产品分类',minWidth:100,align:'center',key:'product_type_title'},
  228. {title:'产品名称',minWidth:100,align:'center',key:'product_title'},
  229. {title:'产品图片',minWidth:100,align:'center',key:'product_img',slot:'product_img'},
  230. {title:'产品特征',minWidth:100,align:'center',key:'product_feature'},
  231. {title:'计量单位',minWidth:100,align:'center',key:'unit'},
  232. {title:'工程量',minWidth:100,align:'center',key:'num'},
  233. {title:'投标单价',minWidth:100,align:'center',key:'bid_price'},
  234. {title:'投标金额',minWidth:100,align:'center',key:'total_bid_price'}
  235. ]
  236. }
  237. },
  238. created(){
  239. (this.$route.query.type==1||this.$route.query.type==2)&&this.axios.get('/api/basics_product_index').then(res=>{
  240. this.bp_list = res.data.data
  241. })
  242. },
  243. mounted(){
  244. this.$route.query.type!=1&&this.initData();
  245. },
  246. methods:{
  247. checkPrice(row,index){
  248. if(row.total_bid_price<0){
  249. row.total_bid_price = '0.00';
  250. this.tableData[index].total_bid_price = '0.00'
  251. }else{
  252. row.total_bid_price = Number(row.total_bid_price).toFixed(2);
  253. this.tableData[index].total_bid_price=Number(this.tableData[index].total_bid_price).toFixed(2);
  254. return
  255. }
  256. },
  257. changeTotalBidPrice(e,index){
  258. this.tableData[index].total_bid_price = e.target.value;
  259. },
  260. handleSummary ({ columns, data }) {
  261. const sums = {};
  262. columns.forEach((column, index) => {
  263. const key = column.key;
  264. if (key === 'index') {
  265. sums[key] = {
  266. key,
  267. value: '合计'
  268. };
  269. return;
  270. }
  271. const values = data.map(item => Number(item[key]));
  272. if (key=='total_bid_price') {
  273. const v = values.reduce((prev, curr) => {
  274. const value = Number(curr);
  275. if (!isNaN(value)) {
  276. return prev + curr;
  277. } else {
  278. return prev;
  279. }
  280. }, 0);
  281. sums[key] = {
  282. key,
  283. value: (v*1).toFixed(2)
  284. };
  285. this.formData.bid_price = (v*1).toFixed(2);
  286. if(this.formData.phase.indexOf(5)>=0){
  287. this.formData.agreement_price = this.formData.bid_price;
  288. }
  289. }else{
  290. sums[key] = {
  291. key,
  292. value:''
  293. }
  294. }
  295. });
  296. return sums;
  297. },
  298. selectBpId(e,index){
  299. this.tableData[index].bp_id = e;
  300. },
  301. changePhase(e){
  302. if(e.indexOf(5)>=0){
  303. this.formData.agreement_price = this.formData.bid_price;
  304. }else{
  305. this.formData.agreement_price = '';
  306. }
  307. },
  308. getPhase(){
  309. let arr = [];
  310. arr = this.agreementList.filter(v=>{
  311. return this.formData.phase.indexOf(v.id)>=0;
  312. })
  313. let val = [];
  314. arr.forEach(v=>{
  315. val.push(v.title);
  316. })
  317. return val.toString();
  318. },
  319. delItems(n, arr) {
  320. arr.splice(n, 1);
  321. },
  322. delTableItems(row,index){
  323. row.product_img = '';
  324. this.tableData[index].product_img = '';
  325. },
  326. looks(img,type) {
  327. if(!type){
  328. return
  329. }
  330. const array = [{ img_url: img }];
  331. this.$previewImg({
  332. list: array,
  333. baseUrl: this.$store.state.ip,
  334. baseImgField: "img_url",
  335. baseTitleField: "",
  336. });
  337. },
  338. exportData(url,type,name) {
  339. // window.open(url)
  340. if(type){
  341. this.downloadIamge(url,name)
  342. }else{
  343. location.href = url;
  344. }
  345. },
  346. downloadIamge(imgsrc, name) {
  347. //下载图片地址和图片名
  348. var image = new Image()
  349. // 解决跨域 Canvas 污染问题
  350. image.setAttribute('crossOrigin', 'anonymous')
  351. image.onload = function () {
  352. var canvas = document.createElement('canvas')
  353. canvas.width = image.width
  354. canvas.height = image.height
  355. var context = canvas.getContext('2d')
  356. context.drawImage(image, 0, 0, image.width, image.height)
  357. var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
  358. var a = document.createElement('a') // 生成一个a元素
  359. var event = new MouseEvent('click') // 创建一个单击事件
  360. a.download = name || 'photo' // 设置图片名称
  361. a.href = url // 将生成的URL设置为a.href属性
  362. a.dispatchEvent(event) // 触发a的单击事件
  363. }
  364. image.src = imgsrc
  365. },
  366. recordIndex(index){
  367. this.showPicIndex = index;
  368. },
  369. handleTotalTableSuccess(res,file){
  370. if(file.name.indexOf('+')<0){
  371. return this.$Message.error("请上传‘区域’+‘产品名称’的图片名称!")
  372. }
  373. if(res.code==200){
  374. let content = file.name.split('.')[0];
  375. let arr = content.split('+');
  376. console.log(arr);
  377. this.tableData.forEach((v,index)=>{
  378. if(v.region===arr[0]&&v.product_title===arr[1]){
  379. this.tableData[index].product_img = res.data.url;
  380. }
  381. })
  382. }
  383. },
  384. handleTableSuccess(res,file){
  385. // console.log(this.tableData)
  386. if(res.code==200){
  387. this.tableData[this.tableIndex].product_img = res.data.url;
  388. // let obj = this.tableData[this.initData];
  389. // obj.product_img = res.data.url;
  390. // this.$set(this.tableData,this.initData,obj)
  391. // this.tableData.splice(this.tableIndex,1,obj)
  392. // console.log(this.tableData)
  393. }
  394. },
  395. updTableImg(index){
  396. this.tableIndex = index;
  397. },
  398. handleSuccess(res,file){
  399. if(res.code==200){
  400. let obj = {};
  401. obj.url = res.data.url;
  402. let config = ['jpg', 'png', 'gif', "jpeg"];
  403. let text = file.name.split('.');
  404. if(config.indexOf(text[text.length-1])>=0){
  405. obj.is_pic = true;
  406. }else{
  407. obj.is_pic = false;
  408. }
  409. obj.name=file.name;
  410. this.showList[this.showPicIndex].url.push(obj);
  411. }
  412. },
  413. sureAdd(){
  414. if(this.showList.length==0){
  415. this.list.forEach(v=>{
  416. let obj = {};
  417. obj.title = v;
  418. obj.phase = v=='立项'?1:v=='评审'?2:v=='报价'?3:v=='投标'?4:v=='中标'?5:v=='废标'?6:'';
  419. obj.url=[];
  420. this.showList.push(obj)
  421. })
  422. }else{
  423. let titles= [];
  424. this.showList.forEach(v=>{
  425. titles.push(v.title)
  426. })
  427. this.list.forEach(ele=>{
  428. if(titles.indexOf(ele)<0){
  429. let obj = {};
  430. obj.title = ele;
  431. obj.phase = ele=='立项'?1:ele=='评审'?2:ele=='报价'?3:ele=='投标'?4:ele=='中标'?5:ele=='废标'?6:'';
  432. obj.url=[];
  433. this.showList.push(obj)
  434. }
  435. })
  436. }
  437. },
  438. initData(){
  439. this.axios.post('/api/contract_detail',{order_no:this.$route.query.order_no}).then(res=>{
  440. this.formData = JSON.parse(JSON.stringify(res.data));
  441. this.formData.project_date = this.formData.project_date?this.func.replaceDateNoHMS(this.formData.project_date):'';
  442. this.formData.phase = [];
  443. res.data.phase.forEach(el => {
  444. this.formData.phase.push(Number(el))
  445. });
  446. delete this.formData.list;
  447. delete this.formData.file;
  448. this.showList = res.data.file;
  449. this.tableData = res.data.list;
  450. })
  451. },
  452. del(index){
  453. this.tableData.splice(index,1);
  454. },
  455. addStage(){
  456. this.list = [];
  457. this.showList.forEach(v=>{
  458. this.list.push(v.title);
  459. })
  460. this.show_stage = true;
  461. },
  462. uploadSuccess(res) {
  463. if (res.code == 200) {
  464. this.$Message.success(res.msg || "上传成功");
  465. res.data.forEach(v=>{
  466. v.product_img='';
  467. })
  468. if(this.tableData.length==0){
  469. // this.tableData = JSON.parse(JSON.stringify(res.data))
  470. this.tableData = Object.assign(res.data,this.tableData)
  471. this.$forceUpdate();
  472. }else{
  473. // let data = JSON.parse(JSON.stringify(this.tableData));
  474. res.data.forEach(v => {
  475. let arr = [];
  476. arr = this.tableData.filter(x=>{
  477. return x.region == v.region&&x.product_title == v.product_title
  478. })
  479. if(arr.length==0){
  480. this.tableData.push(v);
  481. }else{
  482. this.tableData.forEach((ele,index)=>{
  483. if(ele.region == v.region&&ele.product_title == v.product_title){
  484. this.tableData.splice(index,1,v)
  485. }
  486. })
  487. }
  488. });
  489. // this.tableData = JSON.parse(JSON.stringify(data));
  490. }
  491. } else {
  492. this.$Message.warning(res.msg || "上传失败");
  493. }
  494. },
  495. uploadError(err) {
  496. this.$Message.error(err.msg || "上传失败");
  497. },
  498. back(){
  499. this.$router.go(-1)
  500. },
  501. postData(){
  502. let data = JSON.parse(JSON.stringify(this.formData));
  503. data.project_date = this.formData.project_date?Date.parse(this.formData.project_date).toString().slice(0,10):'';
  504. data.phase = data.phase?this.formData.phase.toString():'';
  505. switch (this.$route.query.type){
  506. case '1':
  507. this.axios.post('/api/contract_add',{...data,children:this.tableData,file:this.showList}).then(res=>{
  508. if(res.code == 200){
  509. this.$Message.success(res.msg);
  510. this.back()
  511. }
  512. })
  513. break;
  514. case '2':
  515. console.log(111);
  516. this.axios.post('/api/contract_edit',{...data,children:this.tableData,order_no:this.$route.query.order_no,file:this.showList}).then(res=>{
  517. if(res.code == 200){
  518. this.$Message.success(res.msg);
  519. this.back()
  520. }
  521. })
  522. break;
  523. }
  524. },
  525. totalDel(){
  526. if(this.selectData.length == 0){
  527. return this.$Message.warning('请先选择要删除的数据!')
  528. }
  529. this.confirmDelete({
  530. title:'批量删除确认?',
  531. content:"是否确定批量删除?",
  532. then: ()=>{
  533. for(let i = 0;i<this.tableData.length;i++){
  534. let obj ={};
  535. obj.region= this.tableData[i].region;
  536. obj.product_title = this.tableData[i].product_title;
  537. let arr=[];
  538. arr = this.selectData.filter(v=>{
  539. return v.region == obj.region&&v.product_title==obj.product_title;
  540. })
  541. if(arr.length==1){
  542. this.tableData.splice(i,1);
  543. i--;
  544. }
  545. }
  546. if(this.tableData.length==0){
  547. this.formData.bid_price = '';
  548. this.formData.agreement_price = ''
  549. }
  550. }
  551. })
  552. },
  553. handleSelect(e){
  554. this.selectData = e;
  555. console.log(this.selectData);
  556. },
  557. }
  558. }
  559. </script>
  560. <style lang="scss" scoped>
  561. .content{
  562. display: flex;
  563. flex-wrap: wrap;
  564. }
  565. .form_item{
  566. width:200px
  567. }
  568. .upd_file{
  569. background: rgb(242, 242, 242);
  570. width: 200px;
  571. height: 160px;
  572. cursor: pointer;
  573. .ico{
  574. width: 100%;
  575. line-height: 300%;
  576. }
  577. }
  578. .form_span{
  579. width:200px;
  580. display:inline-block;
  581. }
  582. .img_content{
  583. width: 150px;
  584. height: 150px;
  585. }
  586. .img_table_content{
  587. width: 50px;
  588. height: 50px;
  589. }
  590. .delete-img {
  591. position: absolute;
  592. right: 0px;
  593. top: 0px;
  594. color: red;
  595. cursor: pointer;
  596. }
  597. .total_img{
  598. display: flex;
  599. flex-wrap:wrap;
  600. .img_item{
  601. margin-right: 40px;
  602. position: relative;
  603. .img_title{
  604. text-align: center;
  605. }
  606. }
  607. }
  608. .model_agreement{
  609. display: flex;
  610. span{
  611. width: 100px;
  612. }
  613. }
  614. .img_box{
  615. position: relative;
  616. }
  617. </style>