list.vue 48 KB

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