12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220 |
- <template>
- <div>
- <div class="simple-container">
- <simple-form
- :form="table_form"
- @search="handleSearch"
- class="department-form"
- >
- </simple-form>
- <simple-table
- :list="table_list"
- :config="table_config"
- :loading="table_loading"
- :handle-row="table_handle_row"
- @check="handleCheck"
- @edit="handleEdit"
- @delete="handleDelete"
- @remove="handleRemove"
- @urge="handleUrge"
- @receiverName="handleReceiver"
- ></simple-table>
- <simple-pagination
- :page="page"
- :total="total"
- @change="handleChange"
- ></simple-pagination>
- </div>
- <simple-dialog
- fullscreen
- title="文件收集"
- :visible="visible"
- :reload="reload"
- width="1300px"
- @cancel="handleCancel('visible')"
- >
- <template>
- <!-- 按钮部分 -->
- <div class="flex-justify-between padding-right-20 padding-left-20">
- <div>
- <template v-if="edit_visible">
- <!-- 转派按钮 科室经理 7、分管副总 2、总经理 1可见 -->
- <el-button
- type="primary"
- v-if="
- edit_form.status === '0' &&
- (duty === '7' || duty === '3' || duty === '4')
- "
- @click="handleTransfer"
- >转派</el-button
- >
- <!-- 审批按钮 科室经理、分管副总、总经理可见 -->
- <el-button
- type="primary"
- v-if="
- (edit_form.status === '2' ||
- edit_form.status === '6' ||
- edit_form.status === '7') &&
- (duty === '7' || duty === '3' || duty === '4') &&
- reviewType === duty
- "
- @click="handleApprove"
- >审批</el-button
- >
- </template>
- </div>
- </div>
- <!-- 主体部分 -->
- <simple-sheet
- v-if="visible"
- :id="edit_form.id"
- :receiver="receiverId"
- :type="
- edit_visible &&
- (((edit_form.status === '1' ||
- edit_form.status === '2' ||
- edit_form.status === '5') &&
- duty === '9') ||
- edit_form.status === '0')
- ? 'edit'
- : 'view'
- "
- attribute="file"
- status="10"
- @save="handleSave"
- />
- </template>
- <template v-slot:footer><div></div></template>
- </simple-dialog>
- <simple-dialog
- title="审批"
- :visible="approve_visible"
- :reload="reload"
- width="500px"
- class="approve"
- @cancel="handleCancel('approve_visible')"
- >
- <el-form :model="approveForm" ref="approveForm" label-width="120px">
- <el-form-item
- label="审批意见:"
- :rules="{
- required: true,
- message: '请选择审批意见',
- trigger: 'change',
- }"
- >
- <el-select v-model="approveForm.type">
- <el-option
- v-for="item in approveForm.list"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- v-if="approveForm.type === '3'"
- label="其它审批意见:"
- :rules="{
- required: true,
- message: '请输入审批意见',
- trigger: 'blur',
- }"
- ><el-input v-model="approveForm.comments" /></el-form-item
- ></el-form>
- <template v-slot:footer
- ><div>
- <div v-if="type === '1'">
- <el-button @click="handleTurn('finish')" type="primary">结束</el-button>
- <el-button @click="handleTurn('transfer')"
- >转副总审批</el-button
- >
- <el-button @click="handleTurn('transfermanger')"
- >转总经理审批</el-button
- >
- </div>
- <div v-else-if="type === '2'">
- <el-button @click="handleTurn('finish')" type="primary">结束</el-button>
- <el-button @click="handleTurn('return')" type="primary">退回</el-button>
- <el-button @click="handleTurn('back')" type="primary">打回</el-button>
- <el-button @click="handleTurn('transfer')"
- >转总经理审批</el-button
- >
- </div>
- <div v-else>
- <el-button @click="handleTurn('back')">打回</el-button>
- <el-button @click="handleTurn('return')">退回</el-button>
- <el-button @click="handleTurn('agree')" type="primary"
- >同意</el-button
- >
- </div>
- </div>
- </template>
- </simple-dialog>
- <simple-dialog
- title="转派"
- :visible="transfer_visible"
- :reload="reload"
- width="1200px"
- @confirm="transferConfirm"
- @cancel="handleCancel('transfer_visible')"
- >
- <el-form
- :model="transfer_form"
- :rules="transfer_rules"
- ref="transfer_form"
- label-width="80px"
- >
- <el-form-item
- label="转派人员"
- v-for="(item, index) in transfer_form.charge"
- :key="index"
- :rules="{
- required: true,
- message: '负责人不能为空',
- trigger: 'blur',
- }"
- >
- <div class="flex">
- <el-select
- class="margin-bottom-20 margin-right-10"
- placeholder="请选择负责人"
- v-model="item.person"
- @change="personChange"
- filterable
- >
- <el-option
- v-for="({ label, value }, index) in transfer_list_orgin"
- :key="index"
- :label="label"
- :value="value"
- ></el-option>
- </el-select>
- <div v-if="permission_type === 2">
- <span class="form-content">可编辑行:</span>
- <el-select
- class="margin-bottom-20 margin-right-10"
- placeholder="请选择可编辑行"
- multiple
- v-model="item.rowNum"
- @change="colsChange"
- >
- <el-option
- v-for="(item, index) in transfer_rows_orgin"
- :key="index"
- :label="item"
- :value="item"
- ></el-option>
- </el-select>
- </div>
- <!-- <div v-if="permission_type === 2">
- <span class="form-content">可编辑列:</span>
- <el-select
- class="margin-bottom-20 margin-right-10"
- placeholder="请选择可编辑列"
- multiple
- v-model="item.allowEditingColumns"
- @change="rowsChange"
- >
- <el-option
- v-for="(item, index) in transfer_cols_orgin"
- :key="index"
- :label="item"
- :value="item"
- ></el-option>
- </el-select>
- </div> -->
- </div>
- </el-form-item>
- <div>
- <el-button
- class="margin-right-10"
- @click.prevent="handleCharge('add')"
- type="primary"
- >添加</el-button
- >
- <el-button
- v-if="transfer_form.charge.length - 1"
- @click.prevent="handleCharge('delete')"
- >删除</el-button
- >
- </div>
- </el-form>
- </simple-dialog>
- <simple-dialog
- title="回复详情"
- width="1000px"
- @cancel="handleCancel('principal_visible')"
- @confirm="handleCancel('principal_visible')"
- :visible="principal_visible"
- >
- <simple-table
- :list="receiver_table_list"
- :config="receiver_table_config"
- ></simple-table>
- <template v-slot:footer><div></div></template>
- </simple-dialog>
- <simple-dialog
- title="选择科室经理"
- :visible="menager_visible"
- @confirm="confirmManger"
- @cancel="handleCancel('menager_visible')"
- >
- <el-form>
- <el-form-item label="科室经理">
- <el-select v-model="receiverId">
- <el-option
- v-for="(item, index) in receiverList"
- :key="index"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- </simple-dialog>
- </div>
- </template>
- <script>
- import simpleForm from "./components/form.vue";
- import simpleTable from "./components/table.vue";
- import simplePagination from "./components/pagination.vue";
- import simpleDialog from "./components/dialog.vue";
- // import analysis from "./analysis.vue";
- import simpleSheet from "./components/sheet.vue";
- export default {
- components: {
- simpleForm,
- simpleTable,
- simplePagination,
- simpleDialog,
- simpleSheet,
- },
- data() {
- return {
- page: 1,
- idx: "",
- rows: 10,
- total: 0,
- reviewType: "",
- isCheck: false,
- // 判断是否为2---特殊权限或者为1---公共权限
- permission_type: 2,
- // 职位判断转派用
- duty: "",
- // 搜索参数
- table_search: {},
- // dialog 参数
- transfer_visible: false,
- visible: false,
- edit_visible: false,
- // 审批
- approve_visible: false,
- // 转派
- track_visible: false,
- // 回复详情
- principal_visible: false,
- // 查看经理
- menager_visible: false,
- edit_form: {},
- // 接收人id
- receiverId: "",
- receiverList: [],
- // 回复详情
- receiver_table_list: [],
- receiver_table_config: [
- {
- label: "接收人",
- props: "receiveName",
- },
- {
- label: "科室",
- props: "dept",
- },
- {
- label: "回复时间",
- props: "createTime",
- },
- {
- label: "审批记录",
- props: "result",
- type: "textarea",
- },
- {
- label: "审批意见",
- props: "opinion",
- type: "textarea",
- },
- ],
- transfer_list_orgin: [],
- transfer_cols_orgin: [],
- transfer_rows_orgin: [],
- transfer_list: [],
- transfer_form: {
- // personnel: "", // 转派人员
- charge: [{ person: "", allowEditingColumns: [], rowNum: [] }],
- },
- reload: 0,
- // 判断类型
- type: "3",
- approverules: {
- comments: [
- {
- required: true,
- message: "请输入审批意见",
- trigger: "blur",
- },
- ],
- },
- // 转派规则
- transfer_rules: {
- personnel: [
- {
- required: true,
- message: "请选择转派人员",
- trigger: "change",
- },
- ],
- col_start: [
- {
- required: true,
- message: "请选择行",
- trigger: "change",
- },
- ],
- row_start: [
- {
- required: true,
- message: "请选择列",
- trigger: "change",
- },
- ],
- },
- // 审批意见
- approveForm: {
- type: "",
- comments: "",
- list: [
- {
- label: "同意",
- value: "同意",
- },
- {
- label: "不同意",
- value: "不同意",
- },
- {
- label: "其他",
- value: "3",
- },
- ],
- },
- trackList: [],
- // 顶部form
- table_form: [
- {
- label: "模板名称",
- props: "name",
- type: "input",
- },
- {
- label: "截止时间",
- props: "issuedDate",
- type: "datetime",
- },
- {
- label: "是否为督办",
- props: "superviseFlag",
- type: "select",
- // 0.否 1.是
- dictionary: [
- {
- label: "否",
- value: "0",
- },
- {
- label: "是",
- value: "1",
- },
- ],
- },
- {
- label: "状态",
- props: "status",
- type: "select",
- // 0.待处理 1.待汇总 2.待审批 3.已完成 4已提交 5未提交 6待二级副总审批 7待二级正总审批
- dictionary: [
- {
- label: "已撤回",
- value: "-1",
- },
- {
- label: "待处理",
- value: "0",
- },
- {
- label: "待汇总",
- value: "1",
- },
- {
- label: "待审批",
- value: "2",
- },
- {
- label: "已完成",
- value: "3",
- },
- {
- label: "已提交",
- value: "4",
- },
- {
- label: "未提交",
- value: "5",
- },
- {
- label: "待二级副总审批",
- value: "6",
- },
- {
- label: "待二级正总审批",
- value: "7",
- },
- ],
- },
- ],
- // 列表数据
- table_list: [],
- table_loading: false,
- // 表格里的操作按钮delete
- table_handle_row: [
- {
- label: "查看",
- props: "check",
- },
- {
- label: "处理",
- props: "edit",
- visible: {
- processFlag: ["0"],
- },
- },
- {
- label: "撤回",
- props: "delete",
- popconfirm: true,
- visible: {
- withdrawFlag: ["0"],
- },
- },
- {
- label: "删除",
- props: "remove",
- popconfirm: true,
- visible: {
- withdrawFlag: ["0"],
- },
- },
- // {
- // label: "催办",
- // props: "urge",
- // visible: {
- // superviseFlag: ["1"],
- // },
- // },
- ],
- // 表头配置
- table_config: [
- {
- label: "序号",
- type: "number",
- },
- {
- label: "模板名称",
- props: "templateName",
- },
- {
- label: "填报事由",
- props: "reason",
- },
- {
- label: "填报注意事项",
- props: "precautions",
- },
- {
- label: "截止时间",
- props: "endTime",
- // type: "time",
- },
- {
- label: "发起人",
- props: "loginNameStr",
- },
- {
- label: "接收人",
- props: "receiverName",
- type: "click",
- control: "viewFlag",
- },
- {
- label: "当前处理人",
- props: "currentReceiverName",
- },
- {
- label: "发起时间",
- props: "createTime",
- },
- {
- label: "状态",
- props: "status",
- type: "dictionary",
- dictionary: {
- "-1": "已撤回",
- 0: "待处理",
- 1: "待汇总",
- 2: "待审批",
- 3: "已完成",
- 4: "已提交",
- 5: "未提交",
- 6: "待二级副总审批",
- 7: "待二级正总审批",
- },
- },
- {
- label: "是否为督办",
- props: "superviseFlag",
- type: "dictionary",
- dictionary: {
- null: "否",
- 0: "否",
- 1: "是",
- },
- },
- ],
- };
- },
- watch: {
- "approveForm.type"() {
- this.approveForm.comments = "";
- },
- },
- mounted() {
- this.handleInit({
- ...this.table_search,
- page: this.page,
- pageSize: this.rows,
- id : this.getUrlKey("id")//获取地址栏参数
- });
- // 职位
- this.duty = JSON.parse(sessionStorage.userInfo).duty;
- // 根据职位判定 科室经理7、分管副总 4 、总经理 3 、职员 9
- console.log(this.duty, "duty");
- switch (this.duty) {
- // 科室经理
- case "7":
- this.type = "1";
- break;
- // 分管副总
- case "4":
- this.type = "2";
- break;
- // 总经理
- case "3":
- this.type = "3";
- break;
- }
- },
- methods: {
- getUrlKey(name) {
- return (
- decodeURIComponent(
- (new RegExp("[?|&]" + name + "=" + "([^&;]+?)(&|#|;|$)").exec(
- location.href
- ) || [, ""])[1].replace(/\+/g, "%20")
- ) || null
- );
- },
- // 初始化
- handleInit(data) {
- this.table_loading = true;
- this.$http({
- url: "/market/CMKIssued/CMKIssuedListByUser",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: data,
- }).then(({ data: { count, data } }) => {
- // if (this.idx) {
- // var data1;
- // for (var i = 0; i < data.length; i++) {
- // if (data[i].id != this.idx) {
- // } else {
- // data1 = data[i];
- // data.length = 0;
- // data.push(data1);
- // this.table_loading = false;
- // this.total = count;
- // this.table_list = data || [];
- // }
- // }
- // }
- this.table_loading = false;
- this.total = count;
- this.table_list = data || [];
- });
- },
- handleChange(page) {
- this.page = page;
- this.handleInit({
- ...this.table_search,
- page: this.page,
- pageSize: this.rows,
- });
- },
- // 搜索事件
- handleSearch(data) {
- this.table_search = {
- ...data,
- issuedDate: data.issuedDate
- ? this.$formatDate(data.issuedDate, "YYYY-MM-DD HH:mm:ss")
- : data.issuedDate,
- };
- console.log(this.table_search, "daaad");
- this.page = 1;
- this.handleInit({
- ...this.table_search,
- page: this.page,
- pageSize: this.rows,
- });
- },
- // 编辑按钮
- handleEdit(row) {
- this.visible = true;
- this.edit_visible = true;
- this.edit_form = row;
- this.reviewType = "";
- // 暂时的处理先调接口
- this.$http({
- url: "/market/CMKIssued/CMKIssuedProcessByUser",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: { id: this.edit_form.id },
- }).then(({ data: { reviewType, list } }) => {
- // 判断审批按钮是否还存在
- this.permission_type = Number(list[0].type);
- console.log(reviewType, "res");
- this.reviewType = reviewType;
- switch (reviewType) {
- case null:
- this.reviewType = "";
- break;
- case "1":
- this.reviewType = "7";
- break;
- case "2":
- this.reviewType = "4";
- break;
- case "3":
- this.reviewType = "3";
- break;
- }
- // if (reviewType) {
- // this.type = reviewType;
- // }
- });
- },
- // 查看按钮
- handleCheck(row) {
- this.edit_form = row;
- this.edit_visible = false;
- this.id = row.id;
- this.visible = true;
- // if (row.receiverId && row.receiverId.split(",").length > 1) {
- // this.menager_visible = true;
- // this.receiverList = row.receiverName
- // ? row.receiverId.split(",").map((el, index) => ({
- // label: row.receiverName.split(",")[index],
- // value: el,
- // }))
- // : [];
- // } else {
- // this.id = row.id;
- // this.visible = true;
- // }
- },
- confirmManger() {
- this.visible = true;
- this.edit_visible = false;
- this.menager_visible = false;
- },
- // 原下发管理的撤回
- handleDelete({ id }) {
- console.log(id, "id");
- this.$http({
- url: "/market/CMKIssued/CMKDelIssuedById",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- id,
- },
- }).then(() => {
- this.$message.success("撤回成功, 请重新创建模版");
- this.handleInit({
- ...this.table_search,
- page: this.page,
- pageSize: this.rows,
- });
- });
- },
- handleRemove({ id }) {
- console.log(id, "id");
- this.$http({
- url: "/market/CMKIssued/CMKRemoveIssuedById",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- id,
- },
- }).then(() => {
- this.$message.success("删除成功, 请重新创建模版");
- this.handleInit({
- ...this.table_search,
- page: this.page,
- pageSize: this.rows,
- });
- });
- },
- // dialog事件
- //权限管理事件
- handleApprove() {
- this.approve_visible = true;
- },
- handleTrack() {
- this.track_visible = true;
- },
- // 转派的增加或删除
- handleCharge(type) {
- switch (type) {
- case "add":
- if (
- this.transfer_form.charge[this.transfer_form.charge.length - 1]
- .rowNum.length
- ) {
- this.transfer_form.charge.push({
- person: "",
- allowEditingColumns: [],
- rowNum: [],
- });
- } else {
- this.$message.error("请先选择需要转派的列");
- }
- break;
- case "delete":
- this.transfer_form.charge.pop();
- break;
- }
- },
- // 三个change事件控制行列人员变动
- personChange(val) {
- console.log(val, this.transfer_list);
- this.transfer_list = this.transfer_list.filter((el) => el.value !== val);
- console.log(this.transfer_list, "this.transfer_list");
- },
- rowsChange(val) {
- console.log(val, "rowsChange");
- },
- colsChange(val) {
- console.log(val, "colsChange");
- },
- handleForbid() {
- const permission_type = this.permission_type;
- const { charge } = this.transfer_form;
- let flag = 1;
- console.log(permission_type, "permission_type");
- if (permission_type === 1) {
- // 公共权限 暂时不用可编辑行和列
- charge.forEach((el) => {
- if (el.person) {
- flag = flag * 1;
- } else {
- flag = flag * 0;
- }
- });
- } else if (permission_type === 2) {
- // 特殊权限
- console.log(permission_type, "permission_type");
- if (this.transfer_form.charge.length === 1) {
- charge.forEach((el) => {
- if (el.person) {
- flag = flag * 1;
- } else {
- flag = flag * 0;
- }
- });
- } else if (this.transfer_form.charge.length > 1) {
- if (
- this.transfer_form.charge[this.transfer_form.charge.length - 1]
- .rowNum.length
- ) {
- flag = flag * 1;
- } else {
- flag = flag * 0;
- }
- }
- }
- return flag;
- },
- // 转派的同意事件
- async transferConfirm() {
- this.$refs["transfer_form"].validate((valid) => {
- if (valid) {
- if (this.handleForbid()) {
- const { charge } = this.transfer_form;
- let params = {
- issuedId: this.edit_form.id,
- };
- if (this.permission_type === 1) {
- params.transferCommonAuthority = charge
- .map((el) => {
- el = el.person.split(",")[0];
- return el;
- })
- .join(",");
- } else if (this.permission_type === 2) {
- params.transferAuthority = charge.map((el) =>
- JSON.stringify({
- allowEditingColumns: this.transfer_cols_orgin.join(","),
- rowNum: el.rowNum.length
- ? el.rowNum
- .sort(function (a, b) {
- return a - b;
- })
- .join(",")
- : this.transfer_rows_orgin.join(","),
- principalId: el.person.split(",")[0],
- principalName: el.person.split(",")[1],
- })
- );
- }
- this.$http({
- url: "/market/CMKIssued/CMKIssuedTransfer",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: params,
- }).then(({ data: { desc } }) => {
- if (desc === "转派成功") {
- this.$message({
- type: "success",
- message: desc,
- });
- this.transfer_visible = false;
- this.handleInit({
- ...this.table_search,
- page: this.page,
- pageSize: this.rows,
- });
- this.transfer_form.charge = [
- {
- person: "",
- allowEditingColumns: [],
- rowNum: [],
- },
- ];
- this.handleCancel("visible");
- }
- });
- console.log(params, "this.transfer_form");
- } else {
- if (
- !this.transfer_form.charge[this.transfer_form.charge.length - 1]
- .rowNum.length
- ) {
- this.$message.error("请填写完整可编辑行");
- } else {
- this.$message.error("请填写必要的信息");
- }
- }
- }
- });
- },
- async handleTransfer() {
- let loginNoStr = JSON.parse(sessionStorage.userInfo).loginNoStr;
- let logNo = JSON.parse(sessionStorage.userInfo).loginNo;
- await this.$http({
- url: "/market/CMKIssued/queryUserList",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- logNo,
- },
- }).then(({ data }) => {
- this.transfer_list_orgin = data
- .filter((el) => {
- return el.loginNoStr !== loginNoStr;
- })
- .map((el) => ({
- ...el,
- label: `${el.loginNameStr}`,
- value: `${el.loginNoStr},${el.loginNameStr}`,
- }));
- this.transfer_list = this.transfer_list_orgin;
- // 可编辑行
- });
- await this.$http({
- url: "/market/CMKIssued/CMKIssuedRow",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- id: this.edit_form.id,
- },
- }).then(({ data: { column, row } }) => {
- this.transfer_cols_orgin = column.split(",");
- this.transfer_rows_orgin = row.split(",");
- });
- this.transfer_visible = true;
- },
- handleTurn(type) {
- if (this.approveForm.type) {
- if (this.approveForm.type === "3" && !this.approveForm.comments) {
- this.$message.error("请输入其他审批意见");
- return;
- }
- } else {
- this.$message.error("请选择审批意见");
- return;
- }
- // finish 结束 transfer 转派 back //打回 // agree 同意 // transfermanger 转总经理审批
- let request = 0;
- let reqdata = {
- id: this.edit_form.id,
- reviewOpinion:
- this.approveForm.type === "3"
- ? this.approveForm.comments
- : this.approveForm.type,
- };
- switch (type) {
- case "finish":
- // status 0.打回 3.结束
- reqdata.status = "3";
- reqdata.operateName = "结束";
- request = 1;
- break;
- case "transfer":
- // reviewType 2.副总经理 3总经理
- if (this.duty === "7") {
- reqdata.reviewType = 2;
- reqdata.operateName = "转副总审批";
- request = 1;
- } else if (this.duty === "4") {
- reqdata.reviewType = 3;
- request = 1;
- reqdata.operateName = "转总经理审批";
- }
- break;
- case "transfermanger":
- // transfermanger 这首直接转给总经理的流程
- reqdata.reviewType = 3;
- reqdata.operateName = "转总经理审批";
- request = 1;
- break;
- case "back":
- reqdata.status = "0";
- reqdata.reviewType = 1;
- request = 1;
- reqdata.operateName = "打回";
- break;
- case "return":
- reqdata.status = "0";
- reqdata.operateName = "退回";
- if (this.duty === "4") {
- reqdata.reviewType = 1;
- } else if (this.duty === "3") {
- reqdata.reviewType = 2;
- }
- console.log(reqdata, "reqdata");
- request = 1;
- break;
- case "agree":
- reqdata.operateName = "同意";
- reqdata.status = "3";
- request = 1;
- break;
- }
- if (request) {
- // 这里调接口
- this.$http({
- url: "/market/CMKIssued/CMKIssuedCheck",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: reqdata,
- }).then(({ data: { desc } }) => {
- if (desc === "审批成功") {
- this.$message({
- type: "success",
- message: desc,
- });
- // this.page = 1;
- this.handleCancel("visible");
- this.handleCancel("approve_visible");
- this.handleInit({
- ...this.table_search,
- page: this.page,
- pageSize: this.rows,
- });
- } else if (desc === "存在未提交,是否还要审核") {
- this.$confirm(desc, {
- distinguishCancelAndClose: false,
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then((res) => {
- this.$http({
- url: "/market/CMKIssued/CMKIssuedCheck",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: { ...reqdata, submitFlag: 1 },
- }).then(({ data: { desc } }) => {
- if (desc === "审批成功") {
- this.$message({
- type: "success",
- message: desc,
- });
- this.handleCancel("visible");
- this.handleCancel("approve_visible");
- this.handleInit({
- ...this.table_search,
- page: this.page,
- pageSize: this.rows,
- });
- } else {
- this.$message({
- type: "error",
- message: desc,
- });
- this.handleCancel("visible");
- this.handleCancel("approve_visible");
- this.handleInit({
- ...this.table_search,
- page: this.page,
- pageSize: this.rows,
- });
- }
- });
- })
- .catch((error) => {
- this.handleCancel("visible");
- this.handleCancel("approve_visible");
- this.handleInit({
- ...this.table_search,
- page: this.page,
- pageSize: this.rows,
- });
- });
- }
- });
- }
- },
- // 通用方法用于转化全局
- paramsArr(start, end) {
- const arr = [];
- console.log(start, end);
- for (let i = Number(start); i <= Number(end); i++) {
- arr.push(i);
- }
- return arr.join(",");
- },
- handleUrge() {
- console.log("这里是催办的方法");
- },
- handleConfirm(visible) {
- console.log(visible);
- this.track_visible = visible;
- },
- handleSave() {
- this.handleInit({
- ...this.table_search,
- page: this.page,
- pageSize: this.rows,
- });
- this.handleCancel("visible");
- },
- handleReceiver({ index, receiverId, id }) {
- // 回复详情
- this.$http({
- url: "/market/CMKIssued/replyDetails",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: { issuedId: id, receiverId: receiverId.split(",")[index] },
- }).then(({ data }) => {
- this.principal_visible = true;
- this.receiver_table_list = data;
- });
- },
- // 关闭方法
- handleCancel(data) {
- switch (data) {
- case "visible":
- this.visible = false;
- this.receiverId = "";
- break;
- case "approve_visible":
- this.approveForm.comments = "";
- this.approve_visible = false;
- break;
- case "track_visible":
- this.track_visible = false;
- break;
- case "transfer_visible":
- this.transfer_visible = false;
- break;
- case "principal_visible":
- this.principal_visible = false;
- break;
- case "menager_visible":
- this.menager_visible = false;
- break;
- }
- },
- },
- };
- </script>
- <style lang="scss" scope>
- .approve {
- .v-modal {
- display: none !important;
- }
- }
- .department-form {
- .el-form-item .el-input {
- width: 220px;
- }
- }
- </style>
|