list.vue 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  1. <template>
  2. <section>
  3. <!--工具条-->
  4. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5. <el-form :inline="true" @submit.native.prevent>
  6. <el-form-item label="企业列表">
  7. </el-form-item>
  8. <el-form-item >
  9. <div>
  10. <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入企业名称关键字" clearable @change="searchList">
  11. <el-button slot="append" @click.stop="searchList" icon="el-icon-search"></el-button>
  12. </el-input>
  13. </div>
  14. </el-form-item>
  15. <el-form-item >
  16. <el-radio-group v-model="isMeal" size="small" @change="selIsmeal()">
  17. <el-radio-button :label="0">全部</el-radio-button>
  18. <el-radio-button :label="1">已签约</el-radio-button>
  19. <el-radio-button :label="2">即将到期</el-radio-button>
  20. </el-radio-group>
  21. <el-checkbox v-model="onlyContract" v-if="isMeal == 2" style="margin-left: 20px" @change="selIsmeal()">仅显示已签约</el-checkbox>
  22. <!-- <el-checkbox style="margin-left:20px" size="small" v-model="checked" @change="selIsmeal()">即将到期</el-checkbox> -->
  23. </el-form-item>
  24. </el-form>
  25. </el-col>
  26. <!--列表-->
  27. <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
  28. <el-table-column prop="companyName" label="企业名称" min-width="240" align="center">
  29. </el-table-column>
  30. <el-table-column prop="setMeal" label="是否签约" min-width="80" align="center">
  31. <template slot-scope="scope">{{scope.row.setMeal ? "已签约" : "未签约"}}</template>
  32. </el-table-column>
  33. <el-table-column prop="expirationDate" label="有效期" min-width="160" align="center">
  34. </el-table-column>
  35. <el-table-column prop="wxCorpid" label="企业微信" min-width="160" align="center">
  36. </el-table-column>
  37. <el-table-column prop="dingdingCorpid" label="钉钉" min-width="160" align="center">
  38. </el-table-column>
  39. <el-table-column prop="staffCountMax" label="人数上限" min-width="80" align="center">
  40. </el-table-column>
  41. <el-table-column prop="activeUserCount" label="在职人数" min-width="80" align="center">
  42. <template slot-scope="scope">
  43. <div :style="'color:'+(parseInt(scope.row.activeUserCount)>parseInt(scope.row.staffCountMax)?'red':'')">{{scope.row.activeUserCount}}</div>
  44. </template>
  45. </el-table-column>
  46. <el-table-column prop="packageWorktime" label="使用版本" align="left" min-width="500" header-align="center">
  47. <template slot-scope="scope">
  48. <!-- <span>{{scope.row.packageWorktime ? "工时 +" : ""}}</span>
  49. <span>{{scope.row.packageProject ? "项目协作 +" : ""}}</span>
  50. <span>{{scope.row.packageContract ? "合同 +" : ""}}</span>
  51. <span>{{scope.row.packageOa ? "OA +" : ""}}</span>
  52. <span>{{scope.row.packageEtimecard ? "生产车间 +" : ""}}</span>
  53. <span>{{scope.row.packageExpense ? "费用报销 +" : ""}}</span>
  54. <span>{{scope.row.packageCustomer ? "客户管理 +" : ""}}</span>
  55. <span>{{scope.row.packageEngineering ? "工程专业 +" : ""}}</span>
  56. <span>{{scope.row.packageSimple ? "简单表格 +" : ""}}</span>
  57. <span>{{scope.row.packageFinance ? "财务核算" : ""}}</span> -->
  58. <span v-for="(item, index) in scope.row.arrList" :key="index">
  59. {{item}} <span v-if="scope.row.arrList.length != 1 && scope.row.arrList.length - 1 != index">+</span>
  60. </span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="操作" width="360" class-name="btns" header-align="center" fixed="right">
  64. <template slot-scope="scope">
  65. <el-button size="mini" @click="editClick('A', scope.row)">完善签约信息</el-button>
  66. <el-button size="mini" @click="editClick('B', scope.row)">完善合同信息</el-button>
  67. <el-button size="mini" @click="editClick('C', scope.row)">合同预览</el-button>
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. <!--工具条-->
  72. <el-col :span="24" class="toolbar">
  73. <el-pagination
  74. @size-change="handleSizeChange"
  75. @current-change="handleCurrentChange"
  76. :page-sizes="[20 , 50 , 80 , 100]"
  77. :page-size="20"
  78. layout="total, sizes, prev, pager, next"
  79. :total="total"
  80. style="float:right;"
  81. ></el-pagination>
  82. </el-col>
  83. <!--编辑界面-->
  84. <!-- 完善签约信息 -->
  85. <el-dialog v-if="editDialogA" :visible.sync="editDialogA" title="完善签约信息" >
  86. <el-form @submit.native.prevent>
  87. <el-form-item label="开通版本:" label-width="150px">
  88. {{version}}
  89. </el-form-item>
  90. <el-form-item label="签约单价:" label-width="150px">
  91. <el-input size="small" controls-position="right" v-model="contractUnitPrice" style="width: 100px"></el-input> 元
  92. </el-form-item>
  93. <el-form-item label="签约折扣:" label-width="150px">
  94. <el-input-number size="small" controls-position="right" :max="9" :min="1" v-model="contractDiscount" :step="1" style="width: 100px"></el-input-number> 折
  95. </el-form-item>
  96. <el-form-item label="开单金额:" label-width="150px">
  97. <el-input size="small" controls-position="right" v-model="billingAmount" style="width: 100px"></el-input> 元
  98. </el-form-item>
  99. </el-form>
  100. <span slot="footer" class="dialog-footer">
  101. <el-button @click="editDialogA = false">取 消</el-button>
  102. <el-button type="primary" @click="ConfirmA()">确 定</el-button>
  103. </span>
  104. </el-dialog>
  105. <!-- 完善合同信息 需要调下样式-->
  106. <el-dialog v-if="editDialogB" :visible.sync="editDialogB" title="完善合同信息" width="1200px">
  107. <el-form :inline="true" :model="formInline" :rules="rulesFormInline" ref="formInline" class="heClass">
  108. <el-form-item label="甲方名称:" label-width="150px" prop="secondParty">
  109. <el-input size="small" controls-position="right" v-model="formInline.secondParty" :disabled="finalize" style="width: 300px"></el-input>
  110. </el-form-item>
  111. <el-form-item label="乙方名称:" label-width="150px">
  112. 南京火石闪信网络科技有限公司
  113. </el-form-item>
  114. <el-form-item label="甲方地址:" label-width="150px" prop="secondPartyAddr">
  115. <el-input size="small" controls-position="right" v-model="formInline.secondPartyAddr" :disabled="finalize" style="width: 400px"></el-input>
  116. </el-form-item>
  117. <el-form-item label="乙方地址:" label-width="150px">
  118. 南京市江宁区秣周东路12号悠谷软件园2号楼3楼P346室
  119. </el-form-item>
  120. <el-form-item label="甲方联系人:" label-width="150px" prop="secondPartyContacts">
  121. <el-input size="small" controls-position="right" v-model="formInline.secondPartyContacts" :disabled="finalize" style="width: 150px"></el-input>
  122. </el-form-item>
  123. <el-form-item label="乙方联系人:" label-width="150px">
  124. 屈跃庭
  125. </el-form-item>
  126. <el-form-item label="甲方电话:" label-width="150px" prop="secondPartyTel">
  127. <el-input size="small" controls-position="right" maxlength="11" v-model="formInline.secondPartyTel" :disabled="finalize" style="width: 150px"></el-input>
  128. </el-form-item>
  129. <el-form-item label="乙方电话:" label-width="150px">
  130. 15895914665
  131. </el-form-item>
  132. <el-form-item label="软件名称:" label-width="150px" prop="softwareName">
  133. <el-input size="small" controls-position="right" v-model="formInline.softwareName" :disabled="finalize" style="width: 200px"></el-input>
  134. </el-form-item>
  135. <el-form-item label="服务周期:" label-width="150px" prop="serviceDate">
  136. <el-input-number size="small" controls-position="right" :min="0" v-model.number="formInline.serviceDate" :disabled="finalize" style="width: 100px"></el-input-number> 年
  137. </el-form-item>
  138. <el-form-item label="服务开始日期:" label-width="150px" prop="startDate">
  139. <el-date-picker
  140. v-model="formInline.startDate"
  141. :disabled="finalize"
  142. type="date"
  143. placeholder="选择日期"
  144. value-format="yyyy-MM-dd">
  145. </el-date-picker>
  146. </el-form-item>
  147. <el-form-item label="年服务费:" label-width="150px" prop="serviceChargeOfYear">
  148. <el-input size="small" controls-position="right" v-model.number="formInline.serviceChargeOfYear" :disabled="finalize" style="width: 100px"></el-input> 元
  149. </el-form-item>
  150. <el-form-item label="定制开发费:" label-width="150px" prop="customDevelopmentCosts">
  151. <el-input size="small" controls-position="right" v-model.number="formInline.customDevelopmentCosts" :disabled="finalize" style="width: 100px"></el-input> 元
  152. </el-form-item>
  153. <el-form-item label="标准单价:" label-width="150px" prop="standardUnitPrice">
  154. <el-input size="small" controls-position="right" v-model.number="formInline.standardUnitPrice" :disabled="finalize" style="width: 100px"></el-input> 元每人每年
  155. </el-form-item>
  156. <el-form-item label="首次开通人数:" label-width="150px" prop="firstOpenNum" style="width: 100%">
  157. <el-input-number size="small" :min="0" controls-position="right" v-model.number="formInline.firstOpenNum" :disabled="finalize" style="width: 100px"></el-input-number> 人
  158. </el-form-item>
  159. <el-divider><i class="el-icon-s-check"></i></el-divider>
  160. <el-form-item label="甲方账号:" label-width="150px" prop="secondPartyAccount">
  161. <el-input size="small" controls-position="right" v-model="formInline.secondPartyAccount" :disabled="finalize" style="width: 300px"></el-input>
  162. </el-form-item>
  163. <el-form-item label="乙方账号:" label-width="150px">
  164. 32050188143600000075
  165. </el-form-item>
  166. <el-form-item label="甲方开户行:" label-width="150px" prop="secondPartyBankOfDeposit">
  167. <el-input size="small" controls-position="right" v-model="formInline.secondPartyBankOfDeposit" :disabled="finalize" style="width: 300px"></el-input>
  168. </el-form-item>
  169. <el-form-item label="乙方开户行:" label-width="150px">
  170. 建设银行股份有限公司南京湖北路支行
  171. </el-form-item>
  172. <!-- <el-form-item label="乙方开票名称:" label-width="150px" prop="secondPartyBillingName">
  173. <el-input size="small" controls-position="right" v-model="formInline.secondPartyBillingName" :disabled="finalize" style="width: 200px"></el-input>
  174. </el-form-item> -->
  175. <el-form-item label="甲方纳税人识别号:" label-width="150px" prop="secondPartyTIN">
  176. <el-input size="small" controls-position="right" v-model="formInline.secondPartyTIN" :disabled="finalize" style="width: 200px"></el-input>
  177. </el-form-item>
  178. <el-form-item label="甲方开具发票类型:" label-width="150px" prop="invoiceType">
  179. <el-select v-model="formInline.invoiceType" placeholder="请选择" :disabled="finalize">
  180. <el-option
  181. v-for="invoiceItem in invoiceOptions"
  182. :key="invoiceItem.value"
  183. :label="invoiceItem.label"
  184. :value="invoiceItem.value">
  185. </el-option>
  186. </el-select>
  187. </el-form-item>
  188. </el-form>
  189. <span slot="footer" class="dialog-footer">
  190. <el-button @click="editDialogB = false">取 消</el-button>
  191. <el-button type="primary" @click="ConfirmB('formInline')" :loading="listLoading" v-if="!finalize">确定</el-button>
  192. <!-- <el-button type="primary" @click="ConfirmC()" :loading="listLoading" v-if="!finalize">合同定稿</el-button> -->
  193. <el-popconfirm confirm-button-text='确定' cancel-button-text='取消' icon="el-icon-info" icon-color="#E6A23C" title="合同定稿将无法再继续编辑 是否确认?" @confirm="ConfirmC()">
  194. <el-button slot="reference" :loading="listLoading" v-if="!finalize&&this.contractData.secondParty!=null">合同定稿</el-button>
  195. </el-popconfirm>
  196. </span>
  197. </el-dialog>
  198. <!-- 合同预览/下载 -->
  199. <el-dialog v-if="editDialogC" :visible.sync="editDialogC" title="合同预览">
  200. <!-- <el-link type="primary" :underline="false" :href="downloadUrl2" id="moban" :download=" this.softwareName+'销售合同-'+this.secondParty+ '.docx'">下载合同</el-link> -->
  201. <el-link type="primary" :underline="false" :href="downloadUrl2" ref="moban" :download=" this.formInline.softwareName+'销售合同-'+this.formInline.secondParty+ '.docx'">下载合同</el-link>
  202. <el-link type="primary" :underline="false" @click="preview2()">点击预览</el-link>
  203. </el-dialog>
  204. </section>
  205. </template>
  206. <script>
  207. import axios from 'axios'
  208. export default {
  209. data() {
  210. return {
  211. dingdingSync:false,
  212. isMeal:0,
  213. editDialogA: false,
  214. editDialogB: false,
  215. editDialogC: false,
  216. editDialogD: false,
  217. editDialogF: false,
  218. editDialogG: false,
  219. editDialogH: false,
  220. downloadUrl2:null,
  221. dialogData: null,
  222. // 增加人数上限
  223. addStaffCountMaxNum: 0,
  224. // 修改有效期
  225. expirationNewDate: null,
  226. formInline: {
  227. //甲方名称
  228. firstParty: null,
  229. //乙方名称
  230. secondParty: null,
  231. //甲方地址
  232. firstPartyAddr: null,
  233. //乙方地址
  234. secondPartyAddr: null,
  235. //甲方联系人
  236. firstPartyContacts: null,
  237. //乙方联系人
  238. secondPartyContacts: null,
  239. //甲方电话
  240. firstPartyTel: null,
  241. //乙方电话
  242. secondPartyTel: null,
  243. //软件名称
  244. softwareName: null,
  245. //服务周期
  246. serviceDate:0,
  247. //服务开始日期
  248. startDate:null,
  249. //年服务费
  250. serviceChargeOfYear:0,
  251. //定制开发费
  252. customDevelopmentCosts:0,
  253. //标准单价
  254. standardUnitPrice:0,
  255. //首次开通人数
  256. firstOpenNum:0,
  257. //甲方账号
  258. firstPartyAccount:null,
  259. //甲方开户行
  260. firstPartyBankOfDeposit:null,
  261. //乙方账号
  262. secondPartyAccount:null,
  263. //乙方开户行
  264. secondPartyBankOfDeposit:null,
  265. //乙方开票名称
  266. secondPartyBillingName:null,
  267. //乙方纳税人识别号
  268. secondPartyTIN:null,
  269. //乙方开具发票类型
  270. invoiceType:'',
  271. },
  272. //合同定稿
  273. finalize:false,
  274. // 开通版本
  275. version: "未开通",
  276. // 签约单价
  277. contractUnitPrice: 0,
  278. // 签约折扣
  279. contractDiscount: 0,
  280. // 开单金额
  281. billingAmount: 0,
  282. reportFormList: [],
  283. keyword:null,
  284. tableHeight: 0,
  285. listLoading: false,
  286. total: 0,
  287. page: 1,
  288. size: 20,
  289. list: [],
  290. roleList: [],
  291. roleIdArr: [],
  292. signingData:null,
  293. contractData:null,
  294. onlyContract: false, // 仅显示已签约
  295. invoiceOptions: [{
  296. value: '增值税普通发票',
  297. label: '增值税普通发票'
  298. }, {
  299. value: '增值税专用发票',
  300. label: '增值税专用发票'
  301. },
  302. ],
  303. // 规则校验
  304. rulesFormInline: {
  305. secondParty: [{ required: true, message: '请输入乙方名称', trigger: 'blur' }],
  306. secondPartyAddr: [{ required: true, message: '请输入乙方地址', trigger: 'blur' }],
  307. secondPartyContacts: [{ required: true, message: '请输入乙方联系人', trigger: 'blur' }],
  308. secondPartyTel: [
  309. { required: true, message: '请输入乙方电话', trigger: 'blur' },
  310. { required: true, pattern:/^[0-9]{1,16}$/, message: '请输入正确的电话号码', trigger: 'change' },
  311. ],
  312. softwareName: [{ required: true, message: '请输入软件名称', trigger: 'blur' }],
  313. serviceDate: [
  314. { required: true, message: '请确认服务周期', trigger: 'blur' },
  315. ],
  316. startDate: [{ required: true, message: '请选择服务开始日期', trigger: 'blur' }],
  317. serviceChargeOfYear: [
  318. { required: true, message: '请输入年服务费', trigger: 'blur' },
  319. { required: true, pattern:/^[0-9]{1,16}$/, message: '请输入数字', trigger: 'change' },
  320. ],
  321. customDevelopmentCosts: [
  322. { required: true, message: '请输入定制开发费', trigger: 'blur' },
  323. { required: true, pattern:/^[0-9]{1,16}$/, message: '请输入数字', trigger: 'change' },
  324. ],
  325. standardUnitPrice: [
  326. { required: true, message: '请输入标准单价', trigger: 'blur' },
  327. { required: true, pattern:/^[0-9]{1,16}$/, message: '请输入数字', trigger: 'change' },
  328. ],
  329. firstOpenNum: [
  330. { required: true, message: '请输入首次开通人数', trigger: 'blur' },
  331. { required: true, pattern:/^[0-9]{1,16}$/, message: '请输入数字', trigger: 'change' },
  332. ],
  333. secondPartyAccount: [{ required: true, message: '请输入乙方账号', trigger: 'blur' }],
  334. secondPartyBankOfDeposit: [{ required: true, message: '请输入乙方开户行', trigger: 'blur' }],
  335. secondPartyBillingName: [{ required: true, message: '请输入乙方开票名称', trigger: 'blur' }],
  336. secondPartyTIN: [{ required: true, message: '请输入乙方纳税人识别号', trigger: 'blur' }],
  337. invoiceType: [{ required: true, message: '请输入乙方开具发票类型', trigger: 'blur' }],
  338. },
  339. };
  340. },
  341. // 过滤器
  342. filters: {
  343. },
  344. methods: {
  345. // 名称搜索
  346. searchList() {
  347. this.page = 1;
  348. this.getList();
  349. },
  350. // 是否签约筛选
  351. selIsmeal(){
  352. this.page = 1
  353. this.getList()
  354. },
  355. // 编辑按钮
  356. editClick(i,obj){
  357. this.dialogData = JSON.parse(JSON.stringify(obj))
  358. console.log("data",this.dialogData);
  359. if(i == 'A'){ this.editDialogA = true,this.getListWithsigning()}
  360. else if(i == 'B'){ this.editDialogB = true ,this.getcontractDetail()}
  361. else if(i == 'C'){ this.editDialogC = true,
  362. this.getcontractDetail()
  363. }
  364. else if(i == 'D'){ this.editDialogD = true }
  365. else if (i=='E') {
  366. //同步钉钉的组织架构人员
  367. this.startSyncDDMembs(obj);
  368. }
  369. else if(i == 'F'){
  370. // 考勤同步
  371. this.editDialogF = true
  372. this.http.post('/time-type/get',{
  373. companyId: this.dialogData.id
  374. },res => {
  375. if(res.code == 'ok'){
  376. this.$set(this.dialogData,'showCorpwxCardtime',res.data.showCorpwxCardtime ? true : false)
  377. this.$set(this.dialogData,'showDdCardtime',res.data.showDdCardtime ? true : false)
  378. this.$set(this.dialogData,'syncCorpwxTime',res.data.syncCorpwxTime ? true : false)
  379. this.$set(this.dialogData,'syncDingding',res.data.syncDingding ? true : false)
  380. }else{
  381. this.$message({
  382. message: res.msg,
  383. type: 'error'
  384. })
  385. }
  386. },err => {
  387. this.$message({
  388. message: err,
  389. type: 'error'
  390. })
  391. })
  392. }
  393. else if(i == 'G'){
  394. // 其他设置
  395. this.editDialogG = true
  396. this.http.post('/time-type/get',{
  397. companyId: this.dialogData.id
  398. },res => {
  399. if(res.code == 'ok'){
  400. this.$set(this.dialogData,'reportWorkflow',res.data.reportWorkflow ? true : false)
  401. this.$set(this.dialogData,'needEvaluate',res.data.needEvaluate ? true : false)
  402. this.$set(this.dialogData,'mainProjectState',res.data.mainProjectState ? true : false)
  403. this.$set(this.dialogData,'isSecretSalary',res.data.isSecretSalary ? true : false)
  404. this.$set(this.dialogData,'showFillauditTime',res.data.showFillauditTime ? true : false)
  405. this.$set(this.dialogData,'isCro',res.data.isCro ? true : false)
  406. this.$set(this.dialogData,'onlyImportreport',res.data.onlyImportreport ? true : false)
  407. this.$set(this.dialogData,'projectLevelState',res.data.projectLevelState ? true : false)
  408. this.$set(this.dialogData,'outputValueStatus',res.data.outputValueStatus ? true : false)
  409. this.$set(this.dialogData,'choseFromAlbum',res.data.choseFromAlbum ? true : false)
  410. this.$set(this.dialogData,'reportApproveMsgpush',res.data.reportApproveMsgpush ? true : false)
  411. this.$set(this.dialogData,'projectWithDept',res.data.projectWithDept ? true : false)
  412. this.$set(this.dialogData,'financeJobnumEnabled',res.data.financeJobnumEnabled ? true : false)
  413. this.$set(this.dialogData,'reportAutoApprove',res.data.reportAutoApprove ? true : false)
  414. this.$set(this.dialogData,'notAllowedNoAttendance',res.data.notAllowedNoAttendance ? true : false)
  415. this.$set(this.dialogData,'stageHasEvtime',res.data.stageHasEvtime ? true : false)
  416. // this.$set(this.dialogData,'pushReportData',res.data.pushReportData ? true : false)
  417. this.$set(this.dialogData,'financeAudit',res.data.financeAudit ? true : false)
  418. this.$set(this.dialogData,'includeWeekends',res.data.includeWeekends ? true : false)
  419. this.$set(this.dialogData,'multiWorktime',res.data.multiWorktime ? true : false)
  420. this.$set(this.dialogData,'reportAuditType',res.data.reportAuditType)
  421. this.$set(this.dialogData,'reportAutoApproveDays',res.data.reportAutoApproveDays)
  422. this.$set(this.dialogData,'restartTaskNeedReason',res.data.restartTaskNeedReason ? true : false)
  423. }else{
  424. this.$message({
  425. message: res.msg,
  426. type: 'error'
  427. })
  428. }
  429. },err => {
  430. this.$message({
  431. message: err,
  432. type: 'error'
  433. })
  434. })
  435. }
  436. else if(i == 'H'){
  437. this.editDialogH = true
  438. this.roleIdArr = []
  439. this.getReoprtFormList(obj)
  440. this.getRoleList(obj)
  441. }
  442. },
  443. startSyncDDMembs(row) {
  444. this.dingdingSync = true;
  445. this.http.post('/company/syncDindDingMembs', { corpid:row.dingdingCorpid},
  446. res => {
  447. this.dingdingSync = false;
  448. if (res.code == "ok") {
  449. this.editDialogA = false
  450. this.$message({
  451. message: "同步完成",
  452. type: "success"
  453. })
  454. } else {
  455. this.$message({
  456. message: res.msg,
  457. type: "error"
  458. });
  459. }
  460. },
  461. error => {
  462. this.dingdingSync = false;
  463. this.$message({
  464. message: error,
  465. type: "error"
  466. });
  467. });
  468. },
  469. getReoprtFormList(row){
  470. this.http.post('/company-report/list',{
  471. companyId: row.id
  472. },res => {
  473. if(res.code == 'ok'){
  474. this.reportFormList = res.data
  475. for(let i in this.reportFormList){
  476. this.reportFormList[i].owned = this.reportFormList[i].owned ? true : false
  477. }
  478. }else {
  479. this.$message({
  480. message: res.msg,
  481. type: 'error'
  482. })
  483. }
  484. },err => {
  485. this.$message({
  486. message: err,
  487. type: 'error'
  488. })
  489. })
  490. },
  491. getRoleList(row){
  492. this.http.post('/permission/getRoleList',{
  493. companyId: row.id
  494. },res => {
  495. if(res.code == 'ok'){
  496. this.roleList = res.data
  497. }else {
  498. this.$message({
  499. message: res.msg,
  500. type: 'error'
  501. })
  502. }
  503. },err => {
  504. this.$message({
  505. message: err,
  506. type: 'error'
  507. })
  508. })
  509. },
  510. // 获取签约信息
  511. getListWithsigning(){
  512. this.listLoading = true;
  513. this.http.post('/company-signing/getList', { companyId:this.dialogData.id},
  514. res => {
  515. this.listLoading = false;
  516. if (res.code == "ok") {
  517. this.signingData = res.data;
  518. if(this.signingData){
  519. this.version=this.signingData.version;
  520. this.contractUnitPrice=this.signingData.contractUnitPrice;
  521. this.contractDiscount=this.signingData.contractDiscount;
  522. this.billingAmount=this.signingData.billingAmount;
  523. }
  524. console.log(this.signingData);
  525. this.getList()
  526. } else {
  527. this.$message({
  528. message: res.msg,
  529. type: "error"
  530. });
  531. }
  532. },
  533. error => {
  534. this.listLoading = false;
  535. this.$message({
  536. message: error,
  537. type: "error"
  538. });
  539. });
  540. },
  541. //完善签约信息
  542. ConfirmA(){
  543. this.listLoading = true;
  544. this.http.post('/company-signing/update', { companyId:this.dialogData.id ,
  545. version:this.version,contractUnitPrice:this.contractUnitPrice,contractDiscount:this.contractDiscount,billingAmount:this.billingAmount},
  546. res => {
  547. this.listLoading = false;
  548. if (res.code == "ok") {
  549. this.editDialogA = false
  550. this.$message({
  551. message: "签约信息完善成功",
  552. type: "success"
  553. })
  554. } else {
  555. this.$message({
  556. message: res.msg,
  557. type: "error"
  558. });
  559. }
  560. },
  561. error => {
  562. this.listLoading = false;
  563. this.$message({
  564. message: error,
  565. type: "error"
  566. });
  567. });
  568. },
  569. // 获取合同信息
  570. getcontractDetail(){
  571. this.listLoading = true;
  572. this.http.post('/contract-detail/detail', { companyId:this.dialogData.id},
  573. res => {
  574. this.listLoading = false;
  575. if (res.code == "ok") {
  576. this.contractData = res.data;
  577. if(this.contractData){
  578. this.formInline.secondParty=this.contractData.secondParty;
  579. this.formInline.secondPartyAddr=this.contractData.secondPartyAddr;
  580. this.formInline.secondPartyContacts=this.contractData.secondPartyContacts;
  581. this.formInline.secondPartyTel=this.contractData.secondPartyTel;
  582. this.formInline.softwareName=this.contractData.softwareName;
  583. this.formInline.serviceDate=this.contractData.serviceDate;
  584. this.formInline.startDate=this.contractData.startDate;
  585. this.formInline.serviceChargeOfYear=this.contractData.serviceChargeOfYear;
  586. this.formInline.customDevelopmentCosts=this.contractData.customDevelopmentCosts;
  587. this.formInline.standardUnitPrice=this.contractData.standardUnitPrice;
  588. this.formInline.firstOpenNum=this.contractData.firstOpenNum;
  589. this.formInline.secondPartyAccount=this.contractData.secondPartyAccount;
  590. this.formInline.secondPartyBankOfDeposit=this.contractData.secondPartyBankOfDeposit;
  591. this.formInline.secondPartyBillingName=this.contractData.secondPartyBillingName;
  592. this.formInline.secondPartyTIN=this.contractData.secondPartyTIN;
  593. this.formInline.billingAmount=this.contractData.billingAmount;
  594. this.formInline.invoiceType=this.contractData.invoiceType;
  595. this.finalize=this.contractData.finalize ? true : false;
  596. }
  597. console.log(this.signingData);
  598. this.downloadUrl2 = `/upload/${this.formInline.softwareName}销售合同-${this.formInline.secondParty}.docx`
  599. console.log(this.downloadUrl2)
  600. } else {
  601. this.$message({
  602. message: res.msg,
  603. type: "error"
  604. });
  605. }
  606. },
  607. error => {
  608. this.listLoading = false;
  609. this.$message({
  610. message: error,
  611. type: "error"
  612. });
  613. });
  614. },
  615. // 完善合同信息
  616. ConfirmB(formName){
  617. this.$refs[formName].validate((valid) => {
  618. console.log(valid)
  619. if (valid) {
  620. this.listLoading = true;
  621. this.http.post('/contract-detail/update', {
  622. companyId:this.dialogData.id,
  623. secondParty:this.formInline.secondParty,
  624. secondPartyAddr:this.formInline.secondPartyAddr,
  625. secondPartyContacts:this.formInline.secondPartyContacts,
  626. secondPartyTel:this.formInline.secondPartyTel,
  627. softwareName:this.formInline.softwareName,
  628. serviceDate:this.formInline.serviceDate,
  629. startDate:this.formInline.startDate,
  630. serviceChargeOfYear:this.formInline.serviceChargeOfYear,
  631. customDevelopmentCosts:this.formInline.customDevelopmentCosts,
  632. standardUnitPrice:this.formInline.standardUnitPrice,
  633. firstOpenNum:this.formInline.firstOpenNum,
  634. secondPartyAccount:this.formInline.secondPartyAccount,
  635. secondPartyBankOfDeposit:this.formInline.secondPartyBankOfDeposit,
  636. secondPartyBillingName:this.formInline.secondPartyBillingName,
  637. secondPartyTIN:this.formInline.secondPartyTIN,
  638. billingAmount:this.formInline.billingAmount,
  639. invoiceType:this.formInline.invoiceType,
  640. },
  641. res => {
  642. this.listLoading = false;
  643. if (res.code == "ok") {
  644. this.editDialogB = false
  645. this.downloadUrl2=res.data
  646. this.$message({
  647. message: "合同信息完善成功,合同模板已重新生成",
  648. type: "success"
  649. })
  650. } else {
  651. this.$message({
  652. message: res.msg,
  653. type: "error"
  654. });
  655. }
  656. },
  657. error => {
  658. this.listLoading = false;
  659. this.$message({
  660. message: error,
  661. type: "error"
  662. });
  663. });
  664. } else {
  665. return false;
  666. }
  667. });
  668. },
  669. // 合同定稿
  670. ConfirmC(){
  671. this.listLoading = true;
  672. this.http.post('/contract-detail/finalize',{companyId:this.dialogData.id,},
  673. res => {
  674. this.listLoading = false;
  675. if (res.code == "ok") {
  676. this.editDialogB = false
  677. this.$message({
  678. message: "合同定稿成功",
  679. type: "success"
  680. })
  681. this.getList()
  682. } else {
  683. this.$message({
  684. message: res.msg,
  685. type: "error"
  686. });
  687. }
  688. },
  689. error => {
  690. this.listLoading = false;
  691. this.$message({
  692. message: error,
  693. type: "error"
  694. });
  695. });
  696. },
  697. preview(){
  698. this.downloadUrl2 = `/upload/${this.softwareName}销售合同-${this.secondParty}.pdf`
  699. window.open(this.downloadUrl2, '_blank');
  700. },
  701. preview2(){
  702. this.http.previewFile('/contract-detail/preview', { companyId:this.dialogData.id}, res => {
  703. const blob = new Blob([res], { type: "application/pdf" });
  704. let elink = {
  705. href: window.URL.createObjectURL(blob)
  706. }
  707. window.open(elink.href, '_blank');
  708. });
  709. },
  710. // 设为已签约
  711. ConfirmD(setMeal){
  712. this.listLoading = true;
  713. this.http.post('/company/setMeal', { companyId:this.dialogData.id,meal: setMeal ? 0 : 1 },
  714. res => {
  715. this.listLoading = false;
  716. if (res.code == "ok") {
  717. this.editDialogD = false
  718. this.$message({
  719. message: setMeal ? "取消签约成功" : "签约成功",
  720. type: "success"
  721. })
  722. this.getList()
  723. } else {
  724. this.$message({
  725. message: res.msg,
  726. type: "error"
  727. });
  728. }
  729. },
  730. error => {
  731. this.listLoading = false;
  732. this.$message({
  733. message: error,
  734. type: "error"
  735. });
  736. });
  737. },
  738. // 考勤同步
  739. ConfirmF(){
  740. let parameter = {
  741. companyId: this.dialogData.id
  742. }
  743. if(this.dialogData.wxCorpid){
  744. parameter.syncCorpwxTime = this.dialogData.syncCorpwxTime ? 1 : 0
  745. parameter.showCorpwxCardtime = this.dialogData.showCorpwxCardtime ? 1 : 0
  746. }
  747. if(this.dialogData.dingdingCorpid){
  748. parameter.syncDingding = this.dialogData.syncDingding ? 1 : 0
  749. parameter.showDdCardtime = this.dialogData.showDdCardtime ? 1 : 0
  750. }
  751. this.http.post('/company/setTimeTypeSetting',parameter,
  752. res => {
  753. if(res.code == 'ok'){
  754. this.editDialogF = false
  755. this.$message({
  756. message: '操作成功',
  757. type: 'success'
  758. })
  759. }else{
  760. this.editDialogF = false
  761. this.$message({
  762. message: res.msg,
  763. type: 'error'
  764. })
  765. }
  766. },err => {
  767. this.editDialogF = false
  768. this.$message({
  769. message: err,
  770. type: 'error'
  771. })
  772. })
  773. },
  774. // 其他设置
  775. ConfirmG(){
  776. this.http.post('/company/setTimeTypeSetting',{
  777. companyId: this.dialogData.id,
  778. reportWorkflow: this.dialogData.reportWorkflow ? 1 : 0,
  779. needEvaluate: this.dialogData.needEvaluate ? 1 : 0,
  780. mainProjectState: this.dialogData.mainProjectState ? 1 : 0,
  781. isSecretSalary: this.dialogData.isSecretSalary ? 1 : 0,
  782. showFillauditTime: this.dialogData.showFillauditTime ? 1 : 0,
  783. isCro: this.dialogData.isCro ? 1 : 0,
  784. onlyImportreport: this.dialogData.onlyImportreport ? 1 : 0,
  785. projectLevelState: this.dialogData.projectLevelState ? 1 : 0,
  786. outputValueStatus: this.dialogData.outputValueStatus ? 1 : 0,
  787. choseFromAlbum: this.dialogData.choseFromAlbum ? 1 : 0,
  788. reportApproveMsgpush: this.dialogData.reportApproveMsgpush ? 1 : 0,
  789. projectWithDept: this.dialogData.projectWithDept ? 1 : 0,
  790. financeJobnumEnabled: this.dialogData.financeJobnumEnabled ? 1 : 0,
  791. reportAutoApprove: this.dialogData.reportAutoApprove ? 1 : 0,
  792. notAllowedNoAttendance: this.dialogData.notAllowedNoAttendance ? 1 : 0,
  793. stageHasEvtime: this.dialogData.stageHasEvtime ? 1 : 0,
  794. // pushReportData: this.dialogData.pushReportData ? 1 : 0,
  795. includeWeekends: this.dialogData.includeWeekends ? 1 : 0,
  796. multiWorktime: this.dialogData.multiWorktime ? 1 : 0,
  797. reportAuditType: this.dialogData.reportAuditType,
  798. reportAutoApproveDays: this.dialogData.reportAutoApproveDays, // 自动审核的天数
  799. restartTaskNeedReason: this.dialogData.restartTaskNeedReason ? 1 : 0,
  800. },res => {
  801. if(res.code == 'ok'){
  802. this.editDialogG = false
  803. this.$message({
  804. message: '成功',
  805. type: 'success'
  806. })
  807. }else{
  808. this.editDialogG = false
  809. this.$message({
  810. message: res.msg,
  811. type: 'error'
  812. })
  813. }
  814. },err => {
  815. this.editDialogG = false
  816. this.$message({
  817. message: err,
  818. type: 'error'
  819. })
  820. })
  821. },
  822. // 报表配置
  823. ConfirmH(){
  824. let ids = ''
  825. for(let i in this.reportFormList){
  826. if(this.reportFormList[i].owned){
  827. ids += this.reportFormList[i].id + ','
  828. }
  829. }
  830. if(ids){ids = ids.substring(0,ids.length - 1)}
  831. let roleIds = ''
  832. for(let m in this.roleIdArr){
  833. roleIds += this.roleIdArr[m] + ','
  834. }
  835. if(roleIds){
  836. roleIds = roleIds.substring(0,roleIds.length - 1)
  837. }else{
  838. this.$message({
  839. message: '请选择要开通的角色',
  840. type: 'error'
  841. })
  842. return
  843. }
  844. this.http.post('/company-report/update',{
  845. companyId: this.dialogData.id,
  846. formIds: ids,
  847. roleIds: roleIds
  848. },res => {
  849. if(res.code == 'ok'){
  850. this.editDialogH = false
  851. this.$message({
  852. message: '更新成功',
  853. type: 'success'
  854. })
  855. }else {
  856. this.$message({
  857. message: res.msg,
  858. type: 'error'
  859. })
  860. }
  861. },err => {
  862. this.$message({
  863. message: err,
  864. type: 'error'
  865. })
  866. })
  867. },
  868. //分页
  869. handleCurrentChange(val) {
  870. this.page = val;
  871. this.getList();
  872. },
  873. handleSizeChange(val) {
  874. this.size = val;
  875. this.getList();
  876. },
  877. //获取项目列表
  878. getList() {
  879. this.listLoading = true;
  880. this.http.post('/company/getList', {
  881. pageIndex: this.page,
  882. pageSize: this.size,
  883. companyName: this.keyword,
  884. isMeal: this.isMeal == 2 ? 0 : this.isMeal,
  885. key: this.isMeal == 2 ? 1 : 0,
  886. keyForIsMeal: this.onlyContract
  887. },
  888. res => {
  889. this.listLoading = false;
  890. if (res.code == "ok") {
  891. for(var i in res.data.records) {
  892. var arrList = []
  893. res.data.records[i].packageWorktime == 1 ? arrList.push('工时') : ''
  894. res.data.records[i].packageProject == 1 ? arrList.push('项目协作') : ''
  895. res.data.records[i].packageContract == 1 ? arrList.push('合同') : ''
  896. res.data.records[i].packageOa == 1 ? arrList.push('OA') : ''
  897. res.data.records[i].packageEtimecard == 1 ? arrList.push('生产车间') : ''
  898. res.data.records[i].packageExpense == 1 ? arrList.push('费用报销') : ''
  899. res.data.records[i].packageCustomer == 1 ? arrList.push('客户管理') : ''
  900. res.data.records[i].packageEngineering == 1 ? arrList.push('工程专业') : ''
  901. res.data.records[i].packageSimple == 1 ? arrList.push('简单表格') : ''
  902. res.data.records[i].packageFinance == 1 ? arrList.push('财务核算') : ''
  903. res.data.records[i].arrList = arrList
  904. }
  905. var list = res.data.records;
  906. this.list = list;
  907. this.total = res.data.total;
  908. } else {
  909. this.$message({
  910. message: res.msg,
  911. type: "error"
  912. });
  913. }
  914. },
  915. error => {
  916. this.listLoading = false;
  917. this.$message({
  918. message: error,
  919. type: "error"
  920. });
  921. });
  922. },
  923. },
  924. created() {
  925. let height = window.innerHeight;
  926. this.tableHeight = height - 195;
  927. const that = this;
  928. window.onresize = function temp() {
  929. that.tableHeight = window.innerHeight - 195;
  930. };
  931. },
  932. mounted() {
  933. this.getList();
  934. }
  935. };
  936. </script>
  937. <style lang="scss" scoped>
  938. .heClass .el-form-item {
  939. width: 48%
  940. }
  941. .rg_span{
  942. display: inline-block;
  943. }
  944. .rg_span span {
  945. text-align: right;
  946. box-sizing: border-box;
  947. padding-right: 10px;
  948. }
  949. .el-dialog__title {
  950. display: inline-table;
  951. margin-top: 20px;
  952. }
  953. .btns .el-button{
  954. margin-left: 10px;
  955. margin-bottom: 5px;
  956. }
  957. </style>
  958. <style>
  959. .otherForm .el-form-item{
  960. float: left;
  961. width: 50%;
  962. margin: 0;
  963. }
  964. </style>