zhouwx
2025-03-13 7d88ba6e2373679c5da3c9bc9ee5f7cd41c029e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<template>
  <div class="app-container">
    <div style="display: flex;justify-content: space-between;margin-bottom: 20px">
      <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" >
        <el-radio-group v-model="queryParams.type">
          <el-radio-button label="" >全部</el-radio-button>
          <el-radio-button label="1">签署中</el-radio-button>
          <el-radio-button label="2" >已归档</el-radio-button>
        </el-radio-group>
<!--        <el-form-item label="仓库名称:" >-->
<!--          <el-input v-model="data.queryParams.name" placeholder="请输仓库名称"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item >-->
<!--          <el-button-->
<!--              type="primary"-->
<!--              @click="getList"-->
<!--          >查询</el-button>-->
<!--          <el-button-->
<!--              type="primary"-->
<!--              plain-->
<!--              @click="reset"-->
<!--          >重置</el-button>-->
<!--        </el-form-item>-->
      </el-form>
    </div>
    <!-- 表格数据 -->
    <el-table v-loading="loading" :data="dataList" :border="true">
      <el-table-column label="序号" type="index" align="center" width="80" />
      <el-table-column label="项目名称" prop="name" align="center"  />
      <el-table-column label="模板ID" prop="remark" align="center" />
      <el-table-column label="发起部门" prop="remark" align="center" />
      <el-table-column label="发起时间" prop="remark" align="center" />
      <el-table-column label="最初签署人" prop="remark" align="center" />
      <el-table-column label="流转记录" prop="count" align="center" >
        <template #default="scope">
          <span style="color: #1890ff;cursor: pointer" @click="record(scope.row)">{{scope.row.count}}</span>
        </template>
      </el-table-column>
      <el-table-column label="签署状态" prop="remark" align="center" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250" >
        <template #default="scope">
          <el-button link type="primary" >预览</el-button>
          <el-button link type="primary" @click="circulationBtn(scope.row)" >流转</el-button>
          <el-button link type="primary" >确认归档</el-button>
          <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
        v-show="total > 0"
        :total="total"
        v-model:page="queryParams.pageNum"
        v-model:limit="queryParams.pageSize"
        @pagination="getList"
    />
    <circulation ref="circulationRef" @getList="getList"></circulation>
    <timeRecord ref="timeRecordRef" @getList="getList"></timeRecord>
  </div>
</template>
 
<script setup>
import {getCurrentInstance, onMounted, onUnmounted, reactive, ref, toRefs} from "vue";
import {ElMessage, ElMessageBox} from "element-plus";
import circulation from './components/circulation'
import timeRecord from './components/record.vue'
const { proxy } = getCurrentInstance();
const loading = ref(false);
const dialogRef = ref();
const circulationRef = ref();
const cupDialogRef = ref();
const timeRecordRef = ref()
const data = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    type: ''
  },
  total: 0,
  dataList: []
});
 
const { queryParams, total, dataList } = toRefs(data);
const classHourRef = ref();
onMounted(()=>{
  getList()
})
 
onUnmounted(()=>{
 
})
 
const getList = async () => {
  loading.value = true
  // const res = await getWarehouse(data.queryParams)
  // if(res.code == 200){
  //   data.dataList = res.data.list
  //   data.total = res.data.total
  // }else{
  //   ElMessage.warning(res.message)
  // }
  data.dataList = [
    {
      id: 1,
      name: 'xxx',
      count: 2
    }
  ]
  loading.value = false
}
 
const openDialog = (type, value) => {
  dialogRef.value.openDialog(type, value);
}
const record = (val) => {
  timeRecordRef.value.openDialog(val)
}
 
const circulationBtn = (value) => {
  circulationRef.value.openDialog(value)
}
/** 重置新增的表单以及其他数据  */
function reset() {
  data.queryParams = {
    pageNum: 1,
    pageSize: 10,
    name: ''
  }
  getList()
}
const handleDelete = (val) => {
  ElMessageBox.confirm(
      '确定删除此条数据?',
      '提示',
      {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
      .then( async() => {
        const res = await delWarehouse(val.id)
        if(res.code == 200){
          ElMessage.success('数据删除成功')
          await getList()
        }else{
          ElMessage.warning(res.message)
        }
      })
}
const delCup = (val) => {
  ElMessageBox.confirm(
      '确定删除此条数据?',
      '提示',
      {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
      .then( async() => {
        const res = await delCupboard(val.id)
        if(res.code == 200){
          ElMessage.success('数据删除成功')
          await getList()
        }else{
          ElMessage.warning(res.message)
        }
      })
}
const addCupboard = (type,value) => {
  cupDialogRef.value.openDialog(type, value);
}
 
const getRowKeys = (row) => {
  return row.name
}
</script>