代码更新
This commit is contained in:
@@ -60,20 +60,13 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
devices,
|
||||
models,
|
||||
subTypes
|
||||
} from '@/pagePrinter/devices.js'
|
||||
import { ref,reactive } from 'vue';
|
||||
import { devices, models, subTypes } from '@/pagePrinter/devices.js'
|
||||
import go from '@/commons/utils/go.js'
|
||||
import {
|
||||
shopConfigprinter,
|
||||
delTableHandle
|
||||
} from '@/http/yskApi/devices.js'
|
||||
import {
|
||||
getCurrentInstance
|
||||
} from 'vue';
|
||||
|
||||
import myModel from '@/components/my-components/my-model.vue'
|
||||
import { updatePrinter, delPrinter } from '@/api/printer.js'
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
@@ -81,6 +74,11 @@
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['init'])
|
||||
const delModel=ref(null)
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
let toUrl = () => {
|
||||
go.to('PAGES_PRINTER_ADD', {
|
||||
id: props.data.id
|
||||
@@ -103,25 +101,33 @@
|
||||
return dayjs(s).format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态修改
|
||||
* @param {Object} d
|
||||
*/
|
||||
async function openDiscountChange(d) {
|
||||
delete props.data.createdAt
|
||||
delete props.data.updatedAt
|
||||
const res = await shopConfigprinter({
|
||||
...props.data,
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
const res = await updatePrinter({
|
||||
...props.data
|
||||
})
|
||||
emit('init', '')
|
||||
}
|
||||
const refs = getCurrentInstance()
|
||||
// 删除
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
function delTableHandleEvent() {
|
||||
refs.ctx.$refs.delModel.open()
|
||||
delModel.value.open()
|
||||
}
|
||||
//删除分类确认
|
||||
|
||||
/**
|
||||
* 删除分类确认
|
||||
*/
|
||||
async function delModelConfirm() {
|
||||
const res = await delTableHandle(props.data.id)
|
||||
const res = await delPrinter(props.data.id)
|
||||
emit('init', '')
|
||||
refs.ctx.$refs.delModel.close()
|
||||
delModel.value.close()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user