123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <template>
- <div>
- <list ref="list">
- <!--单位计量-->
- <unitAdd
- type="add"
- slot="unitAdd"
- @unitAddSuccess="unitAddSuccess"
- v-if="tool.checkAuth($route.name,'insert')"
- />
- <template v-slot:unitEdit="scope">
- <unitAdd
- type="edit"
- @unitAddSuccess="unitAddSuccess"
- :unitData="scope.data"
- v-if="tool.checkAuth($route.name,'update')"
- />
- </template>
- <template v-slot:unitDel="scope">
- <Del type="unit"
- @deleteSuccess="UnitDeleteSuccess"
- :id="scope.data.data.unitid"
- v-if="tool.checkAuth($route.name,'delete')"
- />
- </template>
- <!--单位计量组-->
- <unit-group-add
- type="add"
- slot="unitGroupAdd"
- @unitAddSuccess="unitGroupAddSuccess"
- :allUnit="unitList"
- v-if="tool.checkAuth($route.name,'insert')"
- />
- <template v-slot:unitGroupEdit="scope">
- <unit-group-add
- type="edit"
- :unitData="scope.data.row"
- @unitAddSuccess="unitGroupAddSuccess"
- :allUnit="scope.data.unitList"
- v-if="tool.checkAuth($route.name,'update')"
- />
- </template>
- <template v-slot:unitGroupDel="scope">
- <Del type="unitGroup"
- @deleteSuccess="unitGroupDelSuccess"
- :id="scope.data.unitgroupid"
- v-if="tool.checkAuth($route.name,'delete')"
- />
- </template>
- </list>
- </div>
- </template>
- <script>
- import list from './components/list'
- import Del from './components/delete'
- import unitAdd from './components/unitAdd'
- import unitGroupAdd from './components/unitGroupAdd'
- export default {
- name: '',
- data() {
- return {
- unitList:''
- };
- },
- components:{list,Del,unitAdd,unitGroupAdd},
- computed:{
- },
- watch:{
- },
- created() {
- this.getUnit()
- },
- methods: {
- /* 计量单位增加成功 */
- unitAddSuccess() {
- this.$refs.list.getUnit()
- },
- /* 计量单位删除成功 */
- UnitDeleteSuccess() {
- this.$refs.list.getUnit()
- },
- /* 计量组添加成功 */
- unitGroupAddSuccess() {
- this.$refs.list.getUnitGroup()
- },
- /* 计量组删除成功 */
- unitGroupDelSuccess() {
- this.$refs.list.getUnitGroup()
- },
- /* 获取单位列表 */
- async getUnit() {
- let res = await this.$api.requested({
- "id": "20220922084803",
- "version":1,
- "content": {
- "nocache":true,
- "where":{
- "condition":""
- }
- }
- })
- this.unitList = res.data
- console.log(res)
- },
- },
- };
- </script>
- <style scoped>
- </style>
|