| | |
| | | <script> |
| | | import winMd from '@/components/win/win-md' |
| | | import myButton from '@/components/myButton/myButton' |
| | | import {delSpecs} from "@/api/foudation/material"; |
| | | import {delSpecs, updSpecsStatus} from "@/api/foudation/material"; |
| | | import specsAdd from "@/views/foundation/material/specs/specsAdd.vue"; |
| | | import {mapGetters} from 'vuex' |
| | | import MyTableV2 from "@/components/myTable/myTableV2.vue"; |
| | |
| | | }, |
| | | // 表格数据 |
| | | table: { |
| | | autoLoad: false, |
| | | showIndex: true, // 是否显示序号 |
| | | expand: false, // 是否显示详情数据 |
| | | dataIndex: 'goodsTemplatesId', |
| | |
| | | }, |
| | | // 列信息 |
| | | columns: [ |
| | | {title: '规格型号', field: 'goodsCode', align: 'left', minWidth: 120}, |
| | | {title: '单位', field: 'classification', align: 'center', width: 100}, |
| | | {title: '规格型号', field: 'modelName', align: 'left', minWidth: 120}, |
| | | {title: '单位', field: 'unit', align: 'center', width: 100}, |
| | | { |
| | | field: 'states', |
| | | title: '状态', |
| | |
| | | ], |
| | | }, |
| | | paging: { |
| | | show: true, // 显示分页 |
| | | show: false, // 显示分页 |
| | | // 分页信息 |
| | | page: { |
| | | small: false, |
| | |
| | | computed: { |
| | | ...mapGetters(['userInfo']) |
| | | }, |
| | | created() { |
| | | mounted() { |
| | | this.$nextTick(()=>{ |
| | | this.search() |
| | | }) |
| | | |
| | | }, |
| | | methods: { |
| | | showAdd(){ |
| | | this.specsSetting.mid = this.setting.id;//物品ID |
| | | this.specsSetting.goodsTemplatesId = this.setting.goodsTemplatesId;//物品ID |
| | | this.specsSetting.show = true; |
| | | }, |
| | | updState(row) { |
| | | let vm = this |
| | | let text = row.states == 0 ? "启用" : "禁用"; |
| | | vm.$modal.confirm('确认要' + text + '"' + row.modelName + '"规格吗?').then(function () { |
| | | let params = Object.assign({}, row) |
| | | params.states = row.states == 1 ? 0 : 1 |
| | | updSpecsStatus(params).then(res => { |
| | | if (res) { |
| | | row.states = row.states === 1 ? 0 : 1 |
| | | vm.$modal.msgSuccess(text + "成功"); |
| | | vm.search() |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | del(row) { |
| | | this.$modal |
| | | .confirm('是否确认删除名称为"' + row.categoryName + '"的机构吗?') |
| | | .confirm('是否确认删除名称为"' + row.modelName + '"的规格吗?') |
| | | .then(function () { |
| | | delSpecs({ id: row.id }).then((res) => {}); |
| | | }) |
| | |
| | | }, |
| | | // 查询table列表 |
| | | search() { |
| | | this.$refs.myTable.search() |
| | | this.$refs.myTable.search({goodsTemplatesId:this.specsSetting.goodsTemplatesId}) |
| | | }, |
| | | |
| | | } |