当前位置: 首页 > news >正文

哪些做调查问卷挣钱的网站网站建设 南京

哪些做调查问卷挣钱的网站,网站建设 南京,wordpress的登录函数使用教程,上海有几个区县本篇文章记录el-table增加一行可编辑的数据列#xff0c;进行增删改。 1.增加空白行 直接在页面mounted时对form里面的table列表增加一行数据#xff0c;直接使用push() 方法增加一列数据这个时候也可以设置一些默认值。比如案例里面的 产品件数 。 mounted() {this.$nextTi…本篇文章记录el-table增加一行可编辑的数据列进行增删改。 1.增加空白行 直接在页面mounted时对form里面的table列表增加一行数据直接使用push() 方法增加一列数据这个时候也可以设置一些默认值。比如案例里面的 产品件数 。 mounted() {this.$nextTick(() {this.addFormData.productList.push({productName: ,//产品名称price: ,//单价(元/㎡)productCount: 1, //产品件数totalAmount: , //小计元})})}, 2.产品名称选中拿到数据展示到列表行 因为当前案例的产品名是下拉选择的所以我们要请求接口拿到数据渲染到下拉列表这里直接使用了假数据。 data() {return {addFormData: {// 产品列表productList: [],},addFormRules: {productName: [{required: true,message: 请选择产品,trigger: blur}],price: [{required: true,message: 请输入单价,trigger: blur}],productCount: [{required: true,message: 请输入产品件数,trigger: blur}]},optionsList: [{id:1,productName:橘子,price:10,},{id:2,productName:苹果,price:8,}]}},el-form refaddFormRef :modeladdFormData :rulesaddFormRules sizemini :inlinetrueel-table tooltip-effectlight :dataaddFormData.productList el-table-column label产品名称 propproductName min-width150template slot-scopescopeel-form-item sizemini :propproductList. scope.$index .productName:rulesaddFormRules.productName classallel-select v-modelscope.row.productName filterable value-keyid placeholder请选择changepestChange($event, scope.$index)el-option v-foritem in optionsList :keyitem.id :labelitem.productName:valueitem/el-option/el-select/el-form-item/template/el-table-columnel-table-column label操作 aligncenter class-namesmall-padding fixed-width fixedrightwidth150template slot-scopescopeel-button sizemini typetext iconel-icon-edit clickhandleUpdateYes(scope.row)v-hasPermi[system:order:edit]增加/el-buttonel-button sizemini typetext iconel-icon-delete clickhandleDeleteProduct(scope.row)v-hasPermi[system:order:remove]删除/el-button/template/el-table-column/el-tableel-form-item sizelargeel-button typeprimary clickhandleSubmitAdd提交/el-buttonel-button clickhandleCancelAdd取消/el-button/el-form-item/el-formpestChange(e, index) {//此时的e 就是optionsList中的某一项//让后解构赋值给我们这一行对应的值 let data this.addFormData.productList[index]Object.keys(data).forEach(key {data[key] e[key]})this.addFormData.productList[index].productCount 1}, 3.小计通过(计算属性计算值) el-form refaddFormRef :modeladdFormData :rulesaddFormRules sizemini :inlinetrueel-table tooltip-effectlight :dataaddFormData.productList el-table-column label小计元 proptotalAmount width100template slot-scopescopediv classnotext{{ getTotalAmount(scope.row) }}/div/template/el-table-columnel-table-column label操作 aligncenter class-namesmall-padding fixed-width fixedrightwidth150template slot-scopescopeel-button sizemini typetext iconel-icon-edit clickhandleUpdateYes(scope.row)v-hasPermi[system:order:edit]增加/el-buttonel-button sizemini typetext iconel-icon-delete clickhandleDeleteProduct(scope.row)v-hasPermi[system:order:remove]删除/el-button/template/el-table-column/el-tableel-form-item sizelargeel-button typeprimary clickhandleSubmitAdd提交/el-buttonel-button clickhandleCancelAdd取消/el-button/el-form-item/el-form computed: {getTotalAmount(){return (data) {//先判断单价和数量必须存在if (data.productCount data.price) {data.totalAmount parseInt(data.productCount) * parseInt(parseFloat(data.price))return data.totalAmount} else {return 0.00}}}}, 4.再增加一行复用上一行的数据 handleUpdateYes(row) {//拿到上一行数据再往数组中push新的数据this.addFormData.productList.push({productName: row.productName,//产品名称price: row.price,//单价(元/㎡)productCount: row.productCount, //产品件数totalAmount: , //小计元})}, 5.删除某一行 // 删除产品handleDeleteProduct(row) {this.$confirm(此操作将永久删除该产品信息, 是否继续?, 提示, {confirmButtonText: 确定,cancelButtonText: 取消,type: warning}).then(() {this.$message({type: success,message: 删除成功!});this.addFormData.productList.splice(row.index, 1)}).catch(() {this.$message({type: info,message: 已取消删除});});}, 6.点击提交对表单校验 // 添加订单表单提交handleSubmitAdd() {this.$refs.addFormRef.validate(async (valid) {if (!valid) return//校验通过 往下执行})},
http://www.hkea.cn/news/14548528/

相关文章:

  • o2o网站建设方案 多少钱网页设计模板html代码
  • 阿里云做的网站怎么样京东快递 网站建设特点
  • 沈阳网站建设技术公司排名需要做网站建设的公司
  • 电子商务网站开发的课程介绍大良营销网站建设渠道
  • 深圳易百讯网站建设公司广东省建设厅网站怎么查询证件
  • 商业网站建设广州定制app开发
  • 大理 网站建设试述网站开发的流程
  • 联谊会总结网站建设对外宣传梧州自助建站seo
  • 智慧政务门户网站建设方案江苏外贸网站建设
  • 河南如何优化网站邓州市建设局网站
  • 企石网站仿做大连网站制作的公司哪家好
  • 免费开源网站用帝国软件做网站的心得
  • 促销型网站工业园做网站的公司
  • 主机屋网站搭建设置iis6网站域名
  • 贵港网站推广网站腾讯备案
  • 大红门网站建设卧龙区网站制作
  • 南宁手机平台网网站建设网站建设基础教学设计
  • 上海建设小学网站网站建设的频道是什么
  • 手机网站建设的方法html5 微网站模版
  • 网站建设|做购物网站哪家公司好
  • 网站电脑培训班附近有吗网站建设实务课本
  • 备案网站可以做论坛么营销型网站建设定制
  • 国外网站seo海南网站建设平台
  • 网站每月流量短网址生成源码
  • 网站后台 ftp中外商贸做网站好在哪
  • 2个淘宝可以做情侣网站么黄骅港鑫海化工招聘
  • 专业移动网站建设商四川网站建设scyiyou
  • 网站建设过程总结400元做网站送网推
  • 购物网站模版html设计院加盟
  • 网络公司代做的网站注意事项wordpress主题seven