12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <template>
- <div class="unit container normal-panel">
- <el-row>
- <el-col :span="11">
- <p class="normal-title normal-margin">计量单位</p>
- <slot name="unitAdd"/>
- <tableLayout v-if="unitList" :layout="tablecols1" :data="unitList" :custom="false" height="70vh">
- <template v-slot:opreation="scope">
- <div style="display:flex">
- <slot name="unitEdit" :data="scope.data" />
- <slot name="unitDel" :data="scope" />
- </div>
- </template>
- </tableLayout>
- </el-col>
- <el-col :span="11" style="margin-left:16px">
- <p class="normal-title normal-margin">计量单位组</p>
- <slot name="unitGroupAdd"/>
- <tableLayout v-if="unitGroupList" :layout="tablecols2" :data="unitGroupList" :custom="false" height="70vh">
- <template v-slot:opreation="scope">
- <div style="display:flex">
- <slot name="unitGroupEdit" :data="{row:scope.data,unitList:unitList}" />
- <slot name="unitGroupDel" :data="scope.data" />
- </div>
- </template>
- </tableLayout>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- export default {
- name: '',
- data() {
- return {
- unitList:'',
- unitGroupList:'',
- tablecols1:'',
- tabelCol2:''
- };
- },
- computed:{
- },
- watch:{
- },
- created() {
- this.getUnit()
- this.getUnitGroup()
- this.tablecols1 = this.tool.tabelCol(this.$route.name).unitTable.tablecols
- this.tablecols2 = this.tool.tabelCol(this.$route.name).unitGroupTable.tablecols
- },
- methods: {
- /* 获取单位列表 */
- async getUnit() {
- let res = await this.$api.requested({
- "id": "20220922084803",
- "version":1,
- "content": {
- "nocache":true,
- "where":{
- "condition":""
- }
- }
- })
- this.unitList = res.data
- console.log(res)
- },
- /* 计量单位组数据 */
- async getUnitGroup() {
- let res = await this.$api.requested({
- "id": "20220922084503",
- "version":1,
- "content": {
- "nocache":true,
- "where":{
- "condition":""
- }
- }
- })
- this.unitGroupList = res.data
- console.log(res);
-
- }
- },
- };
- </script>
- <style scoped>
- </style>
|