guoyujia 5 months ago
parent
commit
4f12a1b81b

+ 10 - 1
src/views/business/interReturnReceipt/index.vue

@@ -97,6 +97,7 @@ import queryStore from "@/store/modules/query";
 const dataList = ref([]);
 const loading = ref(true);
 const ids = ref([]);
+const selections = ref([])
 const total = ref(0);
 /** 查询对象 */
 const queryParams = ref({
@@ -150,6 +151,8 @@ function resetQuery() {
 /**复选框选中数据 */
 function handleSelectionChange(selection) {
   ids.value = selection.map((item) => item.id);
+  console.log(ids.value)
+  selections.value = selection.filter((item) => item.isSubmit == 0);
 }
 /** 修改按钮操作 */
 function handleShowFormDialog(row) {
@@ -198,7 +201,13 @@ function handleDelete() {
 
 /** 打印按钮操作 */
 function handlePrint() {
-  printReturnReceipt({ id: ids.value[0] });
+  console.log("999")
+  console.log(selections.value)
+  if(selections.value.length > 0){
+    proxy.$modal.msgError("当前收回单未提交,不能打印!");
+  }else{
+    printReturnReceipt({ id: ids.value[0] });
+  }
 }
 //取消提交
 function handleCancelSubmit(row) {

+ 8 - 1
src/views/business/returnReceipt/index.vue

@@ -95,6 +95,7 @@ const { proxy } = getCurrentInstance();
 
 const dataList = ref([]);
 const loading = ref(true);
+const selections = ref([])
 const ids = ref([]);
 const total = ref(0);
 /** 查询对象 */
@@ -143,6 +144,7 @@ function resetQuery() {
 /**复选框选中数据 */
 function handleSelectionChange(selection) {
   ids.value = selection.map((item) => item.id);
+  selections.value = selection.filter((item) => item.isSubmit == 0);
 }
 /** 修改按钮操作 */
 function handleShowFormDialog(row) {
@@ -191,7 +193,12 @@ function handleDelete() {
 
 /** 打印按钮操作 */
 function handlePrint() {
-  printReturnReceipt({ id: ids.value[0] });
+  console.log("999")
+  if(selections.value.length > 0){
+    proxy.$modal.msgError("当前收回单未提交,不能打印!");
+  }else{
+    printReturnReceipt({ id: ids.value[0] });
+  }
 }
 //取消提交
 function handleCancelSubmit(row) {