list.vue 47 KB

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