|
@@ -85,7 +85,8 @@ import { onMounted, ref, watch } from 'vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import router from '~src/router/index'
|
|
|
import { getErtractInfo } from '~api/other'
|
|
|
-import { formValidate, getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
|
+import { HcDelMsg } from 'hc-vue3-ui'
|
|
|
+import { arrToId, formValidate, getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
|
import mainApi from '~api/tentative/material/testSample'
|
|
|
|
|
|
//参数
|
|
@@ -246,11 +247,39 @@ const rowActionModalClose = () => {
|
|
|
|
|
|
//取消待测
|
|
|
const rowCancel = (row) => {
|
|
|
-
|
|
|
+ HcDelMsg({
|
|
|
+ title: '确认取消提醒',
|
|
|
+ text: '请谨慎考虑后,确认是否取消待测?',
|
|
|
+ }, async (resolve) => {
|
|
|
+ await tableDataCancel(row.id)
|
|
|
+ resolve() //关闭弹窗的回调
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
//批量取消待测
|
|
|
const batchCancel = () => {
|
|
|
+ const rows = tableCheckedKeys.value
|
|
|
+ if (rows.length <= 0) {
|
|
|
+ window.$message.warning('请先勾选需要取消的数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ HcDelMsg({
|
|
|
+ title: '确认取消提醒',
|
|
|
+ text: '请谨慎考虑后,确认是否取消待测?',
|
|
|
+ }, async (resolve) => {
|
|
|
+ await tableDataCancel(arrToId(rows))
|
|
|
+ resolve() //关闭弹窗的回调
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
+//取消待测
|
|
|
+const tableDataCancel = async (ids) => {
|
|
|
+ let form = { id: ids, sampleStatus: 2 }
|
|
|
+ const { error, code, msg } = await mainApi.update(form)
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success('取消成功')
|
|
|
+ } else {
|
|
|
+ window.$message.error(msg || '创建失败')
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|