|
@@ -0,0 +1,840 @@
|
|
|
+<template>
|
|
|
+ <!-- 采购审核 -->
|
|
|
+ <div class="content-container">
|
|
|
+ <div class="top">
|
|
|
+ <el-form
|
|
|
+ ref="form"
|
|
|
+ :inline="true"
|
|
|
+ :model="form"
|
|
|
+ label-width="auto"
|
|
|
+ style="float: left"
|
|
|
+ >
|
|
|
+ <el-form-item label="关键字:">
|
|
|
+ <el-input
|
|
|
+ v-model="form.content"
|
|
|
+ size="small"
|
|
|
+ placeholder="请输入采购单号、采购名称"
|
|
|
+ style="width: 220px"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="供应商:">
|
|
|
+ <el-select
|
|
|
+ v-model="form.supplierId"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ collapse-tags
|
|
|
+ placeholder="请选择供应商"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in suppliers"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.factoryName"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="申购部门:">
|
|
|
+ <el-select
|
|
|
+ v-model="form.registerDept"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ collapse-tags
|
|
|
+ placeholder="请选择供应商"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in allDept"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="申购时间:">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.purchaseTime"
|
|
|
+ type="daterange"
|
|
|
+ align="right"
|
|
|
+ value-format="yyyy-MM-DD"
|
|
|
+ unlink-panels
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :picker-options="pickerOptions"
|
|
|
+ size="small"
|
|
|
+ style="width: 240px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="工单状态:">
|
|
|
+ <el-select
|
|
|
+ v-model="form.orderState"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ collapse-tags
|
|
|
+ placeholder="请选择供应商"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in orderStates"
|
|
|
+ :key="item.key"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.key"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-search"
|
|
|
+ size="small"
|
|
|
+ @click="queryProcess"
|
|
|
+ style="margin-top: 4px;"
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div class="table-div">
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ style="width: 100%"
|
|
|
+ :style="{ width: '100%' }"
|
|
|
+ height="100%"
|
|
|
+ border
|
|
|
+ :header-cell-style="{
|
|
|
+ background: 'rgba(250,250,250)',
|
|
|
+ color: 'rgb(50,59,65)',
|
|
|
+ height: '39px',
|
|
|
+ textAlign: 'center',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <template slot="empty">
|
|
|
+ <img src="@/assets/icon/null.png" alt="" />
|
|
|
+ <p class="empty-p">暂无数据</p>
|
|
|
+ </template>
|
|
|
+ <el-table-column label="序号" align="center" width="60px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.$index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="processNumber"
|
|
|
+ label="采购单号"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="采购单名称"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column prop="processState" label="工单状态" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ getOrderStateNameById(row.processState) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="processNodeName" label="当前步骤" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{row.processNodeName + "(" + row.processNode + '/' + row.sumNode + ')'}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="handleDeptName" label="当前处理部门" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ (row.handleDeptName == null || row.handleDeptName == "") ? '/' : row.handleDeptName }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="handleStaffName" label="当前处理人" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ (row.handleStaffName == null || row.handleStaffName == "") ? '/' : row.handleStaffName }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="urgeNumber" label="催办消息" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-popover
|
|
|
+ v-if="row.urgeNumber > 0"
|
|
|
+ placement="bottom"
|
|
|
+ title=""
|
|
|
+ width="280"
|
|
|
+ trigger="hover"
|
|
|
+ :content="row.urgeInfo"
|
|
|
+ >
|
|
|
+ <p v-for="(urge,ind) in row.urgeInfo" :key="ind">{{ urge }}</p>
|
|
|
+ <span slot="reference">{{ row.urgeNumber }}</span>
|
|
|
+ </el-popover>
|
|
|
+ <span v-else>{{ row.urgeNumber }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="registerDept" label="申购部门" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ getDeptName(row.registerDept) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="registerStaff" label="申购人" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ getUserName(row.registerDept,row.registerStaff) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="registerTime"
|
|
|
+ label="申购时间"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="supplier"
|
|
|
+ label="供应商"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="totalPrice"
|
|
|
+ label="采购价格合计(元)"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="remark"
|
|
|
+ label="备注"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column prop="prop" label="操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="queryOrderProcessById(scope.row,false)" icon="el-icon-tickets" title="查看" type="text" size="small" style="font-size:16px;"></el-button>
|
|
|
+ <el-button @click="queryOrderProcessById(scope.row,true)" icon="el-icon-edit-outline" title="处理" type="text" size="small" style="font-size:16px;"></el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <el-pagination
|
|
|
+ :current-page="pagination.current"
|
|
|
+ :page-sizes="[20, 30, 50, 100, 200]"
|
|
|
+ :page-size="pagination.size"
|
|
|
+ :total="pagination.total"
|
|
|
+ @size-change="queryProcess"
|
|
|
+ @current-change="queryProcess"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ />
|
|
|
+ <!-- 详情 -->
|
|
|
+ <el-dialog
|
|
|
+ class="tf-dialog"
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="dialogFormVisible"
|
|
|
+ width="1200px"
|
|
|
+ top="60px"
|
|
|
+ style="padding: 10px"
|
|
|
+ >
|
|
|
+ <process-order
|
|
|
+ v-if="dialogFormVisible"
|
|
|
+ ref="merge"
|
|
|
+ :orderName="orderName"
|
|
|
+ :orderCode="orderCode"
|
|
|
+ :businessType="businessType"
|
|
|
+ :proId="processId"
|
|
|
+ :optionType="optionType"
|
|
|
+ :editData="editData"
|
|
|
+ :comps="compts"
|
|
|
+ @remind="remind"
|
|
|
+ ></process-order>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogFormVisible = false" size="small"
|
|
|
+ >取 消</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="optionType != 0"
|
|
|
+ @click="preserveHandler(0)"
|
|
|
+ size="small"
|
|
|
+ >保 存</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="optionType != 0"
|
|
|
+ type="primary"
|
|
|
+ @click="preserveHandler(1)"
|
|
|
+ size="small"
|
|
|
+ >提 交</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { getAllUserInfo } from "@/api/base";
|
|
|
+import { getMatterTypes } from "@/api/mbsys/materialmanage";
|
|
|
+import {
|
|
|
+ getTypetree,
|
|
|
+ getProcessPageList,
|
|
|
+ queryProcessPage,
|
|
|
+ qOrderProcessById,
|
|
|
+ addOrderProcess,
|
|
|
+ examineProcess,
|
|
|
+ querySupervisePage
|
|
|
+} from "@/api/process/process";
|
|
|
+import { getSupplier } from "@/api/mbsys/materialmanage";
|
|
|
+import { config } from "../../../components/cfgOrderProcess";
|
|
|
+import processOrder from "@/views/mbsys/publicOrder/orderProcess/detail";
|
|
|
+import { publicComponents } from "../processForm/config";
|
|
|
+export default {
|
|
|
+ components: { processOrder },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ config: config,
|
|
|
+ pickerOptions: {
|
|
|
+ shortcuts: [
|
|
|
+ {
|
|
|
+ text: "最近一周",
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
+ picker.$emit("pick", [start, end]);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "最近一个月",
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
+ picker.$emit("pick", [start, end]);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "最近三个月",
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
+ picker.$emit("pick", [start, end]);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ allDept:[], //所有部门
|
|
|
+ curUser: null, //当前登录人
|
|
|
+ orderName: "物料采购单", //工单名称
|
|
|
+ orderCode: "", //工单编号
|
|
|
+ suppliers: [], //供应商
|
|
|
+ orderStates:config.orderState,
|
|
|
+ form: {
|
|
|
+ content: "", //关键字
|
|
|
+ supplierId: "", //供应商
|
|
|
+ registerDept:"",//申购部门
|
|
|
+ purchaseTime: [], //申购时间
|
|
|
+ orderState:'' //工单状态
|
|
|
+ },
|
|
|
+ tableData: [],
|
|
|
+ metrialCategories: [], //物资类别
|
|
|
+ title: "",
|
|
|
+ materialTypes: [],
|
|
|
+ selectMaterialTypes: [],
|
|
|
+ pagination: { current: 1, size: 20, total: 0 },
|
|
|
+ dialogFormVisible: false,
|
|
|
+ curProcess: null,
|
|
|
+ businessType: null, //业务类型
|
|
|
+ optionType: 0, //操作类型 0:查看,1:新增,2:修改
|
|
|
+ editData: {}, //操作数据
|
|
|
+ processId: 0, //流程ID
|
|
|
+ compts: publicComponents,
|
|
|
+ curEditRow:null, //当前操作数据
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ async created() {
|
|
|
+ this.curUser = this.$store.state.user;
|
|
|
+ /**
|
|
|
+ * 查询所有用户所有部门
|
|
|
+ */
|
|
|
+ this.allDept = await this.getDeptAndUser();
|
|
|
+ if (this.config && this.config.hasOwnProperty("metrialCategories"))
|
|
|
+ this.metrialCategories = this.config.metrialCategories;
|
|
|
+ //获取供应商
|
|
|
+ getSupplier({ current: 1, size: 9999 }).then((res) => {
|
|
|
+ if (res.code) {
|
|
|
+ this.suppliers = res.result.records;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ /**
|
|
|
+ * 获取分类下的类型
|
|
|
+ */
|
|
|
+ let params = { current: 1, size: 999 };
|
|
|
+ getMatterTypes(params).then((res) => {
|
|
|
+ this.materialTypes = res.result.records;
|
|
|
+ this.selectMaterialTypes = this.materialTypes.filter((p) => true);
|
|
|
+ });
|
|
|
+ //获取业务类别
|
|
|
+ getTypetree({ datatypes: 0, id: "" })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code === 1) {
|
|
|
+ if (res.result.length > 0)
|
|
|
+ if (res.result[0].vos.length > 1)
|
|
|
+ this.businessTypes = res.result[0].vos[0].vos;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((ex) => {
|
|
|
+ this.$message.error("获取数据出错!");
|
|
|
+ });
|
|
|
+ this.getProcess();
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ //this.queryProcess();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async getDeptAndUser() {
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ getAllUserInfo().then((res) => {
|
|
|
+ const data = res.result;
|
|
|
+ for (const i in data) {
|
|
|
+ data[i].value = data[i].id;
|
|
|
+ data[i].label = data[i].name;
|
|
|
+ if (data[i].users) {
|
|
|
+ data[i].children = data[i].users;
|
|
|
+ for (const j in data[i].children) {
|
|
|
+ data[i].children[j].value = data[i].children[j].id;
|
|
|
+ data[i].children[j].label = data[i].children[j].realName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resolve(data);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 根据部门ID获取部门名称
|
|
|
+ */
|
|
|
+ getDeptName(deptId){
|
|
|
+ if(this.allDept.length > 0){
|
|
|
+ const dept = this.allDept.find(item => item.id == deptId)
|
|
|
+ if(dept) return dept.name
|
|
|
+ else deptId
|
|
|
+ }
|
|
|
+ else
|
|
|
+ return deptId
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 根据部门ID和人员id获取人员名称
|
|
|
+ */
|
|
|
+ getUserName(deptId,userId){
|
|
|
+ if(this.allDept.length > 0){
|
|
|
+ const dept = this.allDept.find(item => item.id == deptId)
|
|
|
+ if(dept){
|
|
|
+ const user = dept.users.find(p => p.id == userId)
|
|
|
+ if(user)return user.realName
|
|
|
+ else return userId
|
|
|
+ }
|
|
|
+ else
|
|
|
+ return userId
|
|
|
+ }
|
|
|
+ else
|
|
|
+ return userId
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 根据id获取工单状态
|
|
|
+ */
|
|
|
+ getOrderStateNameById(id) {
|
|
|
+ if (this.config && this.config.hasOwnProperty("orderState")) {
|
|
|
+ const obj = this.config.orderState.find((item) => item.key === id);
|
|
|
+ if (obj) return obj.value;
|
|
|
+ else return id;
|
|
|
+ } else {
|
|
|
+ return id;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询工单列表
|
|
|
+ */
|
|
|
+ queryProcess() {
|
|
|
+ //带入当前登录人查询
|
|
|
+ //ywType 业务类型,基础类型
|
|
|
+ //configId 流程类型
|
|
|
+ //handleStaff 当前处理人
|
|
|
+ //processState 工单状态:1草稿、2处理、3终止、4处理完成
|
|
|
+ let params = Object.assign(
|
|
|
+ { ywType:this.businessType, configId:this.processId,handleStaff: this.curUser.userId, processState:2 },
|
|
|
+ this.pagination
|
|
|
+ );
|
|
|
+ //关键字
|
|
|
+ if (this.form.content != "")
|
|
|
+ Object.assign(params, { content: this.form.content })
|
|
|
+ //供应商
|
|
|
+ if (this.form.supplierId != "")
|
|
|
+ Object.assign(params, { supplierId: this.form.supplierId })
|
|
|
+ //申购部门
|
|
|
+ if(this.form.registerDept !="")
|
|
|
+ Object.assign(params, { registerDept: this.form.registerDept })
|
|
|
+ //申购时间
|
|
|
+ if(this.form.purchaseTime.length > 1){
|
|
|
+ Object.assign(params, { endTime: this.form.purchaseTime[0] + " 00:00:00",stratTime: this.form.purchaseTime[1]} + " 23:59:59")
|
|
|
+ }
|
|
|
+ //工单状态
|
|
|
+ if(this.form.orderState != "")
|
|
|
+ Object.assign(params, { processState: this.form.orderState })
|
|
|
+ queryProcessPage(params).then((res) => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ //this.tableData = res.result.records;
|
|
|
+ this.getUrgeInfo(res.result.records)
|
|
|
+ this.pagination.total = res.result.total;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询列表数据
|
|
|
+ */
|
|
|
+ getProcess() {
|
|
|
+ let data = {
|
|
|
+ current: 1,
|
|
|
+ size: 999,
|
|
|
+ };
|
|
|
+ getProcessPageList(data)
|
|
|
+ .then((res) => {
|
|
|
+ this.curProcess = res.result.records.find(
|
|
|
+ (item) => item.processNumber === "CGLC"
|
|
|
+ );
|
|
|
+ if (this.curProcess) {
|
|
|
+ //this.getProcessById(this.curProcess.id);
|
|
|
+ this.processId = this.curProcess.id;
|
|
|
+ this.businessType = this.curProcess.hasOwnProperty("processType")
|
|
|
+ ? this.curProcess.processType
|
|
|
+ : null;
|
|
|
+ }
|
|
|
+ this.queryProcess();
|
|
|
+ })
|
|
|
+ .catch((ex) => {
|
|
|
+ this.$message.error("获取流程列表失败!");
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 提示
|
|
|
+ remind(data) {
|
|
|
+ this.dialogFormVisible = false;
|
|
|
+ //设置初始操作类型
|
|
|
+ this.optionType = 1;
|
|
|
+ this.queryProcess();
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id查询工单流程信息
|
|
|
+ * @row 查询数据
|
|
|
+ * @type 操作类型 false:查看,true:审核
|
|
|
+ */
|
|
|
+ queryOrderProcessById(row, type) {
|
|
|
+ this.curEditRow = type ? row : null
|
|
|
+ qOrderProcessById(row.id).then((res) => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ this.title = type ? "采购单-审核" : "采购单-详情";
|
|
|
+ this.optionType = type ? 2 : 0; ////操作类型 0:查看,1:新增,2:修改
|
|
|
+ this.editData = res.result;
|
|
|
+ this.dialogFormVisible = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增工单流程信息
|
|
|
+ */
|
|
|
+ examineProcessOrder(param) {
|
|
|
+ examineProcess(param).then((res) => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.queryProcess()
|
|
|
+ this.$message.success("处理成功!")
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 提交数据
|
|
|
+ * @state 操作状态 保存为0,提交为1
|
|
|
+ */
|
|
|
+ preserveHandler(state) {
|
|
|
+ let params = this.$refs.merge.submitForm();
|
|
|
+ console.log('提交数据',params)
|
|
|
+ if(this.editData.processNode == 1){ //对于第一步处理的数据,用登记接口提交
|
|
|
+ //处理提交参数到接口参数映射
|
|
|
+ const data = this.formParamMapping(params, state);
|
|
|
+ this.addOrder(data);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ //处理提交参数到接口参数映射
|
|
|
+ const data = this.examineFormParamMapping(params, state);
|
|
|
+ this.examineProcessOrder(data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 新增工单流程信息
|
|
|
+ */
|
|
|
+ addOrder(param) {
|
|
|
+ addOrderProcess(param).then((res) => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.queryProcess()
|
|
|
+ this.$message.success("处理成功!")
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 表单参数映射到提交参数
|
|
|
+ * 不是第一步审核的才用改映射方法
|
|
|
+ */
|
|
|
+ examineFormParamMapping(data, state) {
|
|
|
+ let params = {
|
|
|
+ handleResults: 0, //处理结果0:不处理;1:同意;2:不同意
|
|
|
+ operateState:0, //表单类型:0、其它; 1、采购入库(关联采购工单);2、余料退库(关联出库工单);3、工程出库(关联工程工单);4其它出库;5、维修出库(关联维修工单)
|
|
|
+ processStep:data.curProcessStep, //当前流程步骤
|
|
|
+ stepNode:data.curStepNode, //当前步骤结点
|
|
|
+ headleState:data.headleState, //处理状态:1提交;2:驳回;3:转派;4:终止;
|
|
|
+ remark:data.remarks, //当前处理意见
|
|
|
+ saveState:state //0保存,1提交
|
|
|
+ };
|
|
|
+ const nextProcess = (data.processStep + '').split(',')
|
|
|
+ const nextStep = { //下一步
|
|
|
+ dept:data.dept, //部门
|
|
|
+ deptStaff:data.deptStaff, //人员
|
|
|
+ processStep: (nextProcess && nextProcess.length > 0) ? parseInt(nextProcess[0]) : data.curProcessStep , //流程步骤
|
|
|
+ stepNode:(nextProcess && nextProcess.length > 1) ? parseInt(nextProcess[1]) : data.stepNode //步骤结点
|
|
|
+ }
|
|
|
+
|
|
|
+ let formData = new FormData();
|
|
|
+ if(this.curEditRow != null) Object.assign(params, { processId: this.curEditRow.id }) //流程ID
|
|
|
+ //表单字段
|
|
|
+ if (data.hasOwnProperty("configId")) {
|
|
|
+ params = Object.assign(params, { configId: data.configId }); //流程配置ID
|
|
|
+ }
|
|
|
+ Object.assign(params, { nextStep: nextStep });
|
|
|
+ const json = JSON.stringify(params);
|
|
|
+ // 将 json 字符串转化为 Blob 对象
|
|
|
+ const blob = new Blob([json], {
|
|
|
+ type: "application/json",
|
|
|
+ });
|
|
|
+ formData.append("dto", blob);
|
|
|
+ //文件
|
|
|
+ if (data.hasOwnProperty("files")) {
|
|
|
+ let files = [];
|
|
|
+ data.files.forEach((file, index) => {
|
|
|
+ formData.append("fileList", file.file);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return formData;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 表单参数映射到提交参数
|
|
|
+ */
|
|
|
+ formParamMapping(data, state) {
|
|
|
+ let params = {
|
|
|
+ operateState:0 // 表单类型:0、其它; 1、采购入库(关联采购工单);2、余料退库(关联出库工单);3、工程出库(关联工程工单);4其它出库;5、维修出库(关联维修工单)
|
|
|
+ };
|
|
|
+ let formData = new FormData();
|
|
|
+ if(this.curEditRow != null) Object.assign(params, { id: this.curEditRow.id }) //流程ID
|
|
|
+ //表单字段
|
|
|
+ if (data.hasOwnProperty("configId")) {
|
|
|
+ params = Object.assign(params, { configId: data.configId }); //流程配置ID
|
|
|
+ }
|
|
|
+ if (data.hasOwnProperty("form")) {
|
|
|
+ Object.assign(params, {
|
|
|
+ name: data.form.name, // 名称
|
|
|
+ registerTime: data.form.registerTime.length > 11 ? data.form.registerTime : data.form.registerTime + " 00:00:00", //登记时间
|
|
|
+ supplierId: data.form.supplier, //供应商ID
|
|
|
+ supplier: data.form.factoryName, //供应商名称
|
|
|
+ telephone: data.form.contactNumber, //联系电话
|
|
|
+ useDept: data.form.useDept, //申购部门
|
|
|
+ totalPrice: data.form.allPrice, //总价
|
|
|
+ remark: data.form.remark, //备注
|
|
|
+ });
|
|
|
+ }
|
|
|
+ Object.assign(params, { ywType: this.businessType }); //业务类型
|
|
|
+ let processNode = {
|
|
|
+ //第一步
|
|
|
+ handleResults: 0, //处理结果0:不处理;1:同意;2:不同意;
|
|
|
+ saveState: state, //0保存,1提交
|
|
|
+ annex:data.hasOwnProperty('existsFilesId') ? data.existsFilesId : '', //附件id
|
|
|
+ remark:data.hasOwnProperty("examine") ? data.examine.remarks : ''
|
|
|
+ };
|
|
|
+ //审核信息
|
|
|
+ if (data.hasOwnProperty("examine")) {
|
|
|
+ //下一步审核
|
|
|
+ let nextStep = {
|
|
|
+ dept: data.examine.hasOwnProperty("dept") ? data.examine.dept : "", //部门
|
|
|
+ deptStaff: data.examine.hasOwnProperty("deptStaff") ? data.examine.deptStaff : "", //人员
|
|
|
+ processStep: data.examine.hasOwnProperty("processStep") ? data.examine.processStep : 1, //流程步骤
|
|
|
+ stepNode:data.examine.hasOwnProperty("stepNode") ? data.examine.stepNode: 1, //步骤节点
|
|
|
+ };
|
|
|
+ Object.assign(
|
|
|
+ processNode,
|
|
|
+ { headleState: data.examine.headleState, //处理状态:1提交;2:驳回;3:转派;4:终止;
|
|
|
+ nextStep:nextStep, //下一步信息,下一步,驳回,转派
|
|
|
+ processStep:1, //流程步骤(当前)
|
|
|
+ stepNode:1 //步骤节点(当前)
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ //流程步骤 processStep
|
|
|
+ // 步骤节点 stepNode
|
|
|
+ Object.assign(params, { stepNode: 1 })
|
|
|
+ //物资信息 metrials
|
|
|
+ if (data.hasOwnProperty("metrials")) {
|
|
|
+ let stuffDtos = [];
|
|
|
+ data.metrials.forEach((metrial) => {
|
|
|
+ stuffDtos.push({
|
|
|
+ amountMoney: metrial.allPrice, // 金额
|
|
|
+ matterId: metrial.id, //物料ID
|
|
|
+ matterState: 1, //metrial.isAssets 物料状态1:新;2:旧 默认为1
|
|
|
+ quantity: metrial.purchaseNumber, //数量
|
|
|
+ unitPrice: parseFloat(metrial.purchasePrice), //单价
|
|
|
+ });
|
|
|
+ });
|
|
|
+ if (stuffDtos.length > 0)
|
|
|
+ Object.assign(processNode, { stuffDtos: stuffDtos }); //采购物资信息
|
|
|
+ }
|
|
|
+ //其他费用
|
|
|
+ if (data.hasOwnProperty("otherCost")) {
|
|
|
+ let otherCost = [];
|
|
|
+ data.otherCost.forEach((op) => {
|
|
|
+ otherCost.push({
|
|
|
+ amountMoney: op.cost, //金额
|
|
|
+ costName: op.costType, //费用名称
|
|
|
+ explain: op.remark, //费用说明
|
|
|
+ unitPrice: op.cost,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ if (otherCost.length > 0)
|
|
|
+ Object.assign(processNode, { detailedDtos: otherCost }); //其他费用信息
|
|
|
+ }
|
|
|
+
|
|
|
+ Object.assign(params, { processNode: processNode }); //业务类型
|
|
|
+ const json = JSON.stringify(params);
|
|
|
+ // 将 json 字符串转化为 Blob 对象
|
|
|
+ const blob = new Blob([json], {
|
|
|
+ type: "application/json",
|
|
|
+ });
|
|
|
+ formData.append("dto", blob);
|
|
|
+ //文件
|
|
|
+ if (data.hasOwnProperty("files")) {
|
|
|
+ let files = [];
|
|
|
+ data.files.forEach((file, index) => {
|
|
|
+ formData.append("fileList", file.file);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return formData;
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取催办消息
|
|
|
+ */
|
|
|
+ async getUrgeInfo(data) {
|
|
|
+ // this.tableData.forEach((row) => {
|
|
|
+
|
|
|
+ // });
|
|
|
+ let tableList = data;
|
|
|
+ for(let i = 0 ; i < tableList.length;i++){
|
|
|
+ tableList[i]['urgeInfo'] = ''
|
|
|
+ if (tableList[i].urgeNumber > 0) {
|
|
|
+ let data = {
|
|
|
+ processId: tableList[i].id, //流程ID
|
|
|
+ nodeBranch: tableList[i].nodeBranch, //流程节点分支
|
|
|
+ processNode: tableList[i].processNode, //流程节点
|
|
|
+ superviseDept: parseInt(this.curUser.departmentId), //督办部门
|
|
|
+ superviseStaff: this.curUser.userId, //督办人
|
|
|
+ };
|
|
|
+ const res = await this.querySupervisePage(data)
|
|
|
+
|
|
|
+ let result = []
|
|
|
+ if (res) {
|
|
|
+ res.result.records.forEach((item) => {
|
|
|
+ const dept = this.getDeptName(item.handleDept);
|
|
|
+ result.push(item.createTime +" " + dept +" " + item.createUserName + " " +item.remark)
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ tableList[i]['urgeInfo'] = result
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.tableData = tableList
|
|
|
+ },
|
|
|
+
|
|
|
+ async querySupervisePage(data) {
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ querySupervisePage(data).then((res) => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ resolve(res);
|
|
|
+ } else {
|
|
|
+ resolve(null);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取催办消息
|
|
|
+ */
|
|
|
+ getContent(row){
|
|
|
+ console.log('获取催办消息',row)
|
|
|
+ return '获取催办消息'
|
|
|
+ }
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.content-container {
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 10px;
|
|
|
+ position: absolute;
|
|
|
+ top: 43px;
|
|
|
+ bottom: 0;
|
|
|
+
|
|
|
+ .top {
|
|
|
+ height: 33px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ text-align: right;
|
|
|
+
|
|
|
+ .el-form .el-form-item {
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .upload-demo {
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .table-div {
|
|
|
+ height: calc(100% - 87px);
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-pagination {
|
|
|
+ margin-top: 16px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.el-table {
|
|
|
+ >>> .el-table__body {
|
|
|
+ tr {
|
|
|
+ &:nth-child(2n) {
|
|
|
+ background-color: #f0f9eb;
|
|
|
+ }
|
|
|
+ td {
|
|
|
+ height: 23px;
|
|
|
+ line-height: 23px;
|
|
|
+ padding: 2px 1px !important;
|
|
|
+ .el-button {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.tf-dialog {
|
|
|
+ >>> .el-dialog__header {
|
|
|
+ background: #2d74e7;
|
|
|
+ .el-dialog__title {
|
|
|
+ color: aliceblue !important;
|
|
|
+ }
|
|
|
+ .el-dialog__close {
|
|
|
+ color: aliceblue !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|