| | |
| | | <mapper namespace="com.zt.life.modules.mainPart.basicInfo.dao.TyProductModelDao"> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.basicInfo.model.TyProductModel"> |
| | | select * |
| | | from product_model_common |
| | | where is_delete = 0 |
| | | AND ( |
| | | -- å¦æåæ¥è¯¢è¿åç»æä¸ºç©ºï¼åæ£æ¥a.pidæ¯å¦ä¸ºç©º |
| | | (SELECT src_id FROM product_model WHERE id = ${pid} AND is_delete = 0) IS NULL |
| | | AND pid IS NULL |
| | | OR |
| | | -- å¦åï¼æ£æ¥a.pidæ¯å¦å¨åæ¥è¯¢ç»æä¸ |
| | | pid IN ( |
| | | SELECT src_id |
| | | SELECT PMC.* |
| | | FROM product_model_common PMC |
| | | JOIN (SELECT product_type, src_id |
| | | FROM product_model |
| | | WHERE id = ${pid} |
| | | AND is_delete = 0 |
| | | WHERE id = ${pid} AND is_delete = 0) AS PM ON TRUE |
| | | WHERE PMC.is_delete = 0 |
| | | AND ( |
| | | PM.product_type = 3 |
| | | AND (CASE WHEN pm.src_id IS NULL THEN node_type > 3 ELSE pid IN (src_id) END) |
| | | OR ( |
| | | PM.product_type != 3 |
| | | AND (CASE WHEN pm.src_id IS NULL THEN pid IS NULL ELSE pid IN (src_id) END) |
| | | ) |
| | | ) |
| | | and ((node_type > ${nodeType}) or ( id not in (select src_id from product_model where pid = |
| | | ${pid} and is_delete=0))) |
| | | ORDER BY |
| | | node_type,sort |
| | | ORDER BY PMC.node_type, |
| | | PMC.sort; |
| | | </select> |
| | | <select id="getProductList" resultType="com.zt.life.modules.mainPart.basicInfo.model.TyProductModel"> |
| | | select a.name, a.id |
| | | from product_model_common a |
| | | where a.is_delete = 0 |
| | | and a.node_type <> 1 |
| | | ORDER BY |
| | | node_type,sort |
| | | ORDER BY node_type, sort |
| | | </select> |
| | | <select id="getNo" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) |
| | |
| | | }) |
| | | }, |
| | | cellStyle({row, column, rowIndex, columnIndex}) { |
| | | let warningColor = false; |
| | | // console.log(row, column, rowIndex, columnIndex); |
| | | //console.log(row, "row"); |
| | | Object.keys(row).forEach((key, index) => { |
| | | //é忝è¡ä¸æ¯ä¸ªæ°æ®çstate |
| | | if (key === "repairMttcr" || key === "basicMtbfRegulate") { |
| | | //console.log(key, "row key"); |
| | | let val = row[key] |
| | | const numM = Number(val).toFixed(5); |
| | | if (numM.substring(0, numM.length - 1) === '0.0000' && val > 0) { |
| | | //å®ä½è¯¥æ°æ®çåæ |
| | | if (columnIndex === 2) { |
| | | warningColor = true; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | if (warningColor) { |
| | | // red为æ³åæçåå
æ ¼æ ·å¼ |
| | | const numM1 = Number(row.repairMttcr).toFixed(5); |
| | | const numM2 = Number(row.basicMtbfRegulate).toFixed(5); |
| | | console.log(numM1,numM2,'234') |
| | | if (numM1.substring(0, numM1.length - 1) === '0.0000' && row.repairMttcr > 0 && column.property ==="repairMttcr") { |
| | | return 'color : red' |
| | | } else if (numM2.substring(0, numM1.length - 1) === '0.0000' && row.basicMtbfRegulate > 0 && column.property ==="basicMtbfRegulate") { |
| | | return 'color : red' |
| | | }else { |
| | | return '' |
| | | } |
| | | return ""; |
| | | // Object.keys(row).forEach((key, index) => { |
| | | // //é忝è¡ä¸æ¯ä¸ªæ°æ®çstate |
| | | // if (key === "repairMttcr" || key === "basicMtbfRegulate") { |
| | | // //console.log(key, "row key"); |
| | | // let val = row[key] |
| | | // const numM = Number(val).toFixed(5); |
| | | // if (numM.substring(0, numM.length - 1) === '0.0000' && val > 0) { |
| | | // //å®ä½è¯¥æ°æ®çåæ |
| | | // if (columnIndex === 2) { |
| | | // warningColor = true; |
| | | // } |
| | | // } |
| | | // } |
| | | // }); |
| | | }, |
| | | } |
| | | } |
| | |
| | | <el-row :gutter="5"> |
| | | <el-col :span="4"> |
| | | <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)"> |
| | | <product-model-tree @on-selected="onProductSelected" showXdy="false" :isShow="false"/> |
| | | <product-model-tree @on-selected="onProductSelected" @on-default="onDefault" showXdy="false" :isShow="false"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | |
| | | :hit="hit"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="dataForm.productType==='2'" :key="3" prop="baseOperatRatio" label="åºæ¬å¯é æ§è¿è¡æ¯" align="right"> |
| | | <el-table-column v-if="dataForm.productType==='2'" :key="3" prop="baseOperatRatio" label="åºæ¬å¯é æ§è¿è¡æ¯" |
| | | align="right"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.baseOperatRatio"></el-input> |
| | | <span v-else v-text="scope.row.baseOperatRatio"></span> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> |
| | | <el-table-column v-if="dataForm.productType==='3'||dataForm.productType==='4'" :key="22" label="ç»´ä¿®åå¸" align="center"> |
| | | <el-table-column v-if="dataForm.productType==='3'||dataForm.productType==='4'" :key="22" label="ç»´ä¿®åå¸" |
| | | align="center"> |
| | | <!-- <zt-table-column-dict prop="repairable" :keys="23" label="å¯ç»´ä¿®" dict="is_or_not"/>--> |
| | | <el-table-column prop="repairable" label="å¯ç»´ä¿®" :key="23" width="80" align="center"> |
| | | <template v-slot="{ row }"> |
| | |
| | | this.$refs.tableObj.query() |
| | | }) |
| | | }, |
| | | onDefault(defaultId) { |
| | | this.dataForm.srcId = defaultId |
| | | this.dataForm.productType = 2 |
| | | this.activeName = 'first' |
| | | this.$refs.tableObj.query() |
| | | }, |
| | | dataLoaded(data) { |
| | | this.dataList = data |
| | | for (let dataList of data) { |
| | |
| | | if (this.basic) { |
| | | if (this.productList && this.productList[0].children) { |
| | | this.defaultId = this.productList[0].children[0].id |
| | | console.log(this.defaultId, 'this.defaultID') |
| | | this.$nextTick(() => { |
| | | this.$refs.tree.setCurrentKey(this.defaultId); //ä¸å®è¦å è¿ä¸ªéä¸äºå¦åæ ·å¼æ²¡æåºæ¥ |
| | | }); |
| | |
| | | productType: selected |
| | | } |
| | | let res = await this.$http.get(`/sysPictureBase/getDefaultImg`, {params: params}) |
| | | if (res.data){ |
| | | this.dataForm.operatImgName = res.data.name |
| | | this.dataForm.operatImg = res.data.id |
| | | } |
| | | }, |
| | | selectPicture() { |
| | | this.$refs.pictureSelect.$refs.dialog.init(this.dataForm.productType) |
| | |
| | | <el-row :gutter="5"> |
| | | <el-col :span="5"> |
| | | <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)"> |
| | | <product-model-tree @on-selected="onProductSelected" showXdy="true" ref="ProductModelTree"/> |
| | | <product-model-tree @on-selected="onProductSelected" @on-default="onDefault" showXdy="true" |
| | | ref="ProductModelTree"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | |
| | | <el-form-item> |
| | | <zt-button v-if="productType && productType!=='10'" type="query" @click="table.query()"/> |
| | | <zt-button v-if="productType && productType!=='10'" type="add" @click="add()"/> |
| | | <zt-button v-if="productType==='1'" size="small" type="primary" @click="exportProduct()">å¯¼åºæ¨¡æ¿ |
| | | </zt-button> |
| | | <zt-button v-if="productType==='3'" type="primary" @click="addCell()">æ°å¢èåå
</zt-button> |
| | | <zt-button v-if="productType && productType!=='10'" type="delete" @click="table.deleteHandle()"/> |
| | | </el-form-item> |
| | |
| | | }, |
| | | importData(row) { |
| | | this.$refs.ProductImport.$refs.dialog.init(row) |
| | | } |
| | | }, |
| | | exportProduct() { |
| | | window.location.href = './产åç»ææ 导å
¥æ¨¡æ¿.xlsx' |
| | | }, |
| | | onDefault(defaultId) { |
| | | this.dataForm.pid = defaultId |
| | | this.dataForm.type = 2 |
| | | this.productType = 2 |
| | | this.$refs.tableObj.query() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <el-row :gutter="5"> |
| | | <el-col :span="5"> |
| | | <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)"> |
| | | <product-model-tree @on-selected="onProductSelected" showXdy="true" :isShow="false"/> |
| | | <product-model-tree @on-selected="onProductSelected" @on-default="onDefault" showXdy="true" :isShow="false"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | |
| | | console.log(data, 'onProductSelected(data)') |
| | | this.$refs.tableObj.query() |
| | | }, |
| | | onDefault(defaultId){ |
| | | this.dataForm.productId = defaultId |
| | | this.$refs.tableObj.query() |
| | | }, |
| | | drawRBD(row) { |
| | | this.dialogVisible2 = true |
| | | this.$nextTick(() => { |
| | |
| | | OperaConditModel, |
| | | AddOrUpdate |
| | | }, |
| | | |
| | | methods: { |
| | | add() { |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null, {productId: this.dataForm.productId}) |
| | |
| | | let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList') |
| | | this.productList = res.data |
| | | console.log(this.productList, ' async getTaskProductList()') |
| | | this.onProductSelected(this.productList[0]) |
| | | }, |
| | | selectOperatCondit(row) { |
| | | if (this.$refs.model.isChange) { |
| | |
| | | } |
| | | this.$refs.model.init(param) |
| | | }, |
| | | tableRowClassName( |
| | | { |
| | | row, |
| | | rowIndex |
| | | }) { |
| | | if (row.id == this.currentId) { |
| | | tableRowClassName({row, rowIndex}) { |
| | | if (row.id === this.currentId) { |
| | | return 'select-row'; |
| | | } else { |
| | | return 'not-select-row'; |