ContractChoice.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <el-dialog v-model="visible" width="55%" append-to-body draggable :close-on-click-modal="false">
  3. <template #header>
  4. <div class="dialog-title-container">
  5. <span class="title-label" style="color: white"><i class="el-icon-document" style="color: white" />
  6. 合同选择</span>
  7. <i class="el-icon-close" @click="close" />
  8. </div>
  9. </template>
  10. <!-- 功能按钮 -->
  11. <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
  12. <el-form-item label="客户名称:" prop="companyName">
  13. <el-input v-model="queryParams.companyName" size="small" placeholder="请输入客户名称" clearable
  14. style="width: 150px" @keyup.enter="handleQuery" />
  15. </el-form-item>
  16. <el-form-item label="合同编号:" prop="contractNo">
  17. <el-input v-model="queryParams.contractNo" size="small" placeholder="请输入合同编号" clearable
  18. style="width: 150px" @keyup.enter="handleQuery" />
  19. </el-form-item>
  20. <el-form-item label="服务类型:" prop="serviceType">
  21. <el-select size="small" v-model="queryParams.serviceType" placeholder="服务类型" clearable
  22. style="width: 150px" @keyup.enter="handleQuery">
  23. <el-option v-for="item in serviceTypes" :key="item.value" :label="item.label" :value="item.value" />
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item>
  27. <el-button type="primary" icon="Search" @click="handleQuery" size="small">搜索</el-button>
  28. <el-button icon="Refresh" @click="resetQuery" size="small">重置</el-button>
  29. </el-form-item>
  30. </el-form>
  31. <div class="dialog-list-container">
  32. <el-table :data="list" size="small" border height="400px" header-row-class-name="list-header-row"
  33. row-class-name="list-row" @selection-change="handleSelectionChange">
  34. <el-table-column v-if="multiple" type="selection" width="40" align="center" />
  35. <el-table-column type="index" label="序号" width="46" align="center" />
  36. <el-table-column label="合同编号" prop="contractNo" width="100" align="center" />
  37. <el-table-column label="客户名称" prop="companyName" width="200" align="center" />
  38. <el-table-column label="签约时间" prop="formDate" width="200" align="center" />
  39. <el-table-column label="备注" prop="remark" header-align="center" />
  40. <el-table-column v-if="!multiple" label="操作" width="50" align="center">
  41. <template #default="scope">
  42. <el-button link type="success" size="small"
  43. @click="handleSimpleSelected(scope.row)">选择</el-button>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. </div>
  48. <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
  49. v-model:limit="queryParams.pageSize" @pagination="getList" style="background-color: rgba(0, 0, 0, 0);" />
  50. </el-dialog>
  51. </template>
  52. <script setup>
  53. import { toRef } from 'vue'
  54. import { listOrder2 } from "@/api/business/crm/contract";
  55. const { proxy } = getCurrentInstance();
  56. const props = defineProps({
  57. width: {
  58. type: String,
  59. default: '800px'
  60. },
  61. multiple: {
  62. type: Boolean,
  63. default: () => false
  64. }
  65. })
  66. const total = ref(0);
  67. const emit = defineEmits(['choice']);
  68. const { width, multiple } = toRefs(props)
  69. const data = reactive({
  70. visible: false,
  71. query: {
  72. pageNum: 1,
  73. pageSize: 15,
  74. total: 0
  75. },
  76. list: [],
  77. selections: [],
  78. options: {}
  79. })
  80. const serviceTypes = ref([
  81. {
  82. label: "循环服务",
  83. value: 1,
  84. },
  85. {
  86. label: "单次服务",
  87. value: 2,
  88. },
  89. ]);
  90. const queryParams = ref({
  91. pageNum: 1,
  92. pageSize: 20,
  93. fromId: 0,
  94. orderByColumn: "create_time",
  95. category: null,
  96. code: null,
  97. name: null,
  98. shortName: null,
  99. companyName: null,
  100. oldName: null,
  101. owner: null,
  102. phone: null,
  103. email: null,
  104. contactAddress: null,
  105. source: null,
  106. type: null,
  107. socialCreditCode: null,
  108. mainBusiness: null,
  109. legalRepresentative: null,
  110. foundationDate: null,
  111. licenceDate: null,
  112. businessStartDate: null,
  113. businessEndDate: null,
  114. isPermanentlyEffective: null,
  115. registerMoney: null,
  116. registerMoneyUnit: null,
  117. provinceCode: null,
  118. province: null,
  119. cityCode: null,
  120. city: null,
  121. districtCode: null,
  122. district: null,
  123. address: null,
  124. businessField: null,
  125. taxType: null,
  126. isZero: null,
  127. competentTaxAuthority: null,
  128. taxCollectorName: null,
  129. taxCollectorPhone: null,
  130. taxMonth: null,
  131. openingBank: null,
  132. bankAccount: null,
  133. annualIncome: null,
  134. governmentAccountNo: null,
  135. governmentPassword: null,
  136. socialSecurityAccountNo: null,
  137. socialSecurityPassword: null,
  138. employeePassword: null,
  139. housingFundPassword: null,
  140. housingFundUnitAccount: null,
  141. housingFundDeductionPassword: null,
  142. collectionMethod: null,
  143. quotaAmount: null,
  144. isPayOnWindow: null,
  145. isFirstSocialSecurity: null,
  146. isFirstHousingFund: null,
  147. customerLabelId: [],
  148. boss: null
  149. });
  150. const { visible, query, list, selections, options } = toRefs(data)
  151. function open(input) {
  152. visible.value = true;
  153. getList()
  154. }
  155. function close() {
  156. visible.value = false;
  157. }
  158. const getList = () => {
  159. listOrder2(queryParams.value)
  160. .then(res => {
  161. total.value = res.total
  162. list.value = res.rows
  163. }).catch(err => {
  164. console.log(err)
  165. })
  166. }
  167. function resetQuery() {
  168. proxy.resetForm("queryRef");
  169. handleQuery();
  170. }
  171. const handleMultipleSelected = () => {
  172. emit('choice', selections.value)
  173. close()
  174. }
  175. const handleSimpleSelected = (row) => {
  176. emit('choice', row)
  177. close()
  178. }
  179. /** 搜索按钮操作 */
  180. function handleQuery() {
  181. queryParams.value.pageNum = 1;
  182. getList();
  183. }
  184. const handleSelectionChange = (choiceSelections) => {
  185. selections.value = choiceSelections
  186. }
  187. getList()
  188. defineExpose({
  189. open,
  190. close
  191. })
  192. </script>