综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

subContract.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="128px">
  4. <el-form-item label="合同名称" prop="subContractName">
  5. <el-input v-model="queryParams.subContractName" placeholder="请输入合同名称" clearable
  6. @keyup.enter.native="handleQuery" />
  7. </el-form-item>
  8. <el-form-item label="承接单位" prop="partnerId">
  9. <el-select v-model="queryParams.partnerId" clearable filterable remote reserve-keyword placeholder="请输入承接单位"
  10. :remote-method="remoteMethod" :loading="loading" style="width: 400px;">
  11. <el-option v-for="partner in partnerList" :key="partner.partnerId" :label="partner.partnerName"
  12. :value="partner.partnerId">
  13. </el-option>
  14. </el-select>
  15. </el-form-item>
  16. <!-- <el-form-item label="拟稿人" prop="drafter">
  17. <el-select v-model="queryParams.drafter" filterable clearable @change="handleQuery">
  18. <el-option v-for="item in $store.state.user.userList" :key="item.userId" :label="item.nickName"
  19. :value="item.userId">
  20. </el-option>
  21. </el-select>
  22. </el-form-item> -->
  23. <el-form-item>
  24. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  25. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  26. </el-form-item>
  27. </el-form>
  28. <el-row :gutter="10" class="mb8">
  29. <el-col :span="1.5">
  30. <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
  31. v-hasPermi="['oa:subContract:export']">导出</el-button>
  32. </el-col>
  33. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  34. </el-row>
  35. <el-table v-loading="loading" border :data="subContractList" @selection-change="handleSelectionChange">
  36. <el-table-column type="index" label="序号" width="55" align="center" />
  37. <el-table-column label="合同名称" align="center" prop="subContractName" width="200px" />
  38. <el-table-column label="分包合同金额" align="center" prop="subAmount" />
  39. <el-table-column label="承接单位" align="center" prop="partner.partnerName" />
  40. <!-- <el-table-column label="承接单位联系人" align="center" prop="contactPerson" /> -->
  41. <el-table-column label="拟稿人" align="center" prop="drafter">
  42. <template slot-scope="scope">
  43. {{ getUserName(scope.row.drafter) }}
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="拟稿日期" align="center" prop="draftTime" width="180">
  47. <template slot-scope="scope">
  48. <span>{{ parseTime(scope.row.draftTime, '{y}-{m}-{d}') }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="合同备注" align="center" prop="remark" />
  52. <el-table-column label="签订日期" align="center" prop="signDate" width="180">
  53. <template slot-scope="scope">
  54. <span>{{ parseTime(scope.row.signDate, '{y}-{m}-{d}') }}</span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="签订备注" align="center" prop="signRemark" />
  58. <el-table-column label="签订扫描件" align="center" prop="signScan">
  59. <template slot-scope="scope">
  60. <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + scope.row.signScan}`)">
  61. {{ getFileName(scope.row.signScan) }}
  62. </el-link>
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="评审方式" align="center" prop="commentType">
  66. <template slot-scope="scope">
  67. <el-tag :type="scope.row.commentType == '2' ? 'success' : 'warning'">
  68. {{ setCommentType(scope.row.commentType) }}
  69. </el-tag>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  73. <template slot-scope="scope">
  74. <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
  75. v-hasPermi="['oa:subContract:query']">查看</el-button>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
  80. @pagination="getList" />
  81. <!-- 添加或修改cmc分包合同评审对话框 -->
  82. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  83. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  84. <el-form-item label="主合同id" prop="contractId">
  85. <el-input v-model="form.contractId" placeholder="请输入主合同id" />
  86. </el-form-item>
  87. <el-form-item label="合同名称" prop="subContractName">
  88. <el-input v-model="form.subContractName" placeholder="请输入合同名称" />
  89. </el-form-item>
  90. <el-form-item label="分包合同金额" prop="subAmount">
  91. <el-input v-model="form.subAmount" placeholder="请输入分包合同金额" />
  92. </el-form-item>
  93. <el-form-item label="承接单位id" prop="partnerId">
  94. <el-input v-model="form.partnerId" placeholder="请输入承接单位id" />
  95. </el-form-item>
  96. <el-form-item label="承接单位联系人" prop="contactPerson">
  97. <el-input v-model="form.contactPerson" placeholder="请输入承接单位联系人" />
  98. </el-form-item>
  99. <el-form-item label="拟稿人" prop="drafter">
  100. <el-input v-model="form.drafter" placeholder="请输入拟稿人" />
  101. </el-form-item>
  102. <el-form-item label="拟稿日期" prop="draftTime">
  103. <el-date-picker clearable v-model="form.draftTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择拟稿日期">
  104. </el-date-picker>
  105. </el-form-item>
  106. <el-form-item label="合同备注" prop="remark">
  107. <el-input v-model="form.remark" placeholder="请输入合同备注" />
  108. </el-form-item>
  109. <el-form-item label="签订日期" prop="signDate">
  110. <el-date-picker clearable v-model="form.signDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择签订日期">
  111. </el-date-picker>
  112. </el-form-item>
  113. <el-form-item label="签订备注" prop="signRemark">
  114. <el-input v-model="form.signRemark" placeholder="请输入签订备注" />
  115. </el-form-item>
  116. <el-form-item label="签订扫描件" prop="signScan">
  117. <el-input v-model="form.signScan" placeholder="请输入签订扫描件" />
  118. </el-form-item>
  119. </el-form>
  120. <div slot="footer" class="dialog-footer">
  121. <el-button type="primary" @click="submitForm">确 定</el-button>
  122. <el-button @click="cancel">取 消</el-button>
  123. </div>
  124. </el-dialog>
  125. <el-dialog :title="title" :visible.sync="openInfo" append-to-body width="70%">
  126. <sub-contract :taskForm="taskForm" :flowDisabled="false"></sub-contract>
  127. </el-dialog>
  128. </div>
  129. </template>
  130. <script>
  131. import { listSubContract, getSubContract, delSubContract, addSubContract, updateSubContract } from "@/api/oa/contract/subContract";
  132. import { listPartner } from "@/api/oa/partner/partner";
  133. import subContract from '../../flowable/form/business/subContract.vue';
  134. export default {
  135. components: { subContract },
  136. name: "SubContract",
  137. data() {
  138. return {
  139. baseUrl: process.env.VUE_APP_BASE_API,
  140. // 遮罩层
  141. loading: true,
  142. // 选中数组
  143. ids: [],
  144. // 非单个禁用
  145. single: true,
  146. // 非多个禁用
  147. multiple: true,
  148. // 显示搜索条件
  149. showSearch: true,
  150. // 总条数
  151. total: 0,
  152. // cmc分包合同评审表格数据
  153. subContractList: [],
  154. partnerList: [],
  155. // 弹出层标题
  156. title: "",
  157. // 是否显示弹出层
  158. open: false,
  159. openInfo: false,
  160. // 查询参数
  161. queryParams: {
  162. pageNum: 1,
  163. pageSize: 10,
  164. contractId: null,
  165. subContractName: null,
  166. subAmount: null,
  167. partnerId: null,
  168. contactPerson: null,
  169. drafter: null,
  170. draftTime: null,
  171. signDate: null,
  172. signRemark: null,
  173. signScan: null,
  174. commentType: null
  175. },
  176. // 表单参数
  177. form: {},
  178. // 表单校验
  179. rules: {
  180. },
  181. taskForm: {
  182. formId: ''
  183. }
  184. };
  185. },
  186. created() {
  187. this.getList();
  188. },
  189. methods: {
  190. /** 查询cmc分包合同评审列表 */
  191. getList() {
  192. this.loading = true;
  193. listSubContract(this.queryParams).then(response => {
  194. this.subContractList = response.rows;
  195. this.total = response.total;
  196. this.loading = false;
  197. });
  198. },
  199. remoteMethod(val) {
  200. listPartner({
  201. pageNum: 1,
  202. pageSize: 20,
  203. partnerName: val
  204. }).then(res => {
  205. this.partnerList = res.rows;
  206. })
  207. },
  208. handleView(row) {
  209. this.openInfo = true;
  210. this.title = "合同详情";
  211. this.form = row;
  212. this.$set(this.taskForm, 'formId', row.subContractId)
  213. },
  214. // 取消按钮
  215. cancel() {
  216. this.open = false;
  217. this.reset();
  218. },
  219. // 表单重置
  220. reset() {
  221. this.form = {
  222. subContractId: null,
  223. contractId: null,
  224. subContractName: null,
  225. subAmount: null,
  226. partnerId: null,
  227. contactPerson: null,
  228. drafter: null,
  229. draftTime: null,
  230. remark: null,
  231. signDate: null,
  232. signRemark: null,
  233. signScan: null,
  234. commentType: null
  235. };
  236. this.resetForm("form");
  237. },
  238. /** 搜索按钮操作 */
  239. handleQuery() {
  240. this.queryParams.pageNum = 1;
  241. this.getList();
  242. },
  243. /** 重置按钮操作 */
  244. resetQuery() {
  245. this.resetForm("queryForm");
  246. this.handleQuery();
  247. },
  248. // 多选框选中数据
  249. handleSelectionChange(selection) {
  250. this.ids = selection.map(item => item.subContractId)
  251. this.single = selection.length !== 1
  252. this.multiple = !selection.length
  253. },
  254. /** 新增按钮操作 */
  255. handleAdd() {
  256. this.reset();
  257. this.open = true;
  258. this.title = "添加cmc分包合同评审";
  259. },
  260. /** 修改按钮操作 */
  261. handleUpdate(row) {
  262. this.reset();
  263. const subContractId = row.subContractId || this.ids
  264. getSubContract(subContractId).then(response => {
  265. this.form = response.data;
  266. this.open = true;
  267. this.title = "修改cmc分包合同评审";
  268. });
  269. },
  270. /** 提交按钮 */
  271. submitForm() {
  272. this.$refs["form"].validate(valid => {
  273. if (valid) {
  274. if (this.form.subContractId != null) {
  275. updateSubContract(this.form).then(response => {
  276. this.$modal.msgSuccess("修改成功");
  277. this.open = false;
  278. this.getList();
  279. });
  280. } else {
  281. addSubContract(this.form).then(response => {
  282. this.$modal.msgSuccess("新增成功");
  283. this.open = false;
  284. this.getList();
  285. });
  286. }
  287. }
  288. });
  289. },
  290. /** 删除按钮操作 */
  291. handleDelete(row) {
  292. const subContractIds = row.subContractId || this.ids;
  293. this.$modal.confirm('是否确认删除cmc分包合同评审编号为"' + subContractIds + '"的数据项?').then(function () {
  294. return delSubContract(subContractIds);
  295. }).then(() => {
  296. this.getList();
  297. this.$modal.msgSuccess("删除成功");
  298. }).catch(() => { });
  299. },
  300. /** 导出按钮操作 */
  301. handleExport() {
  302. this.download('oa/subContract/export', {
  303. ...this.queryParams
  304. }, `subContract_${new Date().getTime()}.xlsx`)
  305. },
  306. setCommentType(commentType) {
  307. if (commentType == '2') {
  308. return '线上评审'
  309. } else if (commentType == '0') {
  310. return '无须评审'
  311. } else {
  312. return '会议评审'
  313. }
  314. }
  315. }
  316. };
  317. </script>