| | |
| | | |
| | | lockBom: 10010, |
| | | lockOther: 10011, |
| | | lockSoftware: 10012 |
| | | lockSoftware: 10012, |
| | | // 反馈 |
| | | feedback: 10013 |
| | | } |
New file |
| | |
| | | <template> |
| | | <div class="textarea-wrapper"> |
| | | <a-textarea |
| | | class="m-textarea" |
| | | v-bind="$attrs" |
| | | v-model="$attrs.value" |
| | | @change="onChange" |
| | | /> |
| | | <span class="m-count" v-if="showWordLimit" |
| | | >{{ textLength |
| | | }}<template v-if="$attrs.maxLength" |
| | | >/{{ $attrs.maxLength }}</template |
| | | ></span |
| | | > |
| | | </div> |
| | | </template> |
| | | <script> |
| | | export default { |
| | | props: { |
| | | // 是否展示字数统计 |
| | | showWordLimit: { |
| | | type: Boolean, |
| | | default: false, |
| | | } |
| | | }, |
| | | // v-model处理 |
| | | model: { |
| | | prop: "value", |
| | | event: "change", |
| | | }, |
| | | computed: { |
| | | // 长度控制 |
| | | textLength() { |
| | | |
| | | return (this.$attrs.value || "").length; |
| | | }, |
| | | }, |
| | | methods: { |
| | | onChange(e) { |
| | | // v-model 回调函数 |
| | | this.$emit("change", e.target.value); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .textarea-wrapper { |
| | | position: relative; |
| | | display: block; |
| | | } |
| | | .m-textarea { |
| | | padding: 8px 12px; |
| | | height: 100%; |
| | | } |
| | | .m-count { |
| | | color: #808080; |
| | | background: #fff; |
| | | position: absolute; |
| | | font-size: 12px; |
| | | bottom: 8px; |
| | | right: 12px; |
| | | } |
| | | </style> |
| | |
| | | address: "武汉市", |
| | | avatar: null, |
| | | name: data.name, |
| | | id: data.id, |
| | | position:[] |
| | | }, |
| | | permissions:[ |
New file |
| | |
| | | <template> |
| | | <div class=""> |
| | | <a-row class="row" :gutter="gutter"> |
| | | <a-col :span="6" class="label">产品名称</a-col> |
| | | <a-col :span="18"> |
| | | <div class="content">{{ FkData.parentName }}</div> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row class="row" :gutter="gutter"> |
| | | <a-col :span="6" class="label">产品型号</a-col> |
| | | <a-col :span="18"> |
| | | <div class="content">{{ FkData.parentModel }}</div> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row class="row" :gutter="gutter"> |
| | | <a-col :span="6" class="label">定制单号</a-col> |
| | | <a-col :span="18"> |
| | | <div class="content">{{ FkData.customCode }}</div> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row class="row" :gutter="gutter"> |
| | | <a-col :span="6" class="label">版本时间</a-col> |
| | | <a-col :span="18"> |
| | | <div class="content">{{ FkData.versionTime }}</div> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row class="row" :gutter="gutter"> |
| | | <a-col :span="6" class="label">问题描述</a-col> |
| | | <a-col :span="18"> |
| | | <div class="content">{{ FkData.content }}</div> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row class="row" :gutter="gutter"> |
| | | <a-col :span="6" class="label">相关附件</a-col> |
| | | <a-col :span="18"> |
| | | <div class="content"> |
| | | <a-button v-if="FkData.file && viewable" class="btn" type="primary" @click="view">预览</a-button> |
| | | <a-button v-if="FkData.file" class="btn" @click="download">下载</a-button> |
| | | <span v-else>无</span> |
| | | </div> |
| | | </a-col> |
| | | </a-row> |
| | | <a-modal |
| | | :width="600" |
| | | :visible="previewVisible" |
| | | :footer="null" |
| | | @cancel="handleCancel" |
| | | > |
| | | <img alt="example" style="width: 100%" :src="imgUrl" /> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | | import { dwgReview } from "@/pages/workplace/apis"; |
| | | export default { |
| | | name: "", |
| | | props: { |
| | | FkData: { |
| | | type: Object, |
| | | default() { |
| | | return {}; |
| | | }, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | gutter: 16, |
| | | webUrl: getWebUrl(), |
| | | previewVisible: false, |
| | | imgUrl: '', |
| | | }; |
| | | }, |
| | | components: {}, |
| | | computed: { |
| | | fileType() { |
| | | let path = this.FkData.file; |
| | | return path ? this.getFileType(path) : undefined; |
| | | }, |
| | | viewable() { |
| | | return ["bmp", "jpg", "jpeg", "png", "pdf", "doc", "docx", "dwg"].some( |
| | | (v) => v == this.fileType |
| | | ); |
| | | }, |
| | | }, |
| | | methods: { |
| | | getFileType(path) { |
| | | let reg = /(.*\\+)*(.*)$/; |
| | | let fileName = path.match(reg)[2]; |
| | | let arr = fileName.split("."); |
| | | return arr.length ? arr[arr.length - 1].toLowerCase() : ""; |
| | | }, |
| | | view() { |
| | | let { |
| | | fileType, |
| | | FkData: { file }, |
| | | } = this; |
| | | switch (fileType) { |
| | | // 图片 |
| | | case "bmp": |
| | | case "jpg": |
| | | case "jpeg": |
| | | case "png": |
| | | this.imgUrl = this.webUrl + file; |
| | | this.previewVisible = true; |
| | | break; |
| | | case "pdf": |
| | | window.open(this.webUrl + file); |
| | | break; |
| | | case "doc": |
| | | case "docx": |
| | | case "dwg": |
| | | this.dwgReview(file); |
| | | break; |
| | | default: |
| | | this.$message.warn("该类型文件暂不支持预览"); |
| | | break; |
| | | } |
| | | }, |
| | | dwgReview(url) { |
| | | let loading = this.$layer.loading(); |
| | | dwgReview(url) |
| | | .then((res) => { |
| | | let { code, data, msg } = res.data; |
| | | if (code && data) { |
| | | window.open(this.webUrl + data); |
| | | } else { |
| | | this.$message.error(msg); |
| | | } |
| | | this.$layer.close(loading); |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | this.$layer.close(loading); |
| | | }); |
| | | }, |
| | | download() { |
| | | const url = this.webUrl + this.FkData.file; |
| | | let link = document.createElement("a"); |
| | | link.style.display = "none"; |
| | | link.href = url; |
| | | // link.download = fileName; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | }, |
| | | handleCancel() { |
| | | this.previewVisible = false; |
| | | }, |
| | | }, |
| | | |
| | | mounted() { |
| | | console.log("FkData", this.FkData); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .row { |
| | | margin-bottom: 12px; |
| | | } |
| | | .label { |
| | | // display: flex; |
| | | // justify-content: flex-end; |
| | | // align-items: center; |
| | | color: rgba(0, 0, 0, 0.85); |
| | | // padding-right: 0.4em; |
| | | height: 32px; |
| | | line-height: 32px; |
| | | text-align: right; |
| | | &::after { |
| | | content: ":"; |
| | | margin-left: 2px; |
| | | margin-right: 8px; |
| | | } |
| | | } |
| | | .btn + .btn { |
| | | margin-left: 16px; |
| | | } |
| | | .content { |
| | | line-height: 32px; |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class=""> |
| | | <!-- 表单 --> |
| | | <!-- 产品信息 --> |
| | | <a-form-model ref="formRef" :label-col="labelCol" :wrapper-col="wrapperCol"> |
| | | <!-- 产品名称 编号 版本 --> |
| | | <a-form-model-item label="产品名称:" prop="title"> |
| | | <a-select v-model="id" @change="prodChange"> |
| | | <a-select-option |
| | | v-for="(prod, idx) in prodList" |
| | | :key="'prod_' + idx" |
| | | :value="prod.id" |
| | | >{{ prod.label }}</a-select-option |
| | | > |
| | | </a-select> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="版本时间:" prop="versionTime"> |
| | | <a-input v-model="versionTime" disabled></a-input> |
| | | </a-form-model-item> |
| | | <!-- 指定人 --> |
| | | <a-form-model-item label="反馈给:" prop="title"> |
| | | <a-select |
| | | mode="multiple" |
| | | placeholder="请选择反馈接收人" |
| | | v-model="toUsers" |
| | | @change="handleChange" |
| | | > |
| | | <a-select-option |
| | | v-for="(user, idx) in userList" |
| | | :key="'user_' + idx" |
| | | :value="user.id + '&&' + user.name" |
| | | > |
| | | {{ user.name }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-model-item> |
| | | <!-- 附件 --> |
| | | <a-row type="flex" class="row"> |
| | | <a-col flex="13.4em" class="label">附件</a-col> |
| | | <a-col :flex="1"> |
| | | <a-upload |
| | | class="upload" |
| | | :before-upload="beforeUpload" |
| | | @change="uploadChange" |
| | | > |
| | | <a-button type="primary">选择文件</a-button> |
| | | </a-upload> |
| | | </a-col> |
| | | </a-row> |
| | | <!-- 问题描述 --> |
| | | <a-form-model-item label="问题描述:" prop="mailList"> |
| | | <yc-textarea |
| | | placeholder="请输入问题详情" |
| | | v-model="textDes" |
| | | show-word-limit |
| | | :maxLength="300" |
| | | :rows="6" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-form-model> |
| | | <div class="footer"> |
| | | <a-button class="btn" @click="cancel">取消</a-button> |
| | | <a-button class="btn" type="primary" @click="ok">提交</a-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import YcTextarea from "@/components/input/ycTextarea"; |
| | | import { getFkProduct } from "../product/apis"; |
| | | import { getUserByRoleIds } from "@/pages/user/apis"; |
| | | import { mapGetters } from "vuex"; |
| | | |
| | | export default { |
| | | name: "", |
| | | props: { |
| | | prodData: { |
| | | type: Object, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | files: null, |
| | | versionTime: "", |
| | | subVersion: "", |
| | | id: "", |
| | | prodList: [], |
| | | userList: [], |
| | | toUsers: [], |
| | | textDes: "", |
| | | receiverIds: "", |
| | | receiverNames: "", |
| | | labelCol: { span: 6 }, |
| | | wrapperCol: { span: 18 }, |
| | | }; |
| | | }, |
| | | components: { |
| | | YcTextarea, |
| | | }, |
| | | computed: { |
| | | ...mapGetters("account", ["user"]), |
| | | }, |
| | | methods: { |
| | | handleChange(value) { |
| | | // console.log(`Selected: ${value}`, value); |
| | | this.toUsers = value; |
| | | this.receiverIds = value.map((v) => v.split("&&")[0]).join(","); |
| | | this.receiverNames = value.map((v) => v.split("&&")[1]).join(","); |
| | | // console.log(this.receiverIds, this.receiverNames); |
| | | }, |
| | | beforeUpload() { |
| | | return false; |
| | | }, |
| | | uploadChange(data) { |
| | | const { file, fileList } = data; |
| | | if (fileList.length > 1) { |
| | | fileList.shift(); |
| | | } |
| | | if (fileList.length) { |
| | | this.files = fileList[0].originFileObj; |
| | | } else { |
| | | this.files = null; |
| | | } |
| | | }, |
| | | prodChange(id) { |
| | | // console.log(id); |
| | | let prod = this.prodList.filter((v) => v.id == id)[0]; |
| | | this.subVersion = prod.version; |
| | | this.versionTime = prod.versionTime; |
| | | this.parentCode = prod.parentCode; |
| | | }, |
| | | // 获取多个角色组的所有用户 |
| | | getUserByRoleIds() { |
| | | getUserByRoleIds("1002,1003") |
| | | .then((res) => { |
| | | let { code, data, data2 } = res.data; |
| | | let list = []; |
| | | if (code && data) { |
| | | // console.log(data2); |
| | | list = data2.filter((v) => v.name != this.user.name); |
| | | } |
| | | // console.log(list, "====list"); |
| | | this.userList = list; |
| | | }) |
| | | .catch((err) => { |
| | | console.error(err); |
| | | }); |
| | | }, |
| | | // 获取产品列表 |
| | | getProdList() { |
| | | getFkProduct() |
| | | .then((res) => { |
| | | let { code, data, data2 } = res.data; |
| | | let prodList = []; |
| | | if (code && data) { |
| | | prodList = data2.map((v) => { |
| | | let label = v.customCode |
| | | ? `${v.parentCode} ${v.parentName} (${v.customCode})` |
| | | : `${v.parentCode} ${v.parentName}`; |
| | | return { |
| | | ...v, |
| | | label, |
| | | }; |
| | | }); |
| | | } |
| | | this.prodList = prodList; |
| | | }) |
| | | .catch((err) => { |
| | | console.error(err); |
| | | }); |
| | | }, |
| | | ok() { |
| | | let { |
| | | textDes, |
| | | id: productId, |
| | | subVersion, |
| | | files, |
| | | receiverIds, |
| | | receiverNames, |
| | | user, |
| | | } = this; |
| | | if (!productId) { |
| | | this.$message.error('请选择要反馈的产品'); |
| | | return false; |
| | | } |
| | | if ('' == receiverIds) { |
| | | this.$message.error('请选择反馈接收人'); |
| | | return false; |
| | | } |
| | | let data = { |
| | | content: textDes, |
| | | multipartFile: files, |
| | | productId, |
| | | receiverIds, |
| | | receiverNames, |
| | | senderId: user.id, |
| | | subVersion, |
| | | }; |
| | | this.$emit("ok", data); |
| | | }, |
| | | cancel() { |
| | | this.$emit("cancel"); |
| | | }, |
| | | }, |
| | | |
| | | mounted() { |
| | | console.log("prod", this.prodData); |
| | | this.getProdList(); |
| | | this.getUserByRoleIds(); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .row { |
| | | margin-bottom: 24px; |
| | | } |
| | | .label { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | align-items: center; |
| | | color: rgba(0, 0, 0, 0.85); |
| | | // padding-right: 0.4em; |
| | | height: 32px; |
| | | &::after { |
| | | content: ":"; |
| | | margin-left: 2px; |
| | | margin-right: 8px; |
| | | } |
| | | } |
| | | .footer { |
| | | text-align: right; |
| | | .btn + .btn { |
| | | margin-left: 16px; |
| | | } |
| | | } |
| | | .upload { |
| | | display: flex; |
| | | /deep/.ant-upload-list { |
| | | flex: 1; |
| | | position: relative; |
| | | & > div { |
| | | position: absolute; |
| | | left: 0; |
| | | right: 0; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | url: "product/getLockedByProductId", |
| | | params: { productId } |
| | | }) |
| | | } |
| | | /** |
| | | * 查询当前使用的所有的产品 不分页 |
| | | * @returns |
| | | */ |
| | | export const getFkProduct = () => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "product/getFkProduct", |
| | | }) |
| | | } |
| | |
| | | onShowSizeChange: onSizeChange, |
| | | }" |
| | | > |
| | | <template slot="dataIndex" slot-scope="{index}"> |
| | | {{index+1}} |
| | | <template slot="dataIndex" slot-scope="{ index }"> |
| | | {{ index + 1 }} |
| | | </template> |
| | | <template slot="title"> |
| | | <a-space class="operator"> |
| | |
| | | :disabled="record.version == -1" |
| | | @click="showCustom(record)" |
| | | >定制</a-button |
| | | > |
| | | <a-button |
| | | type="primary" |
| | | v-if="canFeedback" |
| | | :disabled="record.version == -1" |
| | | @click="showFeedback(record)" |
| | | >反馈</a-button |
| | | > |
| | | </a-space> |
| | | <a>更多</a> |
| | |
| | | <a-table |
| | | ref="aTable" |
| | | size="small" |
| | | :scroll="{y: 700 }" |
| | | :scroll="{ y: 700 }" |
| | | bordered |
| | | :columns="abTbl.columns" |
| | | :data-source="abTbl.dataSource" |
| | | :pagination="false" |
| | | rowKey="subCode"></a-table> |
| | | <div style="text-align: right; padding: 8px;"> |
| | | <a-button @click="abTbl.ignore=true" :type="abState?'danger':'primary'" :icon="abState?'question':'check'">{{ abState?"未确认":"已确认" }}</a-button> |
| | | rowKey="subCode" |
| | | ></a-table> |
| | | <div style="text-align: right; padding: 8px"> |
| | | <a-button |
| | | @click="abTbl.ignore = true" |
| | | :type="abState ? 'danger' : 'primary'" |
| | | :icon="abState ? 'question' : 'check'" |
| | | >{{ abState ? "未确认" : "已确认" }}</a-button |
| | | > |
| | | </div> |
| | | </a-tab-pane> |
| | | <a-tab-pane key="4" :tab="errorLabel"> |
| | | <a-table |
| | | ref="aTable" |
| | | size="small" |
| | | :scroll="{y: 700 }" |
| | | :scroll="{ y: 700 }" |
| | | bordered |
| | | :columns="errorTbl.columns" |
| | | :data-source="errorTbl.dataSource" |
| | | :pagination="false" |
| | | rowKey="subCode"></a-table> |
| | | rowKey="subCode" |
| | | ></a-table> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <prod-upload |
| | |
| | | </template> |
| | | <!-- 其他附件中存在锁定文件 --> |
| | | <template v-if="otherLockList.length"> |
| | | <div class="table-title"> 其他附件中存在锁定文件</div> |
| | | <div class="table-title">其他附件中存在锁定文件</div> |
| | | <a-table |
| | | size="small" |
| | | :scroll="{ y: 150 }" |
| | |
| | | ></a-table> |
| | | </template> |
| | | </a-modal> |
| | | <a-modal |
| | | :visible="feedbackShow" |
| | | :width="800" |
| | | title="问题反馈" |
| | | :destroyOnClose="true" |
| | | @cancel="feedbackCancel" |
| | | @ok="feedbackOk" |
| | | > |
| | | <feedback-form :prod-data="customProd"></feedback-form> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import DrawUpload from "@/pages/components/drawUpload"; |
| | | |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | | import { addProduct, downloadBom, getAllProducts, getLogList, getLockedList } from "./apis"; |
| | | import { |
| | | addProduct, |
| | | downloadBom, |
| | | getAllProducts, |
| | | getLogList, |
| | | getLockedList, |
| | | } from "./apis"; |
| | | import { productSoftwareSubmit } from "../software/apis"; |
| | | import { zipParse } from "@/pages/workplace/myDraw/apis"; |
| | | import { mapGetters } from "vuex"; |
| | |
| | | |
| | | import createWs from "@/assets/js/websocket"; |
| | | import DiffList from "@/pages/components/diffList"; |
| | | import ApiTable from '../../../components/table/api/ApiTable.vue'; |
| | | import ApiTable from "../../../components/table/api/ApiTable.vue"; |
| | | import FeedbackForm from "../components/feedbackForm.vue"; |
| | | const WSMixin = createWs("product"); |
| | | |
| | | export default { |
| | |
| | | }, |
| | | ]; |
| | | return { |
| | | feedbackShow: false, |
| | | lockListVisible: false, |
| | | currentObj: null, |
| | | bomLockList: [], |
| | |
| | | title: "锁定说明", |
| | | dataIndex: "localReason", |
| | | align: "center", |
| | | } |
| | | }, |
| | | ], |
| | | otherLockColumns: [ |
| | | { |
| | |
| | | title: "锁定说明", |
| | | dataIndex: "localReason", |
| | | align: "center", |
| | | } |
| | | ] |
| | | }, |
| | | ], |
| | | }; |
| | | }, |
| | | components: { |
| | |
| | | ChangeParts, |
| | | ProdUpload, |
| | | DrawUpload, |
| | | DiffList |
| | | DiffList, |
| | | FeedbackForm, |
| | | }, |
| | | methods: { |
| | | onSearch(conditions, searchOptions) { |
| | |
| | | }, |
| | | checkLock(obj) { |
| | | getLockedList(obj.id).then((res) => { |
| | | const {code, data, data2, data3} = res.data; |
| | | const { code, data, data2, data3 } = res.data; |
| | | if (code) { |
| | | if (data) { |
| | | // 有锁定 |
| | |
| | | this.download(obj); |
| | | } |
| | | } else { |
| | | this.$message.error('查询锁定清单出错'); |
| | | this.$message.error("查询锁定清单出错"); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | this.prodUploadShow = false; |
| | | }, |
| | | submit(data) { |
| | | if(this.submitState.code) { |
| | | if (this.submitState.code) { |
| | | this.$layer.msg(this.submitState.msg); |
| | | return; |
| | | } |
| | |
| | | showCustom(obj) { |
| | | this.customProd = obj; |
| | | this.customShow = true; |
| | | }, |
| | | showFeedback(obj) { |
| | | this.customProd = obj; |
| | | this.feedbackShow = true; |
| | | }, |
| | | feedbackCancel() { |
| | | this.feedbackShow = false; |
| | | }, |
| | | feedbackOk() { |
| | | this.feedbackShow = false; |
| | | }, |
| | | custom(data) { |
| | | const { id, parentCode, parentModel, parentName } = this.customProd; |
| | |
| | | }))[0]; |
| | | formData.append("baseStr", JSON.stringify(prod)); |
| | | } |
| | | this.$nextTick(()=>{ |
| | | zipParse(formData).then((res) => { |
| | | this.$layer.close(loading); |
| | | let { code, data, data2, data3, msg } = res.data; |
| | | if (code && data) { |
| | | this.resList = data2; |
| | | let abAndErr = this.getAbAndError(data2.bomList); |
| | | this.abTbl.dataSource = abAndErr.ab; |
| | | this.errorTbl.dataSource = abAndErr.error; |
| | | this.$nextTick(() => { |
| | | zipParse(formData) |
| | | .then((res) => { |
| | | this.$layer.close(loading); |
| | | let { code, data, data2, data3, msg } = res.data; |
| | | if (code && data) { |
| | | this.resList = data2; |
| | | let abAndErr = this.getAbAndError(data2.bomList); |
| | | this.abTbl.dataSource = abAndErr.ab; |
| | | this.errorTbl.dataSource = abAndErr.error; |
| | | |
| | | this.diffData = { |
| | | addList: data3.addList, |
| | | delList: data3.deleteList.map((v) => v.materialObj), |
| | | updateList: data3.diffList, |
| | | }; |
| | | this.fileUrl = msg; |
| | | this.prodUploadShow = true; |
| | | this.$message.success("解析成功"); |
| | | } else { |
| | | this.$message.error(msg); |
| | | } |
| | | }).catch((error) => { |
| | | this.$layer.close(loading); |
| | | console.log(error); |
| | | }); |
| | | }) |
| | | this.diffData = { |
| | | addList: data3.addList, |
| | | delList: data3.deleteList.map((v) => v.materialObj), |
| | | updateList: data3.diffList, |
| | | }; |
| | | this.fileUrl = msg; |
| | | this.prodUploadShow = true; |
| | | this.$message.success("解析成功"); |
| | | } else { |
| | | this.$message.error(msg); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | this.$layer.close(loading); |
| | | console.log(error); |
| | | }); |
| | | }); |
| | | this.bomUploadShow = false; |
| | | }, |
| | | /** |
| | |
| | | * @returns {{ab: *[], error: *[]}} |
| | | */ |
| | | getAbAndError(list) { |
| | | let ab = ['0101', '0102', '0103', '0105', '0106']; |
| | | let error = ['0104']; |
| | | let ab = ["0101", "0102", "0103", "0105", "0106"]; |
| | | let error = ["0104"]; |
| | | let result = { |
| | | ab: [], |
| | | error: [] |
| | | error: [], |
| | | }; |
| | | for(let i=0; i<list.length; i++) { |
| | | for (let i = 0; i < list.length; i++) { |
| | | let item = list[i]; |
| | | let subCode = item.subCode.trim().slice(0,4); |
| | | let subCode = item.subCode.trim().slice(0, 4); |
| | | let dwgExist = item.dwgExist; |
| | | if(!dwgExist) { |
| | | if (!dwgExist) { |
| | | let isInAb = false; |
| | | for(let j=0; j<ab.length; j++) { |
| | | if(ab[j] == subCode) { |
| | | for (let j = 0; j < ab.length; j++) { |
| | | if (ab[j] == subCode) { |
| | | result.ab.push(item); |
| | | isInAb = true; |
| | | break; |
| | | } |
| | | } |
| | | // 是否已经存在ab中 |
| | | if(!isInAb) { |
| | | for(let j=0; j<error.length; j++) { |
| | | if(error[j] == subCode) { |
| | | if (!isInAb) { |
| | | for (let j = 0; j < error.length; j++) { |
| | | if (error[j] == subCode) { |
| | | result.error.push(item); |
| | | break; |
| | | } |
| | |
| | | }, |
| | | prodUploadShow(n) { |
| | | // 关闭弹出框清空数据并不能忽视异常数据 |
| | | if(!n) { |
| | | if (!n) { |
| | | this.errorTbl.dataSource = []; |
| | | this.abTbl.dataSource = []; |
| | | this.abTbl.ignore = false; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters("account", [ |
| | |
| | | canDownloadBom() { |
| | | return checkPermit(PERMITS.downloadBom, this.permits); |
| | | }, |
| | | canFeedback() { |
| | | return checkPermit(PERMITS.feedback, this.permits); |
| | | }, |
| | | abLabel() { |
| | | let num = this.abTbl.dataSource.length; |
| | | num = num>99?'99+':num; |
| | | return "异常("+num+")"; |
| | | num = num > 99 ? "99+" : num; |
| | | return "异常(" + num + ")"; |
| | | }, |
| | | errorLabel() { |
| | | let num = this.errorTbl.dataSource.length; |
| | | num = num>99?'99+':num; |
| | | return "错误("+num+")"; |
| | | num = num > 99 ? "99+" : num; |
| | | return "错误(" + num + ")"; |
| | | }, |
| | | abState() { |
| | | let result = false; |
| | | if(this.abTbl.dataSource.length != 0) { |
| | | if(this.abTbl.ignore) { |
| | | if (this.abTbl.dataSource.length != 0) { |
| | | if (this.abTbl.ignore) { |
| | | result = false; |
| | | }else { |
| | | } else { |
| | | result = true; |
| | | } |
| | | }else { |
| | | } else { |
| | | result = false; |
| | | } |
| | | |
| | |
| | | submitState() { |
| | | let result = { |
| | | code: 0, |
| | | msg: "存在异常或错误的数据,请修复后再提交" |
| | | msg: "存在异常或错误的数据,请修复后再提交", |
| | | }; |
| | | if(this.abState) { |
| | | if (this.abState) { |
| | | result.code = 1; |
| | | }else { |
| | | } else { |
| | | result.code = 0; |
| | | } |
| | | |
| | | if(this.errorTbl.dataSource.length !=0) { |
| | | if (this.errorTbl.dataSource.length != 0) { |
| | | result.code = 1; |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.getUserByRoleId(); |
| | |
| | | return axios({ |
| | | method: "GET", |
| | | url: "docFace/deleteFace", |
| | | params: {faceId} |
| | | params: { faceId } |
| | | }) |
| | | } |
| | | /** |
| | | * 修改用户密码 |
| | | * @returns |
| | | */ |
| | | export const changePwd = (oldSnId, newSnId) => { |
| | | export const changePwd = (oldSnId, newSnId) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "docUser/changeSnId", |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 根据用户角色的id (多个)查询所有的用户 |
| | | * @param roleIds 角色id 为多个时 以逗号分隔 |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const getUserByRoleIds = (roleIds) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "docUser/getUserByRoleIds", |
| | | params: { |
| | | roleIds |
| | | } |
| | | }) |
| | | } |
| | |
| | | <template> |
| | | <div class="work-place"> |
| | | <a-row :gutter="18" class="work-place-top"> |
| | | <a-col :span="item.span" v-for="(item, key) in totals" :key="'key'+key"> |
| | | <total-card :info="item" :type="item.type" :title="item.title" :num="item.value" @click="changeTotalCard"></total-card> |
| | | <a-col :span="item.span" v-for="(item, key) in totals" :key="'key' + key"> |
| | | <total-card |
| | | :info="item" |
| | | :type="item.type" |
| | | :title="item.title" |
| | | :num="item.value" |
| | | @click="changeTotalCard" |
| | | ></total-card> |
| | | </a-col> |
| | | </a-row> |
| | | <div style="margin-top: 8px"> |
| | | <my-draw :is-show="'my'==cardName" :y="y" @resize="resize"></my-draw> |
| | | <not-approved :is-show="'approving'==cardName" :y="y" @resize="resize"></not-approved> |
| | | <rejected-list :is-show="'rejected'==cardName" :y="y" @resize="resize"></rejected-list> |
| | | <approved-list :is-show="'approved'==cardName" :y="y" @resize="resize"></approved-list> |
| | | <handling-list :is-show="'handling'==cardName" :y="y" @resize="resize"></handling-list> |
| | | <handled-list :is-show="'handled'==cardName" :y="y" @resize="resize"></handled-list> |
| | | <my-draw :is-show="'my' == cardName" :y="y" @resize="resize"></my-draw> |
| | | <not-approved |
| | | :is-show="'approving' == cardName" |
| | | :y="y" |
| | | @resize="resize" |
| | | ></not-approved> |
| | | <rejected-list |
| | | :is-show="'rejected' == cardName" |
| | | :y="y" |
| | | @resize="resize" |
| | | ></rejected-list> |
| | | <approved-list |
| | | :is-show="'approved' == cardName" |
| | | :y="y" |
| | | @resize="resize" |
| | | ></approved-list> |
| | | <handling-list |
| | | :is-show="'handling' == cardName" |
| | | :y="y" |
| | | @resize="resize" |
| | | ></handling-list> |
| | | <handled-list |
| | | :is-show="'handled' == cardName" |
| | | :y="y" |
| | | @resize="resize" |
| | | ></handled-list> |
| | | <feedback-list |
| | | :is-show="'sendFk' == cardName ||'recevierFk' == cardName" |
| | | :type="cardName" |
| | | :y="y" |
| | | @resize="resize" |
| | | ></feedback-list> |
| | | <!-- v-if="'sendFk' == cardName" |
| | | v-if="'recevierFk' == cardName" --> |
| | | <!-- <feedback-list |
| | | :is-show="'recevierFk' == cardName" |
| | | :type="cardName" |
| | | :y="y" |
| | | @resize="resize" |
| | | ></feedback-list> --> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import RejectedList from "@/pages/workplace/rejectedList/RejectedList"; |
| | | import ApprovedList from "@/pages/workplace/approvedList/ApprovedList"; |
| | | import const_total from "./const_total"; |
| | | import {mapGetters, mapState} from "vuex"; |
| | | import { mapGetters, mapState } from "vuex"; |
| | | import getItemByKey from "@/assets/js/tools/getItemByKey"; |
| | | import {statusStatistic} from "@/pages/workplace/apis"; |
| | | import { statusStatistic } from "@/pages/workplace/apis"; |
| | | import HandlingList from "@/pages/workplace/handlingList/HandlingList"; |
| | | import HandledList from "@/pages/workplace/handledList/HandledList"; |
| | | import FeedbackList from "@/pages/workplace/feedbackList/feedbackList"; |
| | | import createWs from "@/assets/js/websocket"; |
| | | const WSMixin = createWs("worksheet"); |
| | | |
| | | export default { |
| | | name: 'WorkPlace', |
| | | name: "WorkPlace", |
| | | components: { |
| | | HandledList, |
| | | HandlingList, |
| | |
| | | RejectedList, |
| | | NotApproved, |
| | | MyDraw, |
| | | TotalCard |
| | | TotalCard, |
| | | FeedbackList, |
| | | }, |
| | | mixins: [WSMixin], |
| | | data() { |
| | |
| | | cardName: "my", |
| | | totals: const_total.normal, |
| | | radio: 0, |
| | | } |
| | | }; |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | | if (-1 != n && !this._inactive) { |
| | | const bar = document.querySelectorAll(".header-bar")[0].clientHeight; |
| | | const workPlaceTop = document.querySelectorAll(".work-place-top")[0].clientHeight; |
| | | this.y = this.minHeight-bar-workPlaceTop-56; |
| | | const workPlaceTop = |
| | | document.querySelectorAll(".work-place-top")[0].clientHeight; |
| | | this.y = this.minHeight - bar - workPlaceTop - 56; |
| | | } |
| | | }, |
| | | affixed() { |
| | |
| | | }, |
| | | minHeight() { |
| | | this.resize(); |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | resize() { |
| | |
| | | onWSMessage(res) { |
| | | let rs = JSON.parse(res.data); |
| | | let data = rs.data; |
| | | this.totals.map(item=>{ |
| | | this.totals.map((item) => { |
| | | let name = item.name; |
| | | item.value = data[name]?data[name]:0; |
| | | item.value = data[name] ? data[name] : 0; |
| | | }); |
| | | }, |
| | | changeTotalCard(info) { |
| | | this.cardName = info.name; |
| | | console.log(info.name, "nam"); |
| | | this.cardName = ""; |
| | | this.$nextTick(() => { |
| | | this.cardName = info.name; |
| | | }); |
| | | }, |
| | | /** |
| | | * 根据用户角色,变更统计的面板的样式 |
| | |
| | | this.changeTotal(this.radio); |
| | | }, |
| | | statusStatistic() { |
| | | statusStatistic().then(res=>{ |
| | | let rs = res.data; |
| | | if(rs.code == 1) { |
| | | let data = rs.data; |
| | | this.totals.map(item=>{ |
| | | let name = item.name; |
| | | item.value = data[name]?data[name]:0; |
| | | }); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }); |
| | | statusStatistic() |
| | | .then((res) => { |
| | | let rs = res.data; |
| | | if (rs.code == 1) { |
| | | let data = rs.data; |
| | | this.totals.map((item) => { |
| | | let name = item.name; |
| | | item.value = data[name] ? data[name] : 0; |
| | | }); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | activeFN() { |
| | | this.resize(); |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters('account', ['roles', "roleList", "departmentList"]), |
| | | ...mapGetters("account", ["roles", "roleList", "departmentList"]), |
| | | ...mapGetters("setting", ["affixed", "minHeight"]), |
| | | }, |
| | | mounted() { |
| | | let role = getItemByKey(this.roles[0].id, this.roleList); |
| | | this.changeTotal(role.value); |
| | | } |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | * @param data 传参 |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const uploadDraw = (data)=>{ |
| | | export const uploadDraw = (data) => { |
| | | return axios({ |
| | | method: "POST", |
| | | url: "worksheetMain/submit", |
| | |
| | | * @param pageSize 每页的数据量 |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const myListPage = (pageNum, pageSize)=>{ |
| | | export const myListPage = (pageNum, pageSize) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "worksheetMain/myListPage", |
| | |
| | | * @param data 传参 |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const approve = (data)=>{ |
| | | export const approve = (data) => { |
| | | return axios({ |
| | | method: "POST", |
| | | url: "worksheetLink/approve", |
| | |
| | | * @param data 传参 |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const audit = (data)=>{ |
| | | export const audit = (data) => { |
| | | return axios({ |
| | | method: "POST", |
| | | url: "worksheetLink/audit", |
| | |
| | | * @param dwgUrl |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const dwgReview = (dwgUrl)=>{ |
| | | export const dwgReview = (dwgUrl) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "bomApproving/dwgReview", |
| | |
| | | * 获取工作流-各角色用户对应的工作台数据分类统计 |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const statusStatistic = ()=>{ |
| | | export const statusStatistic = () => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "worksheetMain/statusStatistic", |
| | |
| | | * 查看分页-已审批 |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const approvedListPage = (pageNum, pageSize)=>{ |
| | | export const approvedListPage = (pageNum, pageSize) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "worksheetMain/approvedListPage", |
| | |
| | | * @param pageSize 每页的数据量 |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const approvingListPage = (pageNum, pageSize)=>{ |
| | | export const approvingListPage = (pageNum, pageSize) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "worksheetMain/approvingListPage", |
| | |
| | | * @param pageSize 每页的数据量 |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const handledListPage = (pageNum, pageSize)=>{ |
| | | export const handledListPage = (pageNum, pageSize) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "worksheetMain/handledListPage", |
| | |
| | | * @param pageSize 每页的数据量 |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const handlingListPage = (pageNum, pageSize)=>{ |
| | | export const handlingListPage = (pageNum, pageSize) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "worksheetMain/handlingListPage", |
| | |
| | | * 查看分页-已驳回 |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const rejectedListPage = (pageNum, pageSize)=>{ |
| | | export const rejectedListPage = (pageNum, pageSize) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "worksheetMain/rejectedListPage", |
| | |
| | | * @param id 工作流id |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const linkInfo = (id)=>{ |
| | | export const linkInfo = (id) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "worksheetMain/linkInfo", |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 普通用户 取反馈列表 分页 |
| | | * @param flag 0未处理 1已完成 |
| | | * pageCurr |
| | | * pageSize |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const getSenderStatus = (flag, pageCurr, pageSize) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "bomFeedbak/getSenderStatus", |
| | | params: { |
| | | flag, pageCurr, pageSize |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 管理者 获取反馈列表 分页 |
| | | * @param flag 0未处理 1已完成 |
| | | * pageCurr |
| | | * pageSize |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const getRecevierStatus = (flag, pageCurr, pageSize) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "bomFeedbak/getRecevierStatus", |
| | | params: { |
| | | flag, pageCurr, pageSize |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 接收者确认反馈 |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const confirmFk = (id) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "bomFeedbak/setconfirmFk", |
| | | params: { |
| | | id |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * 提交反馈 |
| | | * data : {"confirmStatus": 0, |
| | | "confirmUserName": "", |
| | | "content": "", |
| | | "createTime": "", |
| | | "customCode": "", |
| | | "file": "", |
| | | "id": 0, |
| | | "multipartFile": "", |
| | | "parentCode": "", |
| | | "parentModel": "", |
| | | "parentName": "", |
| | | "productId": 0, |
| | | "receiverIds": "", |
| | | "receiverNames": "", |
| | | "senderId": 0, |
| | | "senderName": "", |
| | | "subVersion": 0, |
| | | "versionTime": ""} |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const submitFeedback = (data) => { |
| | | return axios({ |
| | | method: "POST", |
| | | url: "bomFeedbak/submitFeedback", |
| | | headers: { |
| | | "Content-Type": "multipart/form-data" |
| | | }, |
| | | data |
| | | }); |
| | | } |
| | |
| | | name: "my", |
| | | title: "我的工单", |
| | | type: "my", |
| | | span: 6, |
| | | span: 5, |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: "approving", |
| | | title: "审批中", |
| | | type: "warning", |
| | | span: 6, |
| | | span: 5, |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: "rejected", |
| | | title: "已驳回", |
| | | type: "danger", |
| | | span: 6, |
| | | span: 5, |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: "approved", |
| | | title: "已审批", |
| | | type: "success", |
| | | span: 6, |
| | | span: 5, |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: "sendFk", |
| | | title: "我的反馈", |
| | | type: "feedback", |
| | | span: 4, |
| | | value: 0 |
| | | }, |
| | | ], |
| | |
| | | name: "my", |
| | | title: "我的工单", |
| | | type: "my", |
| | | span: 4, |
| | | span: 3, |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: "handling", |
| | | title: "待处理", |
| | | type: "primary", |
| | | span: 4, |
| | | span: 3, |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: "handled", |
| | | title: "已处理", |
| | | type: "success", |
| | | span: 4, |
| | | span: 3, |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: "approving", |
| | | title: "审批中", |
| | | type: "warning", |
| | | span: 4, |
| | | span: 3, |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: "rejected", |
| | | title: "已驳回", |
| | | type: "danger", |
| | | span: 4, |
| | | span: 3, |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: "approved", |
| | | title: "已审批", |
| | | type: "success", |
| | | span: 4, |
| | | span: 3, |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: "recevierFk", |
| | | title: "待处理反馈", |
| | | type: "danger", |
| | | span: 3, |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: "sendFk", |
| | | title: "我的反馈", |
| | | type: "my", |
| | | span: 3, |
| | | value: 0 |
| | | }, |
| | | ], |
New file |
| | |
| | | <template> |
| | | <page-toggle-transition |
| | | v-if="isShow" |
| | | :disabled="animate.disabled" |
| | | :animate="animate.name" |
| | | :direction="animate.direction" |
| | | > |
| | | <div class="page-content"> |
| | | <advance-table |
| | | :data-source="dataSource" |
| | | :columns="columns" |
| | | :loading="loading" |
| | | row-key="id" |
| | | :scroll="{ x: '100%', y }" |
| | | @search="onSearch" |
| | | @refresh="onRefresh" |
| | | @reset="onReset" |
| | | :format-conditions="true" |
| | | :pagination="{ |
| | | current: page, |
| | | pageSize: pageSize, |
| | | total: total, |
| | | showSizeChanger: true, |
| | | showLessItems: true, |
| | | showQuickJumper: true, |
| | | showTotal: (total, range) => |
| | | `第 ${range[0]}-${range[1]} 条,总计 ${total} 条`, |
| | | onChange: onPageChange, |
| | | onShowSizeChange: onSizeChange, |
| | | }" |
| | | > |
| | | <template slot="title"> |
| | | <div class="title">问题反馈</div> |
| | | <a-radio-group |
| | | v-model="flag" |
| | | @change="flagChange" |
| | | button-style="solid" |
| | | > |
| | | <a-radio-button :value="0">未处理</a-radio-button> |
| | | <a-radio-button :value="1">已确认</a-radio-button> |
| | | </a-radio-group> |
| | | <a-button |
| | | class="ml-20" |
| | | type="primary" |
| | | icon="plus" |
| | | @click="showFeedback" |
| | | >反馈问题</a-button |
| | | > |
| | | </template> |
| | | <template slot="action" slot-scope="{ record }"> |
| | | <!-- <a-popconfirm |
| | | title="是否确认该问题" |
| | | v-if="0 == record.confirmStatus && isReceiver" |
| | | @confirm="confirmFk(record)" |
| | | > |
| | | <a href="#">确认</a> |
| | | </a-popconfirm> --> |
| | | <a href="#" @click="showDetails(record)">详情</a> |
| | | <template v-if="0 == record.confirmStatus && isReceiver"> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a href="#" @click="showConfirm(record)">确认</a> |
| | | </template> |
| | | </template> |
| | | </advance-table> |
| | | </div> |
| | | <a-modal |
| | | :visible="feedBackVisible" |
| | | :width="800" |
| | | title="问题反馈" |
| | | :destroyOnClose="true" |
| | | :footer="false" |
| | | @cancel="feedbackCancel" |
| | | > |
| | | <feedback-form @cancel="feedbackCancel" @ok="feedbackOk"></feedback-form> |
| | | </a-modal> |
| | | <a-modal |
| | | :visible="detailsVisible" |
| | | :width="800" |
| | | title="问题反馈详情" |
| | | :destroyOnClose="true" |
| | | :footer="false" |
| | | @cancel="detailsCancel" |
| | | > |
| | | <feedback-details |
| | | :fk-data="currFk" |
| | | @cancel="detailsCancel" |
| | | @ok="detailsOk" |
| | | ></feedback-details> |
| | | <div class="footer"> |
| | | <a-button class="btn" @click="detailsCancel">关闭</a-button> |
| | | <a-button class="btn" v-if="isConfirm" @click="confirmFk" type="primary" |
| | | >确认</a-button |
| | | > |
| | | </div> |
| | | </a-modal> |
| | | </page-toggle-transition> |
| | | </template> |
| | | |
| | | <script> |
| | | import PageToggleTransition from "@/components/transition/PageToggleTransition"; |
| | | import AdvanceTable from "@/components/table/advance/AdvanceTable"; |
| | | import { mapState } from "vuex"; |
| | | import { |
| | | getSenderStatus, |
| | | getRecevierStatus, |
| | | confirmFk, |
| | | submitFeedback, |
| | | linkInfo, |
| | | } from "@/pages/workplace/apis"; |
| | | import DrawUpload from "@/pages/components/drawUpload/DrawUpload"; |
| | | import AuditForm from "@/pages/workplace/workForm/auditForm"; |
| | | import const_job_types from "@/assets/js/const/const_job_types"; |
| | | import getItemByKey from "@/assets/js/tools/getItemByKey"; |
| | | import ReplaceInfo from "../replaceInfo"; |
| | | import MaterialInfo from "../materialInfo"; |
| | | import FeedbackForm from "@/pages/resourceManage/components/feedbackForm.vue"; |
| | | import FeedbackDetails from "../../resourceManage/components/feedbackDetails.vue"; |
| | | const columns = [ |
| | | { |
| | | title: "产品名称", |
| | | dataIndex: "parentName", |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "产品型号", |
| | | dataIndex: "parentModel", |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "定制单号", |
| | | dataIndex: "customCode", |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "版本时间", |
| | | dataIndex: "versionTime", |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "创建人", |
| | | dataIndex: "senderName", |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "创建时间", |
| | | dataIndex: "createTime", |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "反馈接收人", |
| | | dataIndex: "receiverNames", |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "确认人", |
| | | dataIndex: "confirmUserName", |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "操作", |
| | | dataIndex: "operation", |
| | | key: "operation", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 120, |
| | | scopedSlots: { customRender: "action" }, |
| | | }, |
| | | ]; |
| | | export default { |
| | | components: { |
| | | DrawUpload, |
| | | PageToggleTransition, |
| | | AdvanceTable, |
| | | AuditForm, |
| | | ReplaceInfo, |
| | | MaterialInfo, |
| | | FeedbackForm, |
| | | FeedbackDetails, |
| | | }, |
| | | props: { |
| | | isShow: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | y: { |
| | | type: Number, |
| | | default: 400, |
| | | }, |
| | | type: { |
| | | type: String, |
| | | }, |
| | | }, |
| | | watch: { |
| | | isShow(n) { |
| | | if (n) { |
| | | this.searchData(); |
| | | } |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | isConfirm: false, |
| | | currFk: null, |
| | | detailsVisible: false, |
| | | feedBackVisible: false, |
| | | flag: 0, |
| | | loading: false, |
| | | workDetailVisible: false, |
| | | auditFormVisible: false, |
| | | page: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | conditions: {}, |
| | | dataSource: [], |
| | | title: "", |
| | | subList: [], |
| | | columns: columns.map((v) => v), |
| | | formData: { |
| | | id: 0, // 连接id |
| | | mainId: 0, // 主id |
| | | linkStatus: 1, // 审批状态 1:通过,2:驳回 |
| | | dealReason: "", // 审核建议 |
| | | nextUser: 0, // 下一个审核的用户id |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | | onSearch(conditions, searchOptions) { |
| | | this.page = 1; |
| | | this.conditions = conditions; |
| | | this.searchData(); |
| | | }, |
| | | onPageChange(page, pageSize) { |
| | | this.page = page; |
| | | this.pageSize = pageSize; |
| | | this.searchData(); |
| | | }, |
| | | onSizeChange(current, size) { |
| | | this.page = 1; |
| | | this.pageSize = size; |
| | | this.searchData(); |
| | | }, |
| | | onRefresh(conditions) { |
| | | this.conditions = conditions; |
| | | this.searchData(); |
| | | }, |
| | | onReset(conditions) { |
| | | this.conditions = conditions; |
| | | this.searchData(); |
| | | }, |
| | | searchData() { |
| | | let getList = this.isReceiver ? getRecevierStatus : getSenderStatus; |
| | | getList(this.flag, this.page, this.pageSize).then((res) => { |
| | | let { code, data, data2 } = res.data; |
| | | let total = 0, |
| | | list = []; |
| | | if (code && data) { |
| | | total = data2.total; |
| | | list = data2.list; |
| | | } |
| | | this.total = total; |
| | | this.dataSource = list; |
| | | this.$emit("resize"); |
| | | }); |
| | | }, |
| | | showFeedback() { |
| | | this.feedBackVisible = true; |
| | | }, |
| | | feedbackCancel() { |
| | | this.feedBackVisible = false; |
| | | }, |
| | | feedbackOk(data) { |
| | | console.log(data, ";xxxs"); |
| | | let { |
| | | content, |
| | | multipartFile, |
| | | productId, |
| | | receiverIds, |
| | | receiverNames, |
| | | senderId, |
| | | subVersion, |
| | | } = data; |
| | | const formData = new FormData(); |
| | | formData.append("multipartFile", multipartFile); |
| | | formData.append( |
| | | "feedbackJson", |
| | | JSON.stringify({ |
| | | content, |
| | | productId, |
| | | receiverIds, |
| | | receiverNames, |
| | | senderId, |
| | | subVersion, |
| | | }) |
| | | ); |
| | | submitFeedback(formData).then((res) => { |
| | | let { code, data } = res.data; |
| | | if (code && data) { |
| | | this.$message.success("反馈成功"); |
| | | this.feedBackVisible = false; |
| | | this.flag = 0; |
| | | this.page = 1; |
| | | this.searchData(); |
| | | } else { |
| | | this.$message.error("反馈失败"); |
| | | } |
| | | }); |
| | | }, |
| | | flagChange() { |
| | | this.page = 1; |
| | | this.searchData(); |
| | | }, |
| | | confirmFk() { |
| | | let id = this.currFk.id; |
| | | confirmFk(id).then((res) => { |
| | | let { code, data, msg } = res.data; |
| | | if (code && data) { |
| | | this.$message.success("确认成功"); |
| | | this.detailsVisible = false; |
| | | this.flagChange(); |
| | | } else { |
| | | this.$message.warning(msg); |
| | | } |
| | | }); |
| | | }, |
| | | showDetails(obj) { |
| | | this.currFk = obj; |
| | | this.isConfirm = false; |
| | | this.detailsVisible = true; |
| | | }, |
| | | showConfirm(obj) { |
| | | this.currFk = obj; |
| | | this.isConfirm = true; |
| | | this.detailsVisible = true; |
| | | }, |
| | | detailsCancel() { |
| | | this.detailsVisible = false; |
| | | }, |
| | | detailsOk() { |
| | | this.detailsVisible = false; |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapState("setting", ["animate"]), |
| | | workDetailTitle() { |
| | | return this.title; |
| | | }, |
| | | isReceiver() { |
| | | return this.type == "recevierFk"; |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.searchData(); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .title { |
| | | display: inline-block; |
| | | margin-right: 20px; |
| | | } |
| | | .ml-20 { |
| | | margin-left: 20px; |
| | | } |
| | | .footer { |
| | | text-align: right; |
| | | .btn + .btn { |
| | | margin-left: 20px; |
| | | } |
| | | } |
| | | </style> |