| | |
| | | <el-form-item> |
| | | <zt-button type="query" @click="table.query()"/> |
| | | <zt-button type="add" @click="add()"/> |
| | | <zt-button v-if="productType==='3'" type="primary" @click="addCell()">新增虚单元</zt-button> |
| | | <zt-button type="delete" @click="table.deleteHandle()"/> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | <zt-table-column-handle :table="table"/> |
| | | </el-table> |
| | | <!-- 弹窗, 新增 / 修改 --> |
| | | <add-or-update @refreshDataList="table.query"/> |
| | | <add-or-update @refreshDataList="table.query" ref="AddOrUpdate"/> |
| | | <select-ty-model @refreshDataList="table.query" ref="SelectTyModel"/> |
| | | </zt-table-wraper> |
| | | </div> |
| | |
| | | import SelectTyModel from './SelectTyModel' |
| | | import ProductModelTree from "./ProductModelTree"; |
| | | import Cookies from "js-cookie"; |
| | | import TyProductModel from "./TyProductModel-AddOrUpdate"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=`, |
| | | productType: '', |
| | | dataForm: { |
| | | name: '', |
| | | productType: '', |
| | | type:'', |
| | | pid: '', |
| | | srcId:'', |
| | |
| | | } |
| | | }, |
| | | components: { |
| | | TyProductModel, |
| | | ProductModelTree, |
| | | AddOrUpdate, |
| | | SelectTyModel |
| | | }, |
| | | methods: { |
| | | add() { |
| | | if (this.dataForm.type !== '4') { |
| | | this.dataForm.type=this.productType |
| | | if (this.dataForm.type !== '3') { |
| | | console.log(1111) |
| | | console.log(this.dataForm.type,'add() {') |
| | | this.dataForm.type = this.dataForm.type - 1 |
| | | } else if (this.dataForm.type === '4') { |
| | | } else if (this.dataForm.type === '3') { |
| | | console.log(2222) |
| | | console.log(this.dataForm.type,'add() {') |
| | | this.dataForm.type = this.dataForm.type - 2 |
| | |
| | | } |
| | | this.$refs.SelectTyModel.$refs.dialog.init(null,{type:this.dataForm.type,id:this.dataForm.pid}) |
| | | }, |
| | | addCell(){ |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null,{type:10,pid:this.dataForm.pid}) |
| | | }, |
| | | cellStyle({column}) { |
| | | if (column.label === '名称') { |
| | | return 'text-align: left !important;' |
| | | } |
| | | }, |
| | | getPath(id) { |
| | | console.log(id, 'path') |
| | | return `${window.SITE_CONFIG['apiURL']}/sys/oss/content2?fileId=${id}` |
| | | }, |
| | | onProductSelected(data) { |
| | | console.log(data) |
| | | this.dataForm.pid = data.id |
| | | this.dataForm.type = data.productType |
| | | this.productType = data.productType |
| | | this.$refs.tableObj.query() |
| | | } |
| | | } |