# Conflicts: # src/components/input-dialog/components/index.vue # src/components/input-dialog/index.vue # src/views/business/spd/bo/basic/index.vue # src/views/business/spd/bo/statement/proportion/index.vue
@@ -0,0 +1,60 @@
+import request from "@/utils/request";
+
+export function list(params) {
+ return request({
+ url: "/pu/priceApply/list",
+ method: "GET",
+ params: params,
+ });
+}
+export function add(data) {
+ url: "/pu/contract/add",
+ method: "POST",
+ data: data,
+export function edit(data) {
+ url: "/pu/contract/edit",
+export function remove(data) {
+ url: `/pu/contract/${data}`,
+ method: "delete",
+export function item(data) {
+export function generateCode() {
+ url: "/pu/contract/generateNo",
+export function itemTableList(params, name) {
+ let url = "";
+ if (name === "contractItemList") url = "/pu/contract/item/list";
+ if (name === "contractClauseList") url = "/pu/contract/clause/list";
+ if (name === "contractExpenseList") url = "/pu/contract/expense/list";
+ if (name === "contractAgreementList") url = "/pu/contract/agreement/list";
+ if (name === "contractApplyOrgList") url = "/pu/contract/org/list";
+ url: url,
+ url: "/pu/price/catalogue/list",
+ url: "/pu/contract/list",
@@ -1,17 +0,0 @@
-import request from "@/utils/request";
-
-export function list(params) {
- return request({
- url: "/pu/contract/list",
- method: "get",
- params: params,
- });
-}
-export function add(data) {
- url: "/pu/contract/add",
- method: "post",
- data: data,
@@ -0,0 +1,84 @@
+// 采购订单修订列表
+const list = (data) => {
+ url: `/pu/order/list`,
+ method: "post",
+ data,
+// 采购订单详情
+const details = (id, params) => {
+ url: `/pu/order/${id}`,
+ method: "get",
+ params,
+// 采购订单修订创建
+const create = (data) => {
+ url: `/pu/order`,
+// 采购订单提交
+const submit = (data) => {
+ url: `/pu/order/submit`,
+// 采购订单编辑
+const edit = (data) => {
+ method: "put",
+// 采购订单修订
+const revision = (data) => {
+ url: `/pu/order/revision`,
+// 采购订单删除
+const remove = (data) => {
+ url: `/pu/order/${data}`,
+// 采购订单-询价
+const getPrice = (data) => {
+ url: `/pu/order/getPrice`,
+export default {
+ list,
+ details,
+ create,
+ submit,
+ edit,
+ revision,
+ remove,
+ getPrice,
@@ -1,10 +0,0 @@
-// 查询任务列表
-export function taskList(data) {
- url: "/pu/order/generate/list",
- method: "POST",
@@ -0,0 +1,45 @@
+// 查询任务列表
+export function LIST(data) {
+ url: "/pu/order/generate/list",
+ url: `/pu/order/generate/${data}`,
+export function FIRSTDIRECT(data) {
+ url: "/pu/order/generate/manualAgreement",
+export function ADD(data) {
+ url: "/pu/order/create",
+export function SHUTDOWN(data) {
+ url: `/pu/demand/item/summary/shutDown/${data}`,
+ method: "PUT",
@@ -103,3 +103,12 @@ export function updateWinningState(data) {
data: data
})
}
+//分配负责人
+export function allocationParticipant(data) {
+ url: '/mk/bo/basic/allocationParticipant',
+ method: 'put',
+ data: data
+ })
@@ -4,46 +4,66 @@ import request from '@/utils/request';
// 经销商授权信息列表
-const dealerList = (params, page) => {
+const list = (params) => {
return request({
- url: `dealer/list?pageSize=${page.pageSize}&pageNum=${page.pageNum}`,
+ url: `/dealer/list`,
method: 'get',
params,
// 经销商授权信息新增接口
-const dealerInsert = (data) => {
+const insert = (data) => {
- url: `dealer/insert`,
+ url: `/dealer/insert`,
method: 'post',
data,
-const dealerDelete = (params) => {
+const remove = (params) => {
+// ?id=${params.id}
- url: `dealer/delete?id=${params.id}`,
+ url: `/dealer/delete`,
-const dealerUpdate = (data) => {
+const update = (data) => {
+ url: `/dealer/update`,
+ method: 'post',
+// 提交OA
+const submitOA = (data) => {
- url: `dealer/update`,
+ url: `/dealer/OA`,
+// 下载授权书
+const download = (data) => {
+ url: `/dealer/download`,
export default {
- dealerList,
- dealerInsert,
- dealerDelete,
- dealerUpdate,
+ insert,
+ update,
+ submitOA,
+ download,
@@ -45,10 +45,26 @@ export function cancelAuditSummary(id) {
+// 采购需求汇总编辑
+export function editSummaryList(data) {
+ url: `/pu/demand/summary/edit`,
// 采购需求汇总明细行关闭
export function shutDownSummary(id) {
url: `/pu/demand/item/summary/shutDown/${id}`,
+// 采购需求明细行编辑
+export function editSummaryMx(data) {
+ url: `/pu/demand/item/summary/detail/edit`,
@@ -24,6 +24,14 @@ export function editDemand(data) {
+// 采购需求单提交
+export function submitDemand(data) {
+ url: `/pu/demand/submit`,
+ method: 'POST',
// 采购需求单基本信息详情
export function getDemandDetail(id) {
@@ -54,4 +62,20 @@ export function downLoadDemand(data) {
data: data,
responseType: 'blob'
+// 采购需求单导出
+export function exportDemand(data) {
+ url: `/pu/demand/export`,
+ responseType: 'blob'
+// 通过物料ID查询采购员
+export function queryMan(id) {
+ url: `/material/division/queryBuyer?materialId=${id}`,
+ method: 'get',
@@ -1,236 +0,0 @@
-<template>
- <div>
- <el-dialog
- title="剂型选择"
- width="1000px"
- :close-on-click-modal="false"
- :append-to-body="true"
- v-dialogDrag
- class="userDialog"
- :visible.sync="visible"
- >
- <el-container style="height: 500px">
- <el-container>
- <el-header style="text-align: left; font-size: 12px; height: 30px">
- <el-form
- size="small"
- :inline="true"
- ref="searchForm"
- :model="searchForm"
- @keyup.enter.native="refreshList()"
- @submit.native.prevent
- <el-form-item prop="param" label="名称/编号" >
- <el-input
- v-model="searchForm.param"
- placeholder="输入名称/编号查询"
- clearable
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-button
- type="primary"
- @click="refreshList()"
- icon="el-icon-search"
- >查询</el-button
- @click="resetSearch()"
- icon="el-icon-refresh-right"
- >重置</el-button>
- </el-form>
- </el-header>
- <el-main>
- <el-table
- :data="dataList"
- v-loading="loading"
- border
- ref="contractTable"
- @select="handleSelectionChange"
- @row-click="rowSelect"
- height="calc(100% - 40px)"
- style="width: 100%"
- <el-table-column
- type="selection"
- header-align="center"
- align="center"
- width="50"
- </el-table-column>
- prop="id"
- sortable="custom"
- min-width="90"
- label="code"
- prop="name"
- label="名称"
- </el-table>
- <el-pagination
- @size-change="sizeChangeHandle"
- @current-change="currentChangeHandle"
- :current-page="searchForm.pageNo"
- :page-sizes="[5, 10, 15, 20]"
- :page-size="searchForm.pageSize"
- :total="total"
- layout="total, sizes, prev, pager, next, jumper"
- </el-pagination>
- </el-main>
- </el-container>
- <span slot="footer" class="dialog-footer">
- @click="visible = false"
- icon="el-icon-circle-close"
- >关闭</el-button
- icon="el-icon-circle-check"
- @click="doSubmit()"
- >确定</el-button
- </span>
- </el-dialog>
- </div>
-</template>
-<script>
-import { getDose } from '@/api/requisition/basic'
-export default {
- data() {
- return {
- searchForm: {
- param: '',
- pageNo: 1,
- pageSize: 10,
- },
- dataListAllSelections: [], // 所有选中的数据包含跨页数据
- idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
- dataList: [],
- total: 0,
- orders: [],
- loading: false,
- visible: false,
- };
- props: {
- selectData: {
- type: Array,
- default: () => {
- return [];
- // 是否启用单选
- single: {
- type: Boolean,
- default: false
- }
- methods: {
- init() {
- this.visible = true;
- this.$nextTick(() => {
- this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
- this.resetSearch();
- // 获取数据列表
- refreshList() {
- this.loading = true;
- getDose(this.searchForm).then(({ data }) => {
- console.log('data',data)
- this.dataList = data.tableBody;
- this.total = data.total;
- this.loading = false;
- this.setSelectRow();
- // 每页数
- sizeChangeHandle(val) {
- this.searchForm.pageSize = val;
- this.refreshList();
- // 当前页
- currentChangeHandle(val) {
- this.searchForm.pageNo = val;
- // 排序
- resetSearch() {
- this.$refs['searchForm'].resetFields();
- this.searchForm.pageNo = 1;
- // 表格选中数据
- rowSelect(row, column, event) {
- this.$refs.contractTable.clearSelection();
- this.$refs.contractTable.toggleRowSelection(row);
- this.dataListAllSelections = this.single ? [row] : selection
- // 选中数据
- handleSelectionChange(selection, row) {
- if (this.single && selection.length > 1) {
- // 设置选中的方法
- setSelectRow() {
- if (!this.dataListAllSelections || this.dataListAllSelections.length <= 0) {
- return;
- for (let i = 0; i < this.dataList.length; i++) {
- if (this.dataListAllSelections.some(item => item[this.idKey] == this.dataList[i][this.idKey])) {
- // 设置选中,记住table组件需要使用ref="table"
- this.$refs.contractTable.toggleRowSelection(this.dataList[i], true);
- doSubmit() {
- this.visible = false;
- console.log('选择的数据?',this.dataListAllSelections)
- this.$emit("doSubmit", this.dataListAllSelections);
-};
-</script>
-<style lang="scss">
-.userDialog {
- .el-dialog__body {
- padding: 10px 0px 0px 10px;
- color: #606266;
- font-size: 14px;
- word-break: break-all;
- .el-main {
- padding: 20px 20px 5px 20px;
- .el-pagination {
- margin-top: 5px;
-</style>
@@ -8,7 +8,7 @@
<el-form size="small" :inline="true" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()"
@submit.native.prevent>
<el-form-item prop="param" label="名称/编号">
- <el-input size="small" v-model="searchForm.param" placeholder="输入名称/编号查询" clearable></el-input>
+ <el-input size="small" v-model="searchForm.search" placeholder="输入名称/编号查询" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
@@ -48,7 +48,7 @@ export default {
data() {
return {
searchForm: {
+ search: '',
pageNo: 1,
pageSize: 10,
},
@@ -80,6 +80,7 @@ export default {
this.visible = true;
console.log("🚀 ~ file: refers.vue:79 ~ init ~ init(val):", val)
this.reciveForm = val
+ this.searchForm.search = ''
this.$nextTick(() => {
this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
this.resetSearch();
@@ -0,0 +1,120 @@
+<template>
+ <div>
+ <el-dialog :title="reciveForm.title" width="500px" :close-on-click-modal="false" :append-to-body="true" v-dialogDrag
+ class="userDialog" :visible.sync="visible">
+ <el-container style="height: 500px">
+ <el-container>
+ <el-main>
+ <el-row :gutter="24" class="content">
+ <el-col :span="24">
+ <el-input placeholder="输入关键字进行过滤" size="small" v-model="filterText" style="margin-bottom: 16px">
+ </el-input>
+ <el-tree class="filter-tree" :data="threedata" :props="defaultProps" accordion node-key="id"
+ highlight-current @node-click="clickTree" :filter-node-method="filterNode" ref="tree">
+ <span slot-scope="{ node, data }">
+ {{ data.code }}{{ data.name }}
+ </span>
+ </el-tree>
+ </el-col>
+ </el-row>
+ </el-main>
+ </el-container>
+ <span slot="footer" class="dialog-footer">
+ <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
+ <el-button size="small" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
+ </el-dialog>
+ </div>
+</template>
+<script>
+import { getRefer } from '@/api/purchase/basic'
+ data() {
+ return {
+ loading: false,
+ visible: false,
+ filterText: "",
+ threedata: [],
+ defaultProps: {
+ children: "children",
+ label: "name",
+ },
+ // 判断是否为最末级节点
+ // isLast: false,
+ // 选中的节点
+ choosePoint: {},
+ // 接收的参数
+ reciveForm: {},
+ };
+ props: {},
+ watch: {
+ filterText(val) {
+ this.$refs.tree.filter(val);
+ methods: {
+ init(val) {
+ this.visible = true;
+ this.reciveForm = val
+ this.$nextTick(() => {
+ this.refreshList();
+ // 获取数据列表
+ refreshList(data) {
+ this.loading = true;
+ let params = this.reciveForm
+ getRefer(params).then((res) => {
+ console.log("res", res);
+ if (res.code === 200) {
+ this.threedata = res.rows
+ }
+ this.loading = false;
+ clickTree(data) {
+ console.log("树形节点信息:", data);
+ this.choosePoint = data;
+ filterNode(value, data) {
+ console.log("value", value);
+ console.log("data", data);
+ if (!value) return true;
+ return data.name.indexOf(value) !== -1;
+ doSubmit() {
+ console.log("子组件选择的数据", this.choosePoint);
+ this.$emit("doSubmit", this.choosePoint);
+ this.visible = false;
+ loadNode(node, resolve) {
+ console.log("node, resolve", node, resolve);
+ // if (!node.data.length)
+ // resolve(node.data.childrens.sort((a, b) => a.code - b.code));
+ // else resolve(this.threedata);
+};
+</script>
+<style lang="scss">
+.userDialog {
+ .el-dialog__body {
+ padding: 10px 0px 0px 10px;
+ color: #606266;
+ font-size: 14px;
+ word-break: break-all;
+ .el-main {
+ padding: 20px 20px 5px 20px;
+ .el-pagination {
+ margin-top: 5px;
+</style>
@@ -0,0 +1,22 @@
+// 货位
+export default [
+ // 树
+ {
+ key: "id",
+ title: "ID",
+ type: "Input",
+ search: true,
+ key: "code",
+ title: "编码",
+ key: "name",
+ title: "货位",
+];
@@ -0,0 +1,21 @@
+// 结算方式
+ title: "结算方式ID",
+ title: "结算方式",
+// 客户部门
+ title: "客户部门ID",
+ title: "客户部门编码",
+ title: "客户部门名称",
+// 收货客户
+ title: "收货客户ID",
+ title: "收货客户编码",
+ title: "收货客户名称",
+// 经营性项目
+ title: "经营性项目ID",
+ title: "经营性项目编码",
+ title: "经营性项目名称",
+// 处理方式
+ // {
+ // key: "id",
+ // title: "ID",
+ // type: "Input",
+ // search: true,
+ // },
+ title: "处理方式",
+// 在建工程项目
+ title: "在建工程项目ID",
+ title: "在建工程项目编码",
+ title: "在建工程项目名称",
+// 退换原因
+ title: "退换原因ID",
+ title: "退换原因编码",
+ title: "退换原因",
+// 供应商联系人
+ title: "供应商联系人名称",
@@ -0,0 +1,29 @@
+// 收货仓库
+ title: "仓库ID",
+ title: "仓库编码",
+ title: "仓库名称",
+ key: "",
+ title: "备注",
+ title: "助记码",
@@ -1,11 +1,11 @@
<script>
import { refer } from "../api/index";
+import { initParams } from "@/utils/init";
import InitColumnHooks from "./init-column";
-import { initParams } from "../index";
name: "InputDialog",
- props: ["title", "type"],
+ props: ["type", "title", "queryParams"],
components: {},
const { type } = this.$props;
@@ -22,7 +22,7 @@ export default {
visible: false,
loading: false,
// search
- params: initParams(SearchColumns),
+ params: { search: "" },
searchColumns: SearchColumns,
// table
data: [],
@@ -45,14 +45,16 @@ export default {
async fetchList(prop, page) {
try {
this.loading = true;
- const { type } = this.$props;
const { pageNum, pageSize } = page;
+ const { type, queryParams } = this.$props;
const { code, msg, rows, total } = await refer(
{
- ...prop,
type: type,
isPage: true,
+ ...prop,
+ ...queryParams,
{ pageNum, pageSize }
);
if (code === 200) {
@@ -117,13 +119,14 @@ export default {
append-to-body
@open="beforeOpen"
>
- <el-form :size="size" :inline="true" :model="params">
- <el-form-item
- v-for="(column, index) in searchColumns"
- :key="index"
- :label="column.title"
- <el-input v-model="params[column.key]" @change="queryList"> </el-input>
+ <el-form :size="size" :inline="true" :model="params" @submit.native.prevent>
+ <el-form-item prop="search">
+ <el-input
+ v-model="params.search"
+ @keydown.enter="queryList"
+ @change="queryList"
+ >
<el-button icon="el-icon-refresh" @click="resetList"></el-button>
@@ -1,18 +1,48 @@
name: "DrInputDialog",
- props: [
- "value",
- "title",
- "type",
- "dataMapping",
- "source",
- "placeholder",
- "clearable",
- "disabled",
- "readonly",
- "size",
- ],
+ props: {
+ // 参照类型 ,对应后端
+ type: {
+ type: String,
+ require: true,
+ // Input显示数据
+ value: {
+ // 需映射源数据
+ source: {
+ type: Object,
+ // 参照内外映射
+ dataMapping: {
+ // 参照弹窗标题
+ title: {
+ default: "TITLE",
+ // 默认查询参数
+ queryParams: {
+ default: () => ({}),
+ //
+ size: String,
+ readonly: Boolean,
+ disabled: Boolean,
+ clearable: Boolean,
+ placeholder: String,
components: {
InputDialog: () => import("./components/index.vue"),
@@ -22,12 +52,23 @@ export default {
computed: {},
watch: {},
methods: {
+ // 处理默认传参
+ handleMakeQueryParams() {
+ const newQueryParams = {}
+ const { source, queryParams } = this.$props;
+ for (let key in queryParams) {
+ newQueryParams[key] = queryParams[key] === key ? source[queryParams[key]] : queryParams[key]
+ return newQueryParams
+ // 打开弹窗
handleAsyncOpenDialog() {
const { setVisible } = this.$refs.InputDialogFef;
setVisible(true);
});
+ // 更新映射数据
handleUpdateSource(prop) {
const { source, dataMapping } = this.$props;
for (let key in dataMapping) {
@@ -37,37 +78,20 @@ export default {
created() {
- console.log("prop", this.$props);
+ this.handleMakeQueryParams()
- mounted() {},
- destroyed() {},
+ mounted() { },
+ destroyed() { },
};
</script>
<template>
- v-model="value"
- :placeholder="placeholder"
- :clearable="clearable"
- :disabled="disabled"
- :readonly="readonly"
- :size="size"
- style="width: 100%; cursor: pointer"
- @click.native.stop="handleAsyncOpenDialog"
+ <el-input v-model="value" :size="size" :readonly="readonly" :disabled="disabled" :clearable="clearable"
+ :placeholder="placeholder" style="width: 100%; cursor: pointer" @click.native.stop="handleAsyncOpenDialog">
<template #suffix>
- <el-icon class="el-icon-thumb"></el-icon>
- <input-dialog
- ref="InputDialogFef"
- :title="title"
- :type="type"
- @confirm="handleUpdateSource"
- ></input-dialog>
+ <el-icon class="el-icon-milk-tea"></el-icon>
+ <input-dialog ref="InputDialogFef" :type="type" :title="title" :queryParams="handleMakeQueryParams()"
+ @confirm="handleUpdateSource"></input-dialog>
</template>
</el-input>
-<style scoped>
-::v-deep.el-input .el-input__suffix {
- display: flex;
- align-items: center;
+<style scoped></style>
@@ -14,6 +14,9 @@ import directive from './directive' // directive
import plugins from './plugins' // plugins
import { download } from '@/utils/request'
+// 时间格式化方法挂载
+import '@/views/marketing/utils/date';
import './assets/icons' // icon
import './permission' // permission control
import { getDicts } from "@/api/system/dict/data";
@@ -1,39 +0,0 @@
-import { arr2obj } from "./data-transform";
-import Components from "@/views/common-dialog";
-export const initParams = (arr) => arr2obj(arr, "key", "value");
-export const initDicts = (arr) =>
- arr
- .filter((column) => column.type === "Select")
- .map((column) => column.config.optionsName);
-export const initRules = (arr) => {
- const rules = {};
- .filter((column) => column.require)
- .forEach((column) => {
- const message = `${column.title}不能为空`;
- rules[column.key] = [
- { required: true, message: message, trigger: "change" },
- ];
- return rules;
-export const initComponents = (arr) => {
- const c = {};
- try {
- .filter((element) => element.type === "InputDialog")
- .map((element) => element.config.componentName)
- .forEach((element) => {
- c[element] = Components[element];
- return c;
- } catch (err) {
- } finally {
@@ -0,0 +1,61 @@
+import { arr2obj } from "../data-transform";
+export const initColumns = (
+ arr,
+ prop = { disabled: false, readonly: false, clearable: false }
+) => {
+ return arr.map((element) => {
+ element.config = element.config || {};
+ if (element.type === "Input") {
+ if (element.type === "InputDialog") {
+ prop.readonly = true;
+ if (element.type === "InputNumber") {
+ element.config = { controlsPosition: "right", ...element.config };
+ if (element.type === "Select") {
+ if (element.type === "DatePicker") {
+ element.config = { type: "date", ...element.config };
+ if (element.type === "Upload") {
+ element.value = [];
+ return { ...element, ...prop };
+// 初始化参数
+export const initParams = (prop, key = "key", value = "value") =>
+ arr2obj(prop, key, value);
+// 初始化字典
+export const initDicts = (prop) =>
+ prop
+ .filter((column) => column.type === "Select")
+ .map((column) => column.config.optionsName);
+// 初始化校验
+export const initRules = (prop) => {
+ const rules = {};
+ .filter((column) => column.require)
+ .forEach((column) => {
+ const message = `${column.title}不能为空`;
+ rules[column.key] = [
+ { required: true, message: message, trigger: "change" },
+ ];
+ return rules;
+const pageSizes = [25, 50, 100];
+const layout = "total, prev, pager, next, sizes, jumper";
+const page = { pageNum: 1, pageSize: 25, total: 0 };
+export const initPageSizes = () => pageSizes;
+export const initLayout = () => layout;
+export const initPage = () => page;
@@ -5,7 +5,14 @@
<el-row type="flex" class="row-bg" justify="space-around">
<el-col :span="4">
<div class="grid-content bg-purple">
- <el-button size="small" @click="handleBack">返回</el-button>
+ <el-button
+ type="info"
+ plain
+ icon="el-icon-back"
+ size="small"
+ @click="handleBack"
+ >返回</el-button
</div>
</el-col>
<el-col :span="16">
@@ -57,6 +64,15 @@
v-if="(showWin && this.form.basic.winningState == 0) && this.boAuthority.boAuthority.boWin"
>赢单</el-button
+ icon="el-icon-user"
+ @click="allocation()"
+ v-if="this.boAuthority.post == 0 && this.form.basic.winningState == 0"
+ >分配</el-button
</el-row>
<!-- 主多页签 -->
@@ -91,12 +107,12 @@
</dev>
<el-button size="mini" type="text" icon="el-icon-view" @click="customerButton"/>
</el-descriptions-item>
- <el-descriptions-item label="医院营收总额">
+ <el-descriptions-item :label="totalRevenue">
<div v-for="dict in dict.type.mk_bo_total_revenue" v-if="form.basic.totalHosRevenue == dict.value">
{{dict.label}}
- <el-descriptions-item label="医院耗材预估值(万元)">
+ <el-descriptions-item :label="estimate">
{{form.basic.hosDiscreetValue}}
<el-descriptions-item label="赢单率">
@@ -166,6 +182,7 @@
/>
</el-tab-pane>
</el-tabs>
<!-- 赢单状态弹窗 -->
<el-dialog :title="winningStateTitle" :visible.sync="winningStateOpen" width="500px" append-to-body>
<el-form ref="wsform" :model="winningStateData" :rules="winningStateDataRules" label-width="140px">
@@ -236,14 +253,51 @@
<el-button @click="cancelWinningStateData">取 消</el-button>
</el-dialog>
+ <!-- 分配商机负责人对话框 -->
+ <el-dialog
+ title="分配商机负责人"
+ :visible.sync="allocationPopover"
+ width="500px"
+ append-to-body
+ <el-form ref="afform" :model="allocationForm" :rules="allocationFormRules" label-width="140px">
+ <el-form-item label="新负责人" prop="allocationStaff">
+ <dr-input-dialog
+ v-model="allocationForm.allocationStaffName"
+ title="员工"
+ type="CONTACTS_PARAM"
+ :dataMapping="{
+ allocationStaff: 'id',
+ allocationStaffName: 'name',
+ }"
+ :source.sync="allocationForm"
+ ></dr-input-dialog>
+ </el-form-item>
+ <el-form-item label="是否将您作为参与人" prop="isParticipant">
+ <el-radio v-model="allocationForm.isParticipant" :label='true'
+ >是</el-radio
+ <el-radio v-model="allocationForm.isParticipant" :label='false'
+ >否</el-radio
+ </el-form>
+ <div slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitAllocationForm"
+ >确 定</el-button
+ <el-button @click="cancelAllocation">取 消</el-button>
import {
getBasic,
- delAccessory,
updateWinningState,
+ allocationParticipant,
} from "@/api/business/spd/bo/basic";
import { getBoNodeListByType } from "@/api/business/spd/bo/boNode";
import { getPsnPost } from "@/api/business/spd/bo/authority";
@@ -252,13 +306,14 @@ import ContactList from "../contact/contactList.vue";
import AccessoryList from "../basic/accessoryList.vue";
import FileTemplate from "../filetemplate/botabs.vue";
import Process from '../basic/process.vue';
+import DrInputDialog from "@/components/input-dialog/index.vue";
//名称
name: "BoDetails",
//注册引入的组件
- components: { TaskList, ContactList,AccessoryList,FileTemplate, Process},
+ components: { TaskList, ContactList,AccessoryList,FileTemplate, Process,DrInputDialog,},
//平台枚举
dicts: [
"mk_bo_type",
@@ -283,7 +338,7 @@ export default {
//赢单状态数据
winningStateData:{},
//赢单状态表单校验
- // 表单校验
+ // 赢单表单校验
winningStateDataRules: {
winningStateCause: [
{ required: true, message: "原因不能为空", trigger: "blur" }
@@ -316,8 +371,64 @@ export default {
timer: "",
//是否显示客户
showCustomer: false,
+ //分配参数
+ allocationForm: {
+ boId: null,
+ allocationStaff: null,
+ allocationStaffName: null,
+ isParticipant: true,
+ //分配表单校验
+ allocationFormRules: {
+ allocationStaff: [
+ { required: true, message: "新负责人不能为空", trigger: "blur" }
+ ],
+ //分配弹窗
+ allocationPopover: false,
+ //营收总额
+ totalRevenue:"***营收总额",
+ //预估额
+ estimate:"***预估额(万元)",
+ 'form.basic.boType': {
+ handler(newVal, oldVal) {
+ console.log('newVal',newVal);
+ switch(newVal) {
+ case '0':
+ this.totalRevenue = "医院营收总额";
+ this.estimate = "医院耗材预估值(万元)"
+ break;
+ case '1':
+ this.estimate = "医院耗材采集预估额(万元)"
+ case '2':
+ case '3':
+ this.estimate = "医院设备预估额(万元)"
+ case '4':
+ case '5':
+ this.totalRevenue = "项目总额";
+ this.estimate = "工程预估额(万元)"
+ default:
+ immediate: true,
+ deep: true // 可以深度检测到 person 对象的属性值的变化
//方法
// 返回
@@ -377,6 +488,31 @@ export default {
this.winningStateOpen = false;
this.resetWinningStateData();
+ //打开分配弹窗
+ allocation() {
+ this.allocationPopover = true;
+ //提交分配表单
+ submitAllocationForm() {
+ // this.allocationForm.boId = parseInt(this.form.basic.id);
+ // this.allocationForm.allocationStaff = parseInt(this.allocationForm.allocationStaff);
+ this.allocationForm.boId = this.form.basic.id;
+ console.log('this.allocationForm',this.allocationForm);
+ this.$refs["afform"].validate(valid => {
+ if (valid) {
+ allocationParticipant(this.allocationForm).then(response => {
+ console.log('response',response);
+ this.$modal.msgSuccess("分配成功");
+ this.allocationPopover = false;
+ this.reload();
+ //取消分配
+ cancelAllocation() {
//重新加载数据
reload(){
//加载基础数据
@@ -84,6 +84,17 @@
></el-option>
</el-select>
</el-form-item> -->
+ <el-form-item label="创建时间">
+ <el-date-picker
+ v-model="dateRange"
+ style="width: 240px"
+ value-format="yyyy-MM-dd"
+ type="daterange"
+ range-separator="-"
+ start-placeholder="开始日期"
+ end-placeholder="结束日期"
+ ></el-date-picker>
<el-button
type="primary"
@@ -142,7 +153,11 @@
@cell-dblclick="enterDetails"
<el-table-column type="selection" align="center" />
- <el-table-column label="编号" align="center" prop="boCode" />
+ <el-table-column
+ label="编号"
+ align="center"
+ prop="boCode"
+ />
<el-table-column label="商机名称" align="center" prop="boName" />
<el-table-column label="商机类型" align="center" prop="boType">
<template slot-scope="scope">
@@ -168,7 +183,7 @@
<el-table-column label="商机阶段" align="center" prop="boStageName" />
<el-table-column label="客户名称" align="center" prop="customerName" />
<el-table-column
- label="医院耗材预估值(万元)"
+ label="预估值(万元)"
align="center"
prop="hosDiscreetValue"
@@ -200,6 +215,7 @@
fixed="right"
class-name="small-padding fixed-width"
+ width="250"
@@ -223,13 +239,6 @@
@click="handleBrowse(scope.row)"
>查看</el-button
- <!-- <el-button
- size="mini"
- type="text"
- icon="el-icon-user"
- @click="allocation(scope.row)"
- >分配</el-button
- > -->
size="mini"
type="text"
@@ -341,7 +350,7 @@
<el-col :span="8">
- <el-form-item label="医院营收总额" prop="totalHosRevenue">
+ <el-form-item :label="totalRevenue" prop="totalHosRevenue">
<el-select
v-model="form.totalHosRevenue"
@change="totalHosRevenueChange"
@@ -359,7 +368,7 @@
<el-row>
<el-form-item
- label="医院耗材预估值(万元)"
+ :label="estimate"
<el-input-number
@@ -431,55 +440,13 @@
@click="submitForm"
v-if="this.operatingState != 'Browse'"
+ :disabled="submitButtonEditStatus"
>确 定</el-button
<el-button @click="cancel">取 消</el-button>
- <!-- 分配商机负责人对话框 -->
- title="分配商机负责人"
- :visible.sync="allocationPopover"
- width="500px"
- append-to-body
- :model="allocationForm"
- label-width="150px"
- :disabled="
- this.form.winningState > 0 || this.operatingState == 'Browse'
- "
- <el-form-item label="新负责人" prop="allocationStaff">
- <dr-input-dialog
- v-model="allocationForm.allocationStaffName"
- title="员工"
- type="SUPPLIER_PARAM"
- :dataMapping="{
- allocationStaff: 'id',
- allocationStaffName: 'name',
- }"
- :source="allocationForm"
- ></dr-input-dialog>
- <el-form-item label="是否将您作为参与人" prop="isParticipant">
- <el-radio v-model="allocationForm.isParticipant" label="1"
- >是</el-radio
- <el-radio v-model="allocationForm.isParticipant" label="0"
- >否</el-radio
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitAllocationForm"
- >确 定</el-button
- <el-button @click="cancelAllocation">取 消</el-button>
<!-- 客户参照 -->
<CustomerRef
ref="customerSelect"
@@ -523,7 +490,6 @@ import OrgRef from "@/views/business/spd/bo/refer/org/index.vue";
import DeptRef from "@/views/business/spd/bo/refer/dept/index.vue";
import StaffRef from "@/views/business/spd/bo/refer/staff/index.vue";
-import DrInputDialog from "@/components/input-dialog/index.vue";
name: "Basic",
@@ -540,7 +506,6 @@ export default {
OrgRef,
DeptRef,
StaffRef,
- DrInputDialog,
@@ -633,15 +598,53 @@ export default {
//阶段列表
mk_bo_stage: [],
- //分配参数
- allocationForm: {
- allocationStaff: null,
- isParticipant: "1",
- //分配弹窗
- allocationPopover: false,
+ // 查询日期范围
+ dateRange: [],
+ //确定按钮是否可点
+ submitButtonEditStatus:false,
+ 'form.boType': {
this.getList();
@@ -649,43 +652,41 @@ export default {
/** 查询商机基础信息列表 */
getList() {
- listBasic(this.queryParams).then((response) => {
- this.basicList = response.rows;
- //对商机名称进行加*
- console.log(this.basicList);
- for (var i = 0; i < this.basicList.length; i++) {
- var arr = this.basicList[i].boName.split("-");
- this.basicList[i].boName =
- arr[0] +
- "-" +
- arr[1].substring(0, 2) +
- "******" +
- arr[1].substring(arr[1].length - 2, arr[1].length) +
- arr[2];
+ listBasic(this.addDateRange(this.queryParams, this.dateRange)).then(
+ (response) => {
+ this.basicList = response.rows;
+ //对商机名称进行加*
+ console.log(this.basicList);
+ for (var i = 0; i < this.basicList.length; i++) {
+ var arr = this.basicList[i].boName.split("-");
+ this.basicList[i].boName =
+ arr[0] +
+ "-" +
+ arr[1].substring(0, 2) +
+ "******" +
+ arr[1].substring(arr[1].length - 2, arr[1].length) +
+ arr[2];
- var customerName = this.basicList[i].customerName;
- this.basicList[i].customerName =
- customerName.substring(0, 2) +
- customerName.substring(
- customerName.length - 2,
- customerName.length
- );
+ var customerName = this.basicList[i].customerName;
+ this.basicList[i].customerName =
+ customerName.substring(0, 2) +
+ customerName.substring(
+ customerName.length - 2,
+ customerName.length
+ );
+ this.total = response.total;
- this.total = response.total;
// 取消按钮
cancel() {
this.open = false;
this.reset();
- //取消分配
- cancelAllocation() {
- this.allocationPopover = false;
// 表单重置
reset() {
this.form = {
@@ -728,6 +729,7 @@ export default {
/** 重置按钮操作 */
resetQuery() {
+ this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
@@ -779,11 +781,9 @@ export default {
this.title = "基础信息";
- allocation(row) {
- this.allocationPopover = true;
/** 提交按钮 */
submitForm() {
+ this.submitButtonEditStatus = true;
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
@@ -791,19 +791,20 @@ export default {
this.$modal.msgSuccess("修改成功");
+ this.submitButtonEditStatus = false;
} else {
addBasic(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
- //提交分配表单
- submitAllocationForm() {},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
@@ -999,7 +999,7 @@
<Filemanager
@reload="reload"
:form="form"
- :name="'设备清单'"
+ :name="'商机审议会'"
:fileName="form.amfBoFlow.businessCouncilAccessoryName"
:fileUrlid="form.amfBoFlow.businessCouncilAccessoryUrlId"
:fileCreateBy="form.amfBoFlow.businessCouncilAccessoryCreateBy"
@@ -1184,6 +1184,221 @@
</el-form>
+ <!-- 军队医疗设备商机页签 -->
+ <!-- 需求信息挖掘 -->
+ <el-tab-pane label="需求信息挖掘" name="t50101" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50101">
+ <el-descriptions >
+ <el-descriptions-item label="项目总额">
+ <div v-for="dict in dict.type.mk_bo_total_revenue" v-if="form.totalHosRevenue == dict.value">
+ <div>{{dict.label}}</div>
+ </el-descriptions-item>
+ <el-descriptions-item label="工程预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
+ </el-descriptions>
+ </el-tab-pane>
+ <!-- 商机审核 -->
+ <el-tab-pane label="商机审核" name="t50201" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50201">
+ <!-- 项目立项 -->
+ <el-tab-pane label="阶段动作" name="t50301" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50301">
+ <el-form :disabled="!isUpdate" :model="form.boEngineeringFlow" >
+ <el-form-item label="项目立项是否通过" prop="projectApproval">
+ <el-radio
+ v-model="form.boEngineeringFlow.projectApproval"
+ label="1"
+ label="0"
+ <Filemanager
+ @reload="reload"
+ :form="form"
+ :fileName="form.boEngineeringFlow.businessCouncilAccessoryName"
+ :fileUrlid="form.boEngineeringFlow.businessCouncilAccessoryUrlId"
+ :fileCreateBy="form.boEngineeringFlow.businessCouncilAccessoryCreateBy"
+ :field="'business_council_accessory'"
+ v-if="form.boEngineeringFlow.projectApproval == 1"
+ :name="'立项书'"
+ :fileName="form.boEngineeringFlow.projectProposalAccessoryName"
+ :fileUrlid="form.boEngineeringFlow.projectProposalAccessoryUrlId"
+ :fileCreateBy="form.boEngineeringFlow.projectProposalAccessoryCreateBy"
+ :field="'project_proposal_accessory'"
+ <el-form-item label="项目未通过原因:" prop="noPassCause" v-if="form.boEngineeringFlow.projectApproval == 0">
+ <el-row>
+ <el-col
+ :span="8"
+ v-model="form.boEngineeringFlow.noPassCause"
+ <!-- 考察 -->
+ <el-tab-pane label="考察" name="t50401" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50401">
+ <el-form :inline="true" :disabled="!isUpdate" :model="form.boEngineeringFlow" >
+ <el-form-item label="考察开始日期" prop="impowerStartTime" >
+ v-model="form.boEngineeringFlow.inspectStartTime">
+ </el-date-picker>
+ <el-form-item label="考察结束日期" prop="impowerEndTime" >
+ v-model="form.boEngineeringFlow.inspectEndTime">
+ :name="'考察报告'"
+ :fileName="form.boEngineeringFlow.investigationReportAccessoryName"
+ :fileUrlid="form.boEngineeringFlow.investigationReportAccessoryUrlId"
+ :fileCreateBy="form.boEngineeringFlow.investigationReportAccessoryCreateBy"
+ :field="'investigation_report_accessory'"
+ <!-- 解决方案 -->
+ <el-tab-pane label="解决方案" name="t50501" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50501">
+ <el-form-item label="院方决策人" prop="hospitalPolicymaker" >
+ <el-input v-model="form.boEngineeringFlow.hospitalPolicymaker" />
+ <el-form-item label="资源方决策人" prop="resourcePolicymaker" >
+ <el-input v-model="form.boEngineeringFlow.resourcePolicymaker" />
+ :name="'工程解决方案'"
+ :fileName="form.boEngineeringFlow.engineeringSolutionAccessoryName"
+ :fileUrlid="form.boEngineeringFlow.engineeringSolutionAccessoryUrlId"
+ :fileCreateBy="form.boEngineeringFlow.engineeringSolutionAccessoryCreateBy"
+ :field="'engineering_solution_accessory'"
+ <!-- 投标与签合同 -->
+ <el-tab-pane label="挂网投标" name="t50601" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50601">
+ <el-col :span="8">
+ <el-form-item label="挂网时间" prop="researchTime">
+ v-model="form.boEngineeringFlow.hangingTime"
+ :name="'投标书'"
+ :fileName="form.boEngineeringFlow.biddingDocumentsAccessoryName"
+ :fileUrlid="form.boEngineeringFlow.biddingDocumentsAccessoryUrlId"
+ :fileCreateBy="form.boEngineeringFlow.biddingDocumentsAccessoryCreateBy"
+ :field="'bidding_documents_accessory'"
+ <el-col :span="5">
+ <el-form-item label="投标是否通过" prop="biddingDocumentsPass">
+ v-model="form.boEngineeringFlow.biddingDocumentsPass"
+ <el-row v-show="this.form.boEngineeringFlow.biddingDocumentsPass == '1'">
+ <el-form-item label="我方优势" prop="ourAdvantage">
+ v-model="form.boEngineeringFlow.ourAdvantage"
+ <el-row v-show="this.form.boEngineeringFlow.biddingDocumentsPass == '0'">
+ <el-form-item label="我方劣势" prop="ourAdvantage">
+ <el-row v-if="form.boEngineeringFlow.biddingDocumentsPass == 1">
+ :name="'中标通知书'"
+ :fileName="form.boEngineeringFlow.letterAcceptanceAccessoryName"
+ :fileUrlid="form.boEngineeringFlow.letterAcceptanceAccessoryUrlId"
+ :fileCreateBy="form.boEngineeringFlow.letterAcceptanceAccessoryCreateBy"
+ :field="'letter_acceptance_accessory'"
+ <el-tab-pane label="合同签订" name="t50602" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50602">
+ <el-form :disabled="!isUpdate" :model="form.boEngineeringFlow">
+ <el-form-item label="合同签订时间" prop="contractSigningTime">
+ v-model="form.boEngineeringFlow.contractSigningTime"
+ :name="'合同文件'"
+ :fileName="form.boEngineeringFlow.contractDocumentAccessoryName"
+ :fileUrlid="form.boEngineeringFlow.contractDocumentAccessoryUrlId"
+ :fileCreateBy="form.boEngineeringFlow.contractDocumentAccessoryCreateBy"
+ :field="'contract_document_accessory'"
<!-- 公用页签 -->
<el-tab-pane label="项目成员" name="tB" style="height: 200px; overflow-y: scroll" v-if="tabsName.B">
@@ -1307,6 +1522,14 @@ export default {
t40701:false,
t40702:false,
+ t50101:false,
+ t50201:false,
+ t50301:false,
+ t50401:false,
+ t50501:false,
+ t50601:false,
+ t50602:false,
A:false,
B:false,
@@ -1621,6 +1844,32 @@ export default {
this.tabsName.t40702 = true;
this.tabsName.A = true;
break;
+ case '5-01':
+ this.activeName = 't50101';
+ this.tabsName.t50101 = true;
+ case '5-02':
+ this.activeName = 't50301';
+ this.tabsName.t50301 = true;
+ this.tabsName.B = true;
+ this.tabsName.A = true;
+ case '5-03':
+ this.activeName = 't50401';
+ this.tabsName.t50401 = true;
+ case '5-04':
+ this.activeName = 't50501';
+ this.tabsName.t50501 = true;
+ case '5-05':
+ this.activeName = 't50601';
+ this.tabsName.t50601 = true;
+ this.tabsName.t50602 = true;
default:
@@ -1675,6 +1924,14 @@ export default {
@@ -75,7 +75,8 @@
<el-table-column label="销售组织" align="center" prop="salesOrgName" v-if="source == 'Behavior'"/>
<el-table-column label="部门" align="center" prop="deptName" v-if="source == 'Behavior'"/>
- <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true">
+ <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
+ <!-- <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true"> -->
@@ -396,6 +397,7 @@ export default {
+ console.log('this.boAuthority',this.boAuthority);
if(this.source == 'Behavior'){
this.queryParams = this.bo;
@@ -409,7 +411,6 @@ export default {
this.queryParams.taskCode = this.bo.code;
console.log("this.bo", this.bo);
- console.log("this.queryParams", this.queryParams);
@@ -15,7 +15,7 @@
- <BehaviorList :key="timer" :source = "'Behavior'" :bo="queryParams" />
+ <BehaviorList :key="timer" :source = "'Behavior'" :bo="queryParams" :boAuthority="boAuthority" />
@@ -78,6 +78,15 @@ export default {
//重新加载子组件参数
timer: '',
+ //行动权限写死
+ boAuthority:{
+ behaviorAdd:true,
+ behaviorEdit:true,
+ behaviorView:true,
+ behaviorDel:true,
@@ -449,6 +449,8 @@ export default {
if(this.source == 'BoDetails'){
this.queryParams.customer = this.bo.customer;
+ let params = {"post":this.boAuthority.post};
+ this.queryParams.params = params;
if(this.source == 'Contact'){
@@ -222,7 +222,7 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- <ContactList :key="timer" :source = "'Contact'" :bo="this.queryParams" />
+ <ContactList :key="timer" :source = "'Contact'" :bo="this.queryParams" :boAuthority="boAuthority" />
@@ -333,6 +333,15 @@ export default {
+ //列表权限写死
+ contactAdd:true,
+ contactEdit:true,
+ contactView:true,
+ contactDel:true,
@@ -89,7 +89,9 @@
v-model="form.enrollDate"
type="date"
value-format="yyyy-MM-dd"
- placeholder="请选择入学日期">
+ placeholder="请选择入学日期"
+ :picker-options="editStartOptions"
</el-date-picker>
<el-form-item label="毕业日期" prop="graduationDate">
@@ -97,7 +99,9 @@
v-model="form.graduationDate"
- placeholder="请选择毕业日期">
+ placeholder="请选择毕业日期"
+ :picker-options="editStopOptions"
<el-form-item label="学校名称" prop="school">
@@ -170,10 +174,10 @@ export default {
// 表单校验
rules: {
enrollDate: [
- { required: true, message: "入学日期不能为空", trigger: "blur" }
+ { required: true, message: "入学日期不能为空", trigger: ["blur", "change"] }
],
graduationDate: [
- { required: true, message: "毕业日期不能为空", trigger: "blur" }
+ { required: true, message: "毕业日期不能为空", trigger: ["blur", "change"] }
school: [
{ required: true, message: "学校名称不能为空", trigger: "blur" }
@@ -181,7 +185,24 @@ export default {
education: [
{ required: true, message: "学历不能为空", trigger: "blur" }
+ editStartOptions: {
+ disabledDate: time => {
+ if (!this.form.graduationDate) {
+ return time.getTime() < new Date(1970 - 1 - 1).getTime(); //禁止选择1970年以前的日期
+ } else {
+ return time.getTime() > new Date(this.form.graduationDate);
+ editStopOptions: {
+ return (
+ time.getTime() < new Date(this.form.enrollDate) ||
+ time.getTime() < new Date(1970 - 1 - 1).getTime() //禁止选择1970年以前的日期
@@ -2,11 +2,18 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="商机类型" prop="boType">
- v-model="queryParams.url"
+ <el-select
+ v-model="queryParams.boType"
+ @change="boTypeChange"
clearable
- @keyup.enter.native="handleQuery"
- />
+ <el-option
+ v-for="dict in dict.type.mk_bo_type"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value"
+ ></el-option>
+ </el-select>
<el-form-item label="模板名称" prop="name">
<el-input
@@ -47,6 +54,8 @@
</el-table-column>
<el-table-column label="模板名称" align="center" prop="name" />
+ <el-table-column label="上传者" align="center" prop="createByName" />
+ <el-table-column label="上传时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -176,6 +185,11 @@ export default {
+ /** 搜索按钮操作 */
+ handleQuery() {
+ this.queryParams.pageNum = 1;
+ this.getList();
/** 查询文件模板列表 */
@@ -2,11 +2,12 @@
<el-form-item label="商机日期" prop="code">
- v-model="queryParams.code"
+ type="month"
+ v-model="queryParams.yearMonth"
+ placeholder="选择月份"
@@ -104,6 +105,7 @@ export default {
queryParams: {
pageNum: 1,
+ yearMonth: null,
boType: null,
boSource: null,
deptName: null,
@@ -116,7 +118,6 @@ export default {
- this.queryParams.boType = 0;
@@ -159,6 +160,7 @@ export default {
/** 搜索按钮操作 */
handleQuery() {
+ console.log('this.queryParams',this.queryParams);
this.queryParams.pageNum = 1;
@@ -252,6 +252,7 @@
placeholder="请选开始时间"
@@ -264,6 +265,7 @@
placeholder="请选择截止时间"
@@ -532,10 +534,10 @@ export default {
{ required: true, message: "负责人不能为空", trigger: "blur" },
startTime: [
- { required: true, message: "开始时间不能为空", trigger: "blur" },
+ { required: true, message: "开始时间不能为空", trigger: ["blur", "change"] },
deadlineTime: [
- { required: true, message: "截止时间不能为空", trigger: "blur" },
+ { required: true, message: "截止时间不能为空", trigger: ["blur", "change"] },
content: [
{ required: true, message: "任务内容不能为空", trigger: "blur" },
@@ -545,6 +547,23 @@ export default {
//当前操作状态
operatingState: "",
+ if (!this.form.deadlineTime) {
+ return time.getTime() > new Date(this.form.deadlineTime);
+ time.getTime() < new Date(this.form.startTime) ||
-export function list(url, params) {
- url: `/pu/contract/${url}/list`,
-export function refer(data) {
- url: `/refer/query`,
@@ -1,214 +0,0 @@
-import { initParams } from "./utils/init-something";
-import { list } from "./api/index";
- name: "CurrencyInputDialog",
- props: ["title", "value"],
- components: {},
- const columns = [
- {
- key: "name",
- title: "币种",
- type: "Input",
- search: true,
- key: "code",
- title: "币种简称",
- key: "",
- title: "单价精度",
- title: "单价舍入规则",
- title: "金额精度",
- title: "金额舍入规则",
- const initTableColumns = () => columns.filter((column) => column.key);
- const initSearchColumns = () => columns.filter((column) => column.search);
- // global
- size: "mini",
- width: "50%",
- page: { pageNum: 1, pageSize: 25, total: 0 },
- pageSizes: [25, 50],
- layout: "prev, pager, next, jumper",
- api: "puCurrType",
- showKey: "name",
- // dialog
- // search
- searchColumns: initSearchColumns(),
- params: initParams(initSearchColumns()),
- // table
- tableColumns: initTableColumns(),
- data: [],
- currentData: null,
- computed: {},
- watch: {},
- // set dialog visible
- setVisible(prop) {
- this.visible = prop;
- // do something before dialog open
- beforeOpen() {
- const { value } = this.$props;
- this.params[this.showKey] = value;
- this.fetchList(this.params, this.page);
- // fetch table data
- async fetchList(prop, page) {
- const { pageNum, pageSize } = page;
- const { code, msg, rows, total } = await list(this.api, {
- pageNum,
- pageSize,
- if (code === 200) {
- this.data = rows;
- this.page.total = total;
- this.$notify.success({ title: msg });
- } else {
- this.$notify.warning({ title: msg });
- this.$notify.error({ title: "error", message: err });
- this.setCurrentData(
- this.data.find(
- (column) => column[this.showKey] === this.currentData[this.showKey]
- )
- // setting up to fetch table data
- queryList() {
- // reset to fetch table data
- resetList() {
- this.page.pageNum = 1;
- this.params = initParams(this.searchColumns);
- // size change to fetch table data
- pageSizeChange(prop) {
- this.page.pageSize = prop;
- // number change to fetch table data
- pageNumberChange(prop) {
- this.page.pageNum = prop;
- // select row data
- selectCurrentData(row) {
- this.currentData = row;
- // set row data highlight
- setCurrentData(row) {
- this.$refs.singleTable.setCurrentRow(row);
- //
- confirm() {
- if (this.currentData) {
- this.$emit("confirm", this.currentData);
- this.setVisible(false);
- created() {},
- :width="width"
- @open="beforeOpen"
- <el-button icon="el-icon-refresh" @click="resetList"></el-button>
- :data="data"
- ref="singleTable"
- height="45vh"
- highlight-current-row
- style="width: 100%; margin-bottom: 20px"
- @row-click="selectCurrentData"
- v-for="(column, index) in tableColumns"
- :prop="column.key"
- :width="column.width"
- show-overflow-tooltip
- <div
- style="display: flex; justify-content: space-between; align-items: center"
- <p>
- <span style="font-size: 12px">已选择 :</span>
- <el-tag v-if="currentData" :size="size">{{
- currentData[showKey]
- }}</el-tag>
- <span v-else>无</span>
- </p>
- :layout="layout"
- :total="page.total"
- :page-sizes="pageSizes"
- :page-size="page.pageSize"
- :current-page="page.pageNum"
- :small="size === 'mini'"
- background
- @size-change="pageSizeChange"
- @current-change="pageNumberChange"
- <div style="margin-top: 20px; text-align: right">
- <el-button :size="size" @click="visible = false">取 消</el-button>
- <el-button :size="size" type="primary" @click="confirm">确 定</el-button>
-<style scoped></style>
@@ -1,198 +0,0 @@
- name: "DepartmentInputDialog",
- key: "deptId",
- title: "组织编码",
- key: "deptName",
- title: "组织名称",
- api: "puDept",
- showKey: "deptName",
@@ -1,20 +0,0 @@
-// 员工
-import user from "./user.vue";
-// 组织
-import organization from "./organization.vue";
-// 部门
-import department from "./department.vue";
-// 供应商
-import supplier from "./supplier.vue";
-// 税率
-import tax from "./tax.vue";
-// 币种
-import currency from "./currency.vue";
-export const User = user;
-export const Organization = organization;
-export const Department = department;
-export const Supplier = supplier;
-export const Tax = tax;
-export const Currency = currency;
-export default { Tax, User, Supplier, Currency, Department, Organization };
@@ -1,204 +0,0 @@
-import { list, refer } from "./api/index";
-import { initParams } from "@/utils/init-something";
- name: "OrganizationInputDialog",
- api: "puOrg",
- // const { code, msg, rows, total } = await refer({
- // pageNum,
- // pageSize,
- // isPage: true,
- // type: "ORG_PARAM",
- // });
@@ -1,203 +0,0 @@
- name: "PaymentPlanInputDialog",
- title: "付款协议名称",
- title: "付款协议编码",
- title: "管理组织",
- title: "有效期开始时间",
- title: "有效期结束时间",
- title: "说明",
- api: "puTaxRate",
- showKey: "mattaxesname",
- this.params.deptName = value;
- name: "SupplierInputDialog",
- title: "供应商编码",
- title: "供应商名称",
- api: "puSupplier",
- name: "TaxInputDialog",
- key: "mattaxesname",
- title: "税目税率名称",
- key: "mattaxescode",
- title: "税目税率编码",
@@ -1,226 +0,0 @@
- name: "UserInputDialog",
- props: ["title"],
- key: "userName",
- title: "员工姓名",
- key: "userId",
- title: "员工编码",
- key: "orgName",
- title: "任职(兼职)组织",
- width: 200,
- title: "部门",
- title: "岗位",
- key: "email",
- title: "邮箱",
- title: "职位",
- api: "puPersonnel",
- showKey: "userName",
@@ -1,3 +0,0 @@
-import { arr2obj } from "@/utils/data-transform";
@@ -1,7 +1,7 @@
<!-- 经销商授权信息 编辑新增-->
<el-dialog :title="isAdd ? '新增' : '编辑'" :visible.sync="visible" :close-on-click-modal="false"
- :close-on-press-escape="false" :before-close="beforeClose">
+ :close-on-press-escape="false" :before-close="beforeClose" @close="$emit('close')">
<el-form :model="formData" ref="authprivAdd" label-position="left" label-width="120px" v-loading="loading">
<el-form-item v-for="column in formColumns" :label="column.title" :prop="column.key"
@@ -27,43 +27,30 @@
-import dealerApi from '@/api/marketing/dealer-authorization'
+import dealerApi from '@/api/marketing/dealer-authorization';
+import { FormColumns } from './column';
+import { initParams } from '../utils/init'
+const initFormColumns = () =>
+ FormColumns.map((column) => {
+ const clearable = column.clearable || true;
+ ...column,
+ clearable,
name: 'authprivAdd',
- const arr2Obj = function (data, keyName, valueName) {
- return Object.fromEntries(
- data.map((item) => [item[keyName], item[valueName]])
- const formColumns = [
- { title: '经销商名称', key: 'dealerName', type: 'Input' },
- { title: '授权区/医院', key: 'authorizedAreaName', type: 'Input' },
- { title: '授权产品', key: 'authorizedProductsName', type: 'Input' },
- { title: '授权期限', key: 'time', type: 'DateRange' },
- { title: '授权书开具时间', key: 'issueTime', type: 'Date' },
- const initFormColumns = () =>
- formColumns.map((column) => {
- const clearable = column.clearable || true;
- ...column,
- clearable,
- const initFormData = () => arr2Obj(initFormColumns(), "key", "value")
isAdd: true,
- formData: { ...initFormData() },
+ formData: { ...initParams(initFormColumns()) },
formColumns: initFormColumns(),
@@ -71,41 +58,41 @@ export default {
// 控制弹窗展示
setVisible(val) {
this.visible = val;
setFormData(data) {
if (data.id) {
+ this.isAdd = false;
let objData = { ...data };
objData['time'] = [objData.startTime, objData.endTime];
- // delete data.startTime
- // delete data.endTime
this.formData = objData;
+ setTimeout(() => {
+ }, 250);
+ return
- setTimeout(() => {
- }, 250);
+ this.isAdd = true;
// 重置表单数据
handleResetData() {
- for (const key in this.formData) {
- this.formData[key] = '';
+ this.formData = {
+ ...initParams(initFormColumns())
this.$refs['authprivAdd'].clearValidate();
// 取消
handleCancel() {
- this.handleResetData();
+ this.handleResetData();
this.setVisible(false);
// 确定
@@ -113,35 +100,48 @@ export default {
console.log(this.formData, 'this.formData');
- this.$refs[formName].validate((valid) => {
+ this.$refs[formName].validate(async (valid) => {
// 校验通过
let isTime = this.formData.time && this.formData.time != '' && this.formData.time.length;
+ const { name, id, } = this.$store.state.user;
let params = {
...this.formData,
startTime: isTime ? this.formData.time[0] : '',
endTime: isTime ? this.formData.time[1] : '',
+ updatePerson: name,
+ updateTime: new Date().Format('yyyy-MM-dd HH:mm:ss'),
+ ...(
+ this.isAdd ? {
+ status: '0',
+ createPerson: name,
+ createTime: new Date().Format('yyyy-MM-dd HH:mm:ss'),
+ } : {}
+ )
delete params['time']
console.log(params, 'params--------');
- if (this.isAdd) {
- // 新增
- dealerApi.dealerInsert(params).then(res => {
- }).catch(error => {
- })
- // 编辑
- dealerApi.dealerUpdate(params).then(res => {
+ try {
+ let { code, msg } = await (this.isAdd ?
+ dealerApi.insert(params) :
+ dealerApi.update(params))
+ if (code === 200) {
+ this.handleCancel();
+ } catch (error) {
+ console.log(error, 'error');
+ } finally {
- // this.setVisible(false);
console.log('error submit!!');
return false;
@@ -0,0 +1,56 @@
+export const TableColumns = [
+ { key: "authorizedProductsCode", title: "授权产品 编码", show: true, width: 160 },
+ { key: "dealerName", title: "经销商名称", show: true, width: 200 },
+ { key: "authorizedAreaCode", title: "授权区域/医院 编码", show: false, },
+ { key: "authorizedAreaName", title: "授权区域/医院 名称", show: true, width: 200 },
+ { key: "authorizedProductsName", title: "授权产品 名称", show: true, width: 200 },
+ { key: "status", title: "状态", show: true },
+ { key: "createPerson", title: "创建人", show: true },
+ { key: "createTime", title: "创建时间", show: true, width: 160 },
+ { key: "updatePerson", title: "最后修改人", show: true },
+ { key: "updateTime", title: "最后修改时间", show: true, width: 160 },
+ { key: "id", title: "主键id----该值不显示", show: false },
+ { key: "startTime", title: "开始时间", show: false },
+ { key: "endTime", title: "结束时间", show: false },
+ { key: "issueTime", title: "授权书开具时间", show: false },
+]
+export const SearchColumns = [
+ { key: "dealerName", title: "经销商名称", type: "Input" },
+ { key: "authorizedAreaName", title: "授权区域/医院", type: "Input" },
+ { key: "authorizedProductsName", title: "授权产品", type: "Input" },
+ // 单据状态0=自由态,1=审批中,2=已审核,3=已驳回
+ key: "status", title: "状态", type: "Select", options: [
+ { value: 0, label: '自由态' },
+ { value: 1, label: '审批中' },
+ { value: 2, label: '已审核' },
+ { value: 3, label: '已驳回' },
+ ]
+ // { title: "授权时间", key: "time", type: "DateRange" },
+ title: "授权时间",
+ key: "startTime",
+ type: "Date",
+ config: {
+ placeholder: '开始时间'
+ title: "至",
+ key: "endTime",
+ placeholder: '结束时间'
+export const FormColumns = [
+ { title: '经销商名称', key: 'dealerName', type: 'Input' },
+ { title: '授权区/医院', key: 'authorizedAreaName', type: 'Input' },
+ { title: '授权产品', key: 'authorizedProductsName', type: 'Input' },
+ { title: '授权期限', key: 'time', type: 'DateRange' },
+ { title: '授权书开具时间', key: 'issueTime', type: 'Date' },
@@ -2,7 +2,7 @@
<el-card class="dealerAuthorization" v-loading="loading" :body-style="{ padding: 0 }">
- <authprivAdd ref="addDialogRef"></authprivAdd>
+ <authprivAdd ref="addDialogRef" @close="handleRefresh"></authprivAdd>
<authprivSee ref="seeDialogRef"></authprivSee>
<!-- 检索区 -->
@@ -13,14 +13,18 @@
<el-input v-if="column.type == 'Input'" v-model="searchParams[column.key]" clearable></el-input>
- <el-select v-if="column.type == 'Select'" v-model="searchParams[column.key]" clearable>
+ <el-select v-else-if="column.type == 'Select'" v-model="searchParams[column.key]" clearable>
<el-option v-for="op in column.options" :label="op.label" :value="op.value"></el-option>
- <el-date-picker v-if="column.type == 'DateRange'" v-model="searchParams[column.key]" clearable type="daterange"
- format="yyyy-MM-dd " value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
+ <el-date-picker v-else-if="column.type == 'DateRange'" v-model="searchParams[column.key]" clearable
+ type="daterange" format="yyyy-MM-dd " value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
end-placeholder="结束日期">
+ <el-date-picker v-else-if="column.type == 'Date'" v-model="searchParams[column.key]" format="yyyy-MM-dd "
+ clearable value-format="yyyy-MM-dd" type="date" :placeholder="column.config.placeholder" style="width: 192px;">
@@ -36,7 +40,7 @@
<el-col :span="24" style="text-align: right">
<el-button size="mini" type="primary" @click="handleOpenAddDialog"
v-hasPermi="['pu:authorization:add']">新增</el-button>
- <el-button size="mini" @click="handleSubmit">提交</el-button>
+ <!-- <el-button size="mini" @click="handleSubmit">提交</el-button> -->
<el-button size="mini" @click="handleDownload">下载授权书</el-button>
@@ -44,147 +48,102 @@
<!-- 数据展示 -->
<el-table class="da-table" @row-dblclick="handleOpenSeeDialog" @select="handleSelect" :data="tableData"
highlight-current-row max-height="500">
- <el-table-column type="selection" width="35"></el-table-column>
+ <el-table-column type="selection" width="45"></el-table-column>
<el-table-column type="index" width="55" label="序号"></el-table-column>
<el-table-column v-for="column in tableColumns" :label="column.title" v-if="column.show"
- :width="column.width || 180">
+ :width="column.width || 120" show-overflow-tooltip>
{{ column.key == 'status' ? judgeStatus(scope.row[column.key]) : scope.row[column.key] }}
<el-table-column fixed="right" label="操作" width="120">
- <el-button type="text" size="small" @click="handleOpenAddDialog(scope.row)"
+ <el-button type="text" size="mini" @click="handleOpenAddDialog(scope.row)"
v-hasPermi="['pu:authorization:edit']">编辑</el-button>
- <el-button type="text" size="small" @click="handleDelDialog(scope.row)"
+ <el-button type="text" size="mini" @click="handleDelDialog(scope.row)"
+ v-if="scope.row.status == '0' || scope.row.status == '3'"
v-hasPermi="['pu:authorization:remove']">删除</el-button>
- <el-button @click="handleOpenSeeDialog(scope.row)" type="text" size="small">查看</el-button>
+ <!-- <el-button @click="handleOpenSeeDialog(scope.row)" type="text" size="small">查看</el-button> -->
+ <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'"
+ @click="handleSubmit(scope.row)">提交</el-button>
</el-table>
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="total"
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="page.total"
:page-sizes="pageSizes" :page-size="page.pageSize" :current-page="page.pageNum" hide-on-single-page
- layout="total, prev, pager, next, sizes, jumper">
+ :layout="layout">
</el-pagination>
</el-card>
-import authprivAdd from './authprivAdd.vue';
-import authprivSee from './authprivSee.vue';
+import { TableColumns, SearchColumns } from './column';
+import { initParams } from '../utils/init';
name: 'dealerAuthorization',
- authprivAdd,
- authprivSee,
+ authprivAdd: () => import('./authprivAdd.vue'),
+ authprivSee: () => import('./authprivSee.vue'),
- // 查询条件列
- const searchColumns = [
- { key: "dealerName", title: "经销商名称", type: "Input" },
- { key: "authorizedAreaName", title: "授权区域/医院", type: "Input" },
- { key: "authorizedProductsName", title: "授权产品", type: "Input" },
- // 单据状态0=自由态,1=审批中,2=已审核,3=已驳回
- key: "status", title: "状态", type: "Select", options: [
- { value: 0, label: '自由态' },
- { value: 1, label: '审批中' },
- { value: 2, label: '已审核' },
- { value: 3, label: '已驳回' },
- ]
- { title: "授权时间", key: "time", type: "DateRange" },
- // 表列
- const tableColumns = [
- { key: "authorizedProductsCode", title: "授权产品 编码", show: true },
- { key: "dealerName", title: "经销商名称", show: true },
- { key: "authorizedAreaCode", title: "授权区域/医院 编码", show: false },
- { key: "authorizedAreaName", title: "授权区域/医院 名称", show: true },
- { key: "authorizedProductsName", title: "授权产品 名称", show: true },
- { key: "status", title: "状态", show: true },
- { key: "createPerson", title: "创建人", show: true },
- { key: "createTime", title: "创建时间", show: true },
- { key: "updatePerson", title: "最后修改人", show: true },
- { key: "updateTime", title: "最后修改时间", show: true },
- { key: "id", title: "主键id----该值不显示", show: false },
- { key: "startTime", title: "开始时间", show: false },
- { key: "endTime", title: "结束时间", show: false },
- { key: "issueTime", title: "授权书开具时间", show: false },
- const initTableColumns = () => tableColumns;
- const initSearchColumns = () => searchColumns;
- const initSearchParams = () => arr2Obj(initSearchColumns(), "key", "value");
+ const initTableColumns = () => TableColumns;
+ const initSearchColumns = () => SearchColumns;
searchColumns: initSearchColumns(),
searchParams: {
- // isAsc: "desc",
- // reasonable: "",
- // orderByColumn: "",
- ...initSearchParams(),
+ ...initParams(initSearchColumns()),
tableColumns: initTableColumns(),
- tableData: [
- authorizedProductsCode: "授权产品 编码",
- dealerName: "经销商名称",
- authorizedAreaCode: "授权区域/医院 编码",
- authorizedAreaName: "授权区域/医院 名称",
- authorizedProductsName: "授权产品 名称",
- status: "0",
- createPerson: "创建人",
- createTime: "创建时间",
- updatePerson: "最后修改人",
- updateTime: "最后修改时间",
- id: "主键id----该值不显示",
- startTime: "2023-01-02",
- endTime: "2025-01-01",
- issueTime: "2023-01-02",
+ tableData: [],
checkedList: [],
- page: { pageNum: 1, pageSize: 25 },
+ page: {
+ pageNum: 1,
+ pageSize: 25,
+ total: 0
pageSizes: [10, 20, 50, 100],
+ layout: 'total, prev, pager, next, sizes, jumper',
// 查询---列表查询
- handelSearch() {
+ async handelSearch() {
console.log(this.searchParams, '查询');
- let isTime = this.searchParams.time && this.searchParams.time != '' && this.searchParams.time.length;
+ // let isTime = this.searchParams.time && this.searchParams.time != '' && this.searchParams.time.length;
+ let { pageNum, pageSize } = this.page;
...this.searchParams,
- startTime: isTime ? this.searchParams.time[0] : '',
- endTime: isTime ? this.searchParams.time[1] : '',
+ // startTime: isTime ? this.searchParams.time[0] : '',
+ // endTime: isTime ? this.searchParams.time[1] : '',
+ pageNum: pageNum,
+ pageSize: pageSize,
- dealerApi.dealerList(params, this.page).then(res => {
+ await dealerApi.list(params).then(res => {
console.log(res, '获取列表');
+ let { code, rows, total } = res;
this.loading = false;
+ if (code == 200) {
+ this.tableData = rows;
+ this.page.total = total;
}).catch(error => {
// 重置
handelResetSearch() {
console.log('重置');
for (const key in this.searchParams) {
@@ -217,7 +176,7 @@ export default {
// 刷新
handleRefresh() {
+ this.handelSearch();
handleSizeChange(e) {
this.page.pageSize = e;
@@ -249,38 +208,60 @@ export default {
// 删除
- handleDelDialog(rows) {
+ async handleDelDialog(rows) {
console.log(rows, '删除');
- // dealerApi.dealerDelete().then(res => {
- // console.log(res, '删除');
- // }).catch(error => {
- // })
+ let { id } = rows;
+ let { code, msg } = await dealerApi.remove({ id });
+ this.handleRefresh();
+ console.log(error);
// 提交
- handleSubmit() {
- console.log('批量提交');
+ handleSubmit(row) {
+ console.log(row, '提交');
id: '',
status: ''
- // dealerApi.dealerUpdate(params).then(res => {
- // console.log(res, '编辑');
+ // try {
+ // this.loading = true;
+ // let { code, msg } = await dealerApi.submitOA();
+ // if (code == 200) {
+ // this.handleRefresh();
+ // }
+ // } catch (error) {
+ // console.log(error);
+ // } finally {
+ // this.loading = false;
// 下载
handleDownload() {
console.log('下载');
+ // let { code, msg } = await dealerApi.download();
+ // } finally {}
+// 对Date的扩展,将 Date 转化为指定格式的String
+// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
+// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
+// 例子:
+// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
+// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
+Date.prototype.Format = function (fmt) {
+ var o = {
+ "M+": this.getMonth() + 1, //月份
+ "d+": this.getDate(), //日
+ "H+": this.getHours(), //小时
+ "m+": this.getMinutes(), //分
+ "s+": this.getSeconds(), //秒
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+ "S": this.getMilliseconds() //毫秒
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+ for (var k in o)
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+ return fmt;
@@ -0,0 +1,11 @@
+export const arr2Obj = function (data, keyName, valueName) {
+ return Object.fromEntries(
+ data.map((item) => [item[keyName], item[valueName]])
+export const initParams = (params) =>{
+ return arr2Obj(params, "key", "value")
@@ -145,6 +145,13 @@
prop="nickName"
+ label="任务员工编号"
+ width="80"
+ prop="enpno"
label="任务大类"
width="80"
@@ -3,8 +3,8 @@
<el-card>
<span>采购需求汇总详情</span>
<div class="btn_grooup">
- <el-button type="primary" size="small">编辑</el-button>
- <el-button type="primary" size="small">确定</el-button>
+ <el-button type="primary" size="small" @click="editLine">编辑</el-button>
+ <el-button type="success" size="small" v-if="!lineDisable" @click="saveLine">保存</el-button>
<el-button type="primary" size="small" @click="closeLine">行关闭</el-button>
<el-button type="primary" size="small">重取批量</el-button>
@@ -16,62 +16,94 @@
@selection-change="handleSelectionChange"
<el-table-column type="selection" width="55" />
- <el-table-column label="序号" align="center" prop="index"/>
+ <el-table-column label="序号" align="center" type="index"/>
<el-table-column label="行号" align="center" prop="rowNo"/>
- <el-table-column label="物料编码" align="center" prop="code"/>
- <el-table-column label="品名" align="center" prop="code"/>
- <el-table-column label="规格" align="center" prop="code"/>
- <el-table-column label="单位" align="center" prop="code"/>
+ <el-table-column label="物料编码" align="center" prop="materialCode"/>
+ <el-table-column label="品名" align="center" prop="materialName"/>
+ <el-table-column label="规格" align="center" prop="specification"/>
+ <el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
- <el-table-column label="末级供应仓库库存量" align="center" prop="code"/>
- <el-table-column label="月销量" align="center" prop="code"/>
- <el-table-column label="采购周期" align="center" prop="code"/>
- <el-table-column label="最终净需求量" align="center" prop="code"/>
- <el-table-column label="最终采购量" align="center" prop="code"/>
- <el-table-column label="需求客户" align="center" prop="code"/>
- <el-table-column label="最小订货量" align="center" prop="code"/>
- <el-table-column label="最小包装量" align="center" prop="code"/>
- <el-table-column label="修改人" align="center" prop="code"/>
- <el-table-column label="修改原因" align="center" prop="code"/>
- <el-table-column label="业务备注" align="center" prop="code"/>
- <el-table-column label="有效期" align="center" prop="code"/>
- <el-table-column label="要求交货日期" align="center" prop="code"/>
- <el-table-column label="紧急标识" align="center" prop="code"/>
- <el-table-column label="补单标识" align="center" prop="code"/>
+ <el-table-column label="末级供应仓库存量" align="center" prop="lastWarehouseQty"/>
+ <el-table-column label="月销量" align="center" prop="totalMonthlySales"/>
+ <el-table-column label="采购周期" align="center" prop="buyPeriod"/>
+ <el-table-column label="最终净需求量" align="center" prop="resDemandQty"/>
+ <el-table-column label="最终采购量" align="center" prop="puQtyRes"/>
+ <el-table-column label="需求客户" align="center" prop="customerName"/>
+ <el-table-column label="最小订货量" align="center" prop="minOrderQty"/>
+ <el-table-column label="最小包装量" align="center" prop="minPackage"/>
+ <el-table-column label="最小批量" align="center" prop="minBatch"/>
+ <el-table-column label="修改人" align="center" prop="updateByName"/>
+ <el-table-column label="修改原因" align="center" prop="updateCause"/>
+ <el-table-column label="业务备注" align="center" prop="remark"/>
+ <el-table-column label="有效期" align="center" prop="expiry"/>
+ <el-table-column label="要求交货日期" align="center" prop="deliveryDate"/>
+ <el-table-column label="紧急标识" align="center" prop="isUrgency">
+ <template slot-scope="scope">
+ <el-switch
+ v-model="scope.row.isUrgency"
+ :disabled="lineDisable"
+ active-value="Y"
+ inactive-value="N"
+ active-color="#13ce66"
+ inactive-color="#a1a3a9">
+ </el-switch>
+ </template>
+ </el-table-column>
+ <el-table-column label="补单标识" align="center" prop="isReplenishment">
+ v-model="scope.row.isReplenishment"
<el-table-column label="需求单单号" align="center" prop="code"/>
- <el-table-column label="供应仓库" align="center" prop="code"/>
- <el-table-column label="供应库位" align="center" prop="code"/>
- <el-table-column label="业务类型" align="center" prop="code"/>
- <el-table-column label="行状态" align="center" prop="code"/>
- <el-table-column label="收货仓库" align="center" prop="code"/>
- <el-table-column label="收货货位" align="center" prop="code"/>
- <el-table-column label="采购员" align="center" prop="code"/>
- <el-table-column label="制单人" align="center" prop="code"/>
- <el-table-column label="审核人员" align="center" prop="code"/>
- <el-table-column label="请购单号" align="center" prop="code"/>
- <el-table-column label="品类" align="center" prop="code"/>
- <el-table-column label="注册人" align="center" prop="code"/>
- <el-table-column label="集团预测分类" align="center" prop="code"/>
- <el-table-column label="修改时间" align="center" prop="code"/>
- <el-table-column label="采购员编码" align="center" prop="code"/>
- <el-table-column label="采购组织" align="center" prop="code"/>
- <el-table-column label="物料类别" align="center" prop="code"/>
- <el-table-column label="有效期单位" align="center" prop="code"/>
- <el-table-column label="最小批量" align="center" prop="code"/>
- <el-table-column label="业务部门" align="center" prop="code"/>
- <el-table-column label="需求部门" align="center" prop="code"/>
- <el-table-column label="批号锁定标识" align="center" prop="code"/>
- <el-table-column label="采购需求单审批人" align="center" prop="code"/>
- <el-table-column label="需求单审批时间" align="center" prop="code"/>
- <el-table-column label="需求单提交时间" align="center" prop="code"/>
- <el-table-column label="需求单提交人" align="center" prop="code"/>
- <el-table-column label="处理需求时间" align="center" prop="code"/>
- <el-table-column label="处理需求人员" align="center" prop="code"/>
- <el-table-column label="汇总确认人" align="center" prop="code"/>
- <el-table-column label="汇总确认时间" align="center" prop="code"/>
- <el-table-column label="转请购时间" align="center" prop="code"/>
- <el-table-column label="转请购人员" align="center" prop="code"/>
- <el-table-column label="价格类型" align="center" prop="code"/>
+ <el-table-column label="供应仓库" align="center" prop="lastWarehouseName"/>
+ <el-table-column label="供应货位" align="center" prop="lastAllocationName"/>
+ <el-table-column label="业务类型" align="center" prop="billType"/>
+ <el-table-column label="行状态" align="center" prop="status"/>
+ <el-table-column label="收货仓库" align="center" prop="deliveryWarehouseName"/>
+ <el-table-column label="收货货位" align="center" prop="deliveryAllocationName"/>
+ <el-table-column label="采购员" align="center" prop="buyerName"/>
+ <el-table-column label="制单人" align="center" prop="billMaker"/>
+ <el-table-column label="审核人员" align="center" prop="approver"/>
+ <!-- <el-table-column label="请购单号" align="center" prop="code"/> -->
+ <el-table-column label="品类" align="center" prop="materialCategory"/>
+ <el-table-column label="注册人" align="center" prop="registrant"/>
+ <el-table-column label="集团预测分类" align="center" prop="forecastClassify"/>
+ <el-table-column label="修改时间" align="center" prop="updateTime"/>
+ <el-table-column label="采购员编码" align="center" prop="buyer"/>
+ <el-table-column label="采购组织" align="center" prop="orgName"/>
+ <el-table-column label="有效期单位" align="center" prop="expiryUnit"/>
+ <el-table-column label="业务部门" align="center" prop="businessDeptName"/>
+ <el-table-column label="需求部门" align="center" prop="demandDeptName"/>
+ <el-table-column label="批号锁定标识" align="center" prop="isBatchLock">
+ v-model="scope.row.isBatchLock"
+ <el-table-column label="采购需求单审批人" align="center" prop="approveName"/>
+ <el-table-column label="需求单审批时间" align="center" prop="approverFinishTime"/>
+ <el-table-column label="需求单提交时间" align="center" prop="createTime"/>
+ <el-table-column label="需求单提交人" align="center" prop="createByName"/>
+ <el-table-column label="处理需求时间" align="center" prop="processTime"/>
+ <el-table-column label="处理需求人员" align="center" prop="processPersonal"/>
+ <el-table-column label="汇总确认人" align="center" prop="affirmer"/>
+ <el-table-column label="汇总确认时间" align="center" prop="affirmerTime"/>
+ <!-- <el-table-column label="转请购时间" align="center" prop="code"/>
+ <el-table-column label="转请购人员" align="center" prop="code"/> -->
+ <el-table-column label="价格类型" align="center" prop="priceType"/>
@@ -84,7 +116,7 @@
-import {getSummaryDetail, shutDownSummary } from '@/api/purchase/DemandSummary.js'
+import {getSummaryDetail, shutDownSummary, editSummaryMx } from '@/api/purchase/DemandSummary.js'
name: 'checkDemandSummary',
props: ['pageStu','row', 'disable'],
@@ -94,8 +126,12 @@ export default {
return{
+ // 不能直接改变props传来的值
+ sonPageStu: this.pageStu,
+ sonDisable: this.disable,
tableList: [],
- ids: []
+ ids: [],
+ lineDisable: true,
@@ -128,6 +164,19 @@ export default {
+ editLine() {
+ console.log('sonList`````', this.tableList)
+ this.lineDisable = false
+ saveLine() {
+ editSummaryMx(this.tableList).then(res => {
+ this.$modal.msgSuccess("保存成功");
+ this.lineDisable = true
+ this.getDetails(this.row)
// 行关闭
closeLine() {
if (this.ids.length == 0) {
@@ -4,45 +4,38 @@
<el-form class="search_area" label-width="120px">
<el-row :gutter="10">
<el-col :span="1.5">
- <el-form-item label="单据状态">
- <el-select v-model="queryParams.code" size="small" style="width: 200px" clearable>
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
+ <el-form-item label="行状态">
+ <el-select multiple v-model="queryParams.rowStatus" size="small" style="width: 200px" clearable>
+ <el-option v-for="dict in dict.type.sys_row_status" :key="dict.value" :label="dict.label" :value="dict.value">
</el-option>
<el-form-item label="采购员">
- v-model="queryParams.cgy"
- placeholder=""
- style="width: 200px"
+ <el-select size="small" v-model="queryParams.buyerName" @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')" style="width: 200px">
+ <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.id" />
<el-form-item label="品类">
- v-model="queryParams.pl"
+ v-model="queryParams.materialName"
size="small"
+ @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
style="width: 200px"
+ <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
<el-form-item label="生产厂家">
- v-model="queryParams.sccj"
+ v-model="queryParams.manufacturer"
@@ -50,8 +43,8 @@
<el-form-item label="" label-width="20px">
- <el-button type="primary" size="small" icon="el-icon-search" plain>搜索</el-button>
- <el-button size="small" icon="el-icon-refresh" plain>重置</el-button>
+ <el-button type="primary" size="small" icon="el-icon-search" plain @click="search">搜索</el-button>
+ <el-button size="small" icon="el-icon-refresh" plain @click="reset">重置</el-button>
@@ -60,55 +53,41 @@
<div v-show="expanded">
- <el-form-item label="物料类别">
- <el-select v-model="queryParams.wllb" size="small" style="width: 200px" clearable>
+ <el-form-item label="预测分类">
+ <el-select v-model="queryParams.forecastClassification" size="small" style="width: 200px" clearable>
<el-option
+ v-for="dict in dict.type.predictive_classify" :key="dict.value" :label="dict.label" :value="dict.value">
<el-form-item label="周期单位">
- <el-select v-model="queryParams.zqdw" size="small" style="width: 200px" clearable>
+ <el-select v-model="queryParams.periodUnit" size="small" style="width: 200px" clearable>
+ v-for="dict in dict.type.sys_period_unit" :key="dict.value" :label="dict.label" :value="dict.value">
<el-form-item label="业务部门">
- v-model="queryParams.ywbm"
+ <el-select size="small" v-model="queryParams.departmentName" @focus="chooseRefer('DEPT_PARAM', true, '业务部门')" style="width: 200px">
+ <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
<el-form-item label="审核人">
- v-model="queryParams.shr"
+ <el-select size="small" v-model="queryParams.puManagerAuditor" @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')" style="width: 200px">
+ <el-option v-for="item in auditOptions" :key="item.id" :label="item.name" :value="item.id" />
- <el-col :span="1.5">
+ <!-- <el-col :span="1.5">
<el-form-item label="转请购单号">
v-model="queryParams.zqgdh"
@@ -118,11 +97,11 @@
- </el-col>
+ </el-col> -->
<el-form-item label="采购需求单号">
- v-model="queryParams.cgxqdh"
+ v-model="queryParams.code"
placeholder=""
@@ -133,7 +112,7 @@
<el-form-item label="注册人">
- v-model="queryParams.zcr"
+ v-model="queryParams.registrant"
@@ -143,12 +122,9 @@
<el-form-item label="业务类型">
- <el-select v-model="queryParams.ywlx" size="small" style="width: 200px" clearable>
+ <el-select v-model="queryParams.businessType" size="small" style="width: 200px" clearable>
+ v-for="dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
@@ -158,46 +134,31 @@
<el-form-item label="单据来源">
- v-model="queryParams.zqgdh"
+ <el-select v-model="queryParams.billSource" size="small" style="width: 200px" clearable>
+ v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
+ </el-option>
<el-form-item label="需求客户">
+ <el-select size="small" v-model="queryParams.customer" @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
+ <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
<el-form-item label="末级供应仓库">
+ <el-select size="small" v-model="queryParams.lastWarehouse" @focus="chooseRefer('WAREHOUSE_PARAM', true, '末级供应仓库')" style="width: 200px">
+ <el-option v-for="item in lastWarehouseOptions" :key="item.id" :label="item.name" :value="item.id" />
<el-form-item label="末级供应库位">
- </el-option>
+ <el-select size="small" v-model="queryParams.lastAllocation" @focus="chooseRefer('ALLOCATION_PARAM', true, '末级供应库位')" style="width: 200px">
+ <el-option v-for="item in lastAllocationOptions" :key="item.id" :label="item.name" :value="item.id" />
@@ -206,38 +167,32 @@
<el-form-item label="物料编码">
+ <el-input readonly size="small" v-model="queryParams.names" style="width: 200px">
+ <el-button size="small" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
+ <el-input v-show="false" v-model="queryParams.materialCode"></el-input>
<el-form-item label="默认采购组织">
+ <el-select size="small" v-model="queryParams.purchaseOrg" @focus="chooseRefer('ORG_PARAM', true, '默认采购组织')" style="width: 200px">
+ <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
<el-form-item label="需求日期">
+ v-model="queryParams.demandDate"
+ type="date"
+ style="width: 200px"
<el-form-item label="转请购时间">
<el-select v-model="queryParams.ywlx" size="small" style="width: 200px" clearable>
@@ -248,30 +203,32 @@
<el-form-item label="汇总审核时间">
+ v-model="queryParams.auditTime"
<el-form-item label="汇总确认时间">
+ v-model="queryParams.yesTime"
@@ -282,8 +239,8 @@
- <el-button type="primary" size="small">保存</el-button>
+ <el-button type="primary" size="small" @click="editList">编辑</el-button>
+ <el-button type="success" size="small" v-if="!lineDisable" @click="saveList">保存</el-button>
<el-button type="primary" size="small" @click="confirms">确认</el-button>
<el-button type="primary" size="small" @click="cancels">取消</el-button>
<el-button type="primary" size="small" @click="audits">审核</el-button>
@@ -299,72 +256,95 @@
</el-dropdown-menu>
</el-dropdown>
- <el-button type="primary" size="small">转请购</el-button>
+ <!-- <el-button type="primary" size="small">转请购</el-button> -->
<el-table
:data="tableList"
fit
show-summary
- max-height="680"
+ max-height="480"
+ :key="isUpdate"
- <el-table-column label="一级品类" align="center" prop="code"/>
- <el-table-column label="单位" align="center" prop="demandUnit"/>
- <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
- <el-table-column label="需求单位数" align="center" prop="code"/>
- <el-table-column label="总最终净需求量" align="center" prop="code"/>
+ <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="120px"/>
+ <el-table-column label="物料编码" align="center" prop="materialCode" width="180px"/>
+ <el-table-column label="品名" align="center" prop="materialName" width="180px"/>
+ <el-table-column label="规格" align="center" prop="specification" width="200px"/>
+ <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="180px"/>
+ <el-table-column label="需求单位数" align="center" prop="demandNum" width="120px"/>
+ <el-table-column label="近1月月均需求" align="center" prop="evensalesforyear" width="120px"/>
+ <el-table-column label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="120px"/>
+ <el-table-column label="总最终净需求量" align="center" prop="netDemandNum" width="120px"/>
<el-table-column label="总月销量" align="center" prop="totalMonthlySales"/>
- <el-table-column label="需求可用周期" align="center" prop="demandCycle"/>
+ <el-table-column label="需求可用周期" align="center" prop="demandCycle" width="180px"/>
<el-table-column label="呆滞量" align="center" prop="dullQut"/>
<el-table-column label="采购周期" align="center" prop="buyPeriod"/>
- <el-table-column label="中心公共库存" align="center" prop="centralPublicStock"/>
- <el-table-column label="中心仓专属货位" align="center" prop="centralWarehouse"/>
- <el-table-column label="区域分仓公共库存" align="center" prop="regionPublicStock"/>
- <el-table-column label="各项目仓库存" align="center" prop="eachWarehouseStock"/>
+ <el-table-column label="中心公共库存" align="center" prop="centralPublicStock" width="120px"/>
+ <el-table-column label="中心仓专属货位" align="center" prop="centralWarehouse" width="120px"/>
+ <el-table-column label="区域分仓公共库存" align="center" prop="regionPublicStock" width="130px"/>
+ <el-table-column label="各项目仓库存" align="center" prop="eachWarehouseStock" width="120px"/>
<el-table-column label="电商仓库" align="center" prop="commerceWarehouse"/>
<el-table-column label="采购在途" align="center" prop="buyTransit"/>
<el-table-column label="借出在途" align="center" prop="lendTransit"/>
<el-table-column label="调拨在途" align="center" prop="transferTransit"/>
<el-table-column label="库存总计" align="center" prop="stockTotal"/>
- <el-table-column label="最小包装量" align="center" prop="minPackage"/>
- <el-table-column label="最小订货量" align="center" prop="minOrder"/>
+ <el-table-column label="最小包装量" align="center" prop="minPackage" width="100px"/>
+ <el-table-column label="最小订货量" align="center" prop="minOrder" width="100px"/>
<el-table-column label="最小批量" align="center" prop="minBatch"/>
- <el-table-column label="人工调整数" align="center" prop="artificialAdjust"/>
- <el-table-column label="修改原因" align="center" prop="modifyReason"/>
- <el-table-column label="建议采购量" align="center" prop="suggestionPurchase"/>
- <el-table-column label="建议净采购量" align="center" prop="suggestBuyQty"/>
- <el-table-column label="最终采购量" align="center" prop="finalBuyQty"/>
- <el-table-column label="二级品类" align="center" prop="code"/>
- <el-table-column label="三级品类" align="center" prop="code"/>
- <el-table-column label="四级品类" align="center" prop="code"/>
+ <el-table-column label="人工调整数" align="center" prop="artificialAdjust" width="100px"/>
+ <el-table-column label="修改原因" align="center" prop="modifyReason" width="150px">
+ <el-input :disabled="lineDisable" v-model="scope.row.modifyReason"/>
+ <el-table-column label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
+ <el-table-column label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/>
+ <el-table-column label="最终采购量" align="center" prop="finalBuyQty" width="150">
+ <el-input :disabled="lineDisable" v-model="scope.row.finalBuyQty"/>
+ <el-table-column label="二级品类" align="center" prop="materialClassifyTwoName" width="150px"/>
+ <el-table-column label="三级品类" align="center" prop="materialClassifyThreeName" width="150px"/>
+ <el-table-column label="四级品类" align="center" prop="materialClassifyFourName" width="150px"/>
<el-table-column label="单据状态" align="center" prop="status"/>
- <el-table-column label="采购员" align="center" prop="buyerName"/>
- <el-table-column label="默认采购组织" align="center" prop="code"/>
+ <el-table-column label="采购员" align="center" prop="buyerName" width="150px">
+ <el-input :disabled="lineDisable" size="small" v-model="scope.row.buyerName">
+ <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '采购员')"></el-button>
+ <el-table-column label="默认采购组织" align="center" prop="purchaseOrgName" width="280px">
+ <el-input :disabled="lineDisable" size="small" v-model="scope.row.purchaseOrgName">
+ <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '默认采购组织')"></el-button>
<el-table-column label="有效期" align="center" prop="validityPeriod"/>
- <el-table-column label="有效期单位" align="center" prop="validityPeriodUnit"/>
+ <el-table-column label="有效期单位" align="center" prop="validityPeriodUnit" width="100px"/>
<el-table-column label="业务类型" align="center" prop="businessType"/>
- <el-table-column label="安全库存量" align="center" prop="code"/>
+ <el-table-column label="安全库存量" align="center" prop="safetyStock" width="100px"/>
<el-table-column label="单据来源" align="center" prop="billSource"/>
<el-table-column label="可用量" align="center" prop="qty"/>
- <el-table-column label="总需与终采差异" align="center" prop="buyDiscrepancy"/>
- <el-table-column label="集团预测分类" align="center" prop="forecastClassification"/>
- <el-table-column label="中心仓占有量" align="center" prop="centerBinPossession"/>
- <el-table-column label="中心仓可用量" align="center" prop="code"/>
- <el-table-column label="物料类别" align="center" prop="materialCategory"/>
- <el-table-column label="业务部门" align="center" prop="departmentName"/>
+ <el-table-column label="总需与终采差异" align="center" prop="buyDiscrepancy" width="120px"/>
+ <el-table-column label="集团预测分类" align="center" prop="forecastClassification" width="100px"/>
+ <el-table-column label="中心仓占有量" align="center" prop="centerBinPossession" width="100px"/>
+ <el-table-column label="中心仓可用量" align="center" prop="centralWarehouseAvailable" width="100px"/>
+ <el-table-column label="物料类别" align="center" prop="materialCategory" width="150px"/>
+ <el-table-column label="业务部门" align="center" prop="departmentName" width="150px"/>
<el-table-column label="需求单位" align="center" prop="demandUnit"/>
- <el-table-column label="采购经理审核人" align="center" prop="puManagerAuditor"/>
+ <el-table-column label="采购经理审核人" align="center" prop="puManagerAuditor" width="120px"/>
label="操作"
- width="150"
+ width="100"
<el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
@@ -385,59 +365,137 @@
<Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
+ <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+ <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
+ <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
import Add from './add.vue'
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
+import popDialog from '@/components/PopDialog/index.vue'
import CollapseTransition from '@/components/MyCollapse/collapse.vue'
-import {getSummaryList, auditSummary, confirmSummary , cancelSummary , cancelAuditSummary } from '@/api/purchase/DemandSummary.js'
+import {getSummaryList, auditSummary, confirmSummary , cancelSummary , cancelAuditSummary, editSummaryList } from '@/api/purchase/DemandSummary.js'
name: 'demandSummary',
+ dicts: ['sys_row_status', 'predictive_classify', 'sys_period_unit', 'sys_business', 'sys_bill_source'],
Add,
- CollapseTransition
+ CollapseTransition,
+ Refers,
+ TreeRefers,
+ popDialog
+ isUpdate: false,
expanded: false,
// 页面配置
isList: true,
// 页面状态
page: '',
+ rowStatus: [],
+ buyerName: '',
+ materialName: '',
+ manufacturer: '',
+ forecastClassification: '',
+ periodUnit: '',
+ departmentName: '',
+ puManagerAuditor: '',
+ // zqgdh: '',
code: '',
- cgy: '',
- pl: '',
- sccj: '',
- wllb: '',
- zqdw: '',
- ywbm: '',
- shr: '',
- zqgdh: '',
- cgxqdh: '',
- zcr: '',
- ywlx: '',
+ registrant: '',
+ businessType: '',
+ billSource: '',
+ customer: '',
+ lastWarehouse: '',
+ lastAllocation: '',
+ materialCode: '',
+ names: '',
+ purchaseOrg: '',
+ demandDate: '',
+ auditTime: '',
+ yesTime: '',
- pageSize: 10
+ pageSize: 5
+ personOptions: [],
+ classOptions: [],
+ deptOptions: [],
+ auditOptions: [],
+ customerOptions: [],
+ lastWarehouseOptions: [],
+ lastAllocationOptions: [],
+ orgOptions: [],
options: [{
value: '0', label: '是',
}, {
value: '2', label: '否'
}],
+ referCondition: {
+ type: '',
+ isPage: true,
+ title: ''
total: 0,
rowDetail: {},
disable: false,
ids: [],
allSelection: [],
+ // 子表index
+ tableIndex: null,
+ referConditionMx: {
this.getList(this.queryParams)
+ // 搜索
+ search() {
+ this.getList(this.queryParams)
+ reset() {
+ this.queryParams = {
+ code: '',
getList(params){
getSummaryList(params).then(res => {
if (res.code === 200) {
@@ -474,6 +532,19 @@ export default {
drop() {
this.expanded = !this.expanded
+ editList() {
+ console.log('Lists`````',this.tableList)
+ saveList() {
+ editSummaryList(this.tableList).then(res => {
confirms() {
this.$modal.msgWarning("请选中至少一条数据");
@@ -523,6 +594,80 @@ export default {
+ // 搜索区参照选择
+ chooseRefer(type, isPage, title) {
+ this.referCondition.type = type
+ this.referCondition.isPage = isPage
+ this.referCondition.title = title
+ this.$refs.refer.init(this.referCondition)
+ selectionsToInput(selection) {
+ if (this.referCondition.title == '采购员') {
+ this.personOptions = selection
+ this.queryParams.buyerName = selection[0].id
+ if (this.referCondition.title == '业务部门') {
+ this.deptOptions = selection
+ this.queryParams.departmentName = selection[0].id
+ if (this.referCondition.title == '审核人') {
+ this.auditOptions = selection
+ this.queryParams.puManagerAuditor = selection[0].id
+ if (this.referCondition.title == '需求客户') {
+ this.customerOptions = selection
+ this.queryParams.customer = selection[0].id
+ if (this.referCondition.title == '末级供应仓库') {
+ this.lastWarehouseOptions = selection
+ this.queryParams.lastWarehouse = selection[0].id
+ if (this.referCondition.title == '末级供应库位') {
+ this.lastAllocationOptions = selection
+ this.queryParams.lastAllocation = selection[0].id
+ if (this.referCondition.title == '默认采购组织') {
+ this.orgOptions = selection
+ this.queryParams.purchaseOrg = selection[0].id
+ if (this.referConditionMx.title == '采购员') {
+ console.log('选择进了吗',this.tableList)
+ this.tableList[this.tableIndex].buyer = selection[0].code
+ this.tableList[this.tableIndex].buyerName = selection[0].name
+ if (this.referConditionMx.title == '默认采购组织') {
+ this.tableList[this.tableIndex].purchaseOrg = selection[0].id
+ this.tableList[this.tableIndex].purchaseOrgName = selection[0].name
+ // 搜索区树形选择
+ chooseTreeRefer(type, isPage, title) {
+ this.$refs.tree.init(this.referCondition)
+ selectionsToInput2(selection) {
+ this.classOptions.push(selection)
+ this.queryParams.materialName = selection.id
+ // 搜索区物料编码
+ chooseMaterial() {
+ this.$refs.materialRefer.init()
+ selectMaterial(selection) {
+ this.queryParams.materialCode = selection[0].id
+ this.queryParams.names = selection[0].name
+ // 明细行选择业务部门参照带出业务部门数据
+ chooseSon(index, type, isPage, title) {
+ this.tableIndex = index
+ this.referConditionMx.type = type
+ this.referConditionMx.isPage = isPage
+ this.referConditionMx.title = title
+ this.$refs.refer.init(this.referConditionMx)
@@ -532,6 +677,7 @@ export default {
height: calc(100vh - 84px);
padding: 12px;
box-sizing: border-box;
+ overflow-y: scroll;
.btn_grooup {
margin-bottom: 10px;
@@ -541,4 +687,10 @@ export default {
.lines {
margin-top: 0;
+.hang {
+ margin: auto;
+.hang ::v-deep .el-form-item__content{
+ margin-left: 0px !important;
</style>
@@ -84,9 +84,10 @@
- <el-input :disabled="disable" style="width: 200px" size="small" readonly v-model="basicForm.material">
+ <el-input :disabled="disable" style="width: 200px" size="small" readonly v-model="basicForm.materialCode">
<el-button slot="append" icon="el-icon-more" @click="test01"></el-button>
+ <el-input v-show="false" style="width: 200px" size="small" v-model="basicForm.material"></el-input>
@@ -123,12 +124,12 @@
:disabled="disable"
- @focus="chooseOrganizations"
+ @focus="chooseRefer('ORG_PARAM', true, '选择所属组织')"
v-for="item in organizationsOptions"
:key="item.id"
+ :label="item.name"
:value="item.id"
@@ -144,7 +145,7 @@
v-model="basicForm.orderPersonal"
- @focus="chooseStaff"
+ @focus="chooseRefer('CONTACTS_PARAM', true, '订单员')"
v-for="item in staffOptions"
@@ -176,7 +177,7 @@
v-model="basicForm.buyer"
- @focus="chooseStaff2"
+ @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')"
v-for="item in staff2Options"
@@ -248,17 +249,7 @@
:single="true"
- <orgs
- ref="orgs"
- @doSubmit="acceptOrgs"
- :single="true"
- <staff
- ref="staff"
- @doSubmit="acceptStaff"
+ <Refers ref="refer" @doSubmit="selectionsRefer" :single="true"/>
<staff2
ref="staff2"
@@ -277,8 +268,9 @@ import { getDetail } from '@/api/classify/basic';
// 物料编码
import popDialog from '@/components/PopDialog/index.vue'
// 公用一个树形(组织部门传值不同)
-import orgs from '@/components/PopDialog/organization.vue'
-import staff from '@/components/PopDialog/staff.vue'
+// 用于回显参照框数据
+import { getRefer } from '@/api/purchase/basic.js'
import staff2 from '@/components/PopDialog/staff.vue'
// 所属组织,订单员用于回显
import { getOrgs, getStaff} from '@/api/requisition/basic'
@@ -287,8 +279,7 @@ export default {
fourClass,
popDialog,
- orgs,
- staff,
staff2
@@ -307,6 +298,7 @@ export default {
materialClassifyThreeName: '',
materialClassifyFourName: '',
material: '',
materialName: '',
manufacturer: '',
org: '',
@@ -325,6 +317,11 @@ export default {
value: 0, label: '仓库1'
organizationsOptions: [],
staffOptions: [],
staff2Options: [],
@@ -360,7 +357,7 @@ export default {
this.$emit('jugislist', true)
let queryParams = {
this.$emit('refresh', queryParams)
@@ -369,9 +366,12 @@ export default {
getDivisions(row.id).then(res => {
this.basicForm = res.data
- this.getOrgDetails(res.data.org)
- this.getStaffDetails(res.data.orderPersonal)
- this.getStaffDetails2(res.data.buyer)
+ if (this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
+ if (this.basicForm.orderPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.orderPersonal, '订单员') }
+ if (this.basicForm.buyer) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.buyer, '采购员') }
+ // this.getOrgDetails(res.data.org)
+ // this.getStaffDetails(res.data.orderPersonal)
+ // this.getStaffDetails2(res.data.buyer)
@@ -400,7 +400,8 @@ export default {
selectionsToInput (selections) {
console.log('父组件拿到的:', selections)
this.selectData = selections
- this.basicForm.material = selections[0].code
+ this.basicForm.material = selections[0].id
+ this.basicForm.materialCode = selections[0].code
this.basicForm.materialName = selections[0].name
// 显示物料编码列表
@@ -409,48 +410,69 @@ export default {
this.$refs.contractSelect.init()
// 选择默认采购组织
- acceptOrgs (selections) {
- console.log('接收的采购组织', selections)
- this.basicForm.org = selections.id
- this.getOrgDetails(selections.id)
- // 默认采购组织显示列表
- chooseOrganizations () {
- this.$refs.organizations.blur()
- this.$refs.orgs.init('1')
+ selectionsRefer(selection) {
+ if (this.referCondition.title == '选择所属组织') {
+ this.organizationsOptions = selection
+ this.basicForm.org = selection[0].id
+ this.basicForm.orgName = selection[0].name
+ if (this.referCondition.title == '订单员') {
+ this.staffOptions = selection
+ this.basicForm.orderPersonal = selection[0].code
+ this.basicForm.orderPersonalName = selection[0].name
+ this.staff2Options = selection
+ this.basicForm.buyer = selection[0].code
+ this.basicForm.buyerName = selection[0].name
- // 采购组织回显
- getOrgDetails(id) {
- getOrgs({deptId: id}).then(res => {
- if (res.code === 200) {
- this.organizationsOptions = res.data
+ // 回显参照框
+ reBackRefer(type, id, title) {
+ getRefer({ type: type, id: id }).then(res => {
+ if (type == 'ORG_PARAM') {
+ this.organizationsOptions = res.rows
- // 选择订单员
- acceptStaff (selections) {
- this.staffOptions = selections
- this.basicForm.orderPersonal = selections[0].code
- this.getStaffDetails(selections[0].id)
- // 订单员显示列表
- chooseStaff () {
- this.$refs.staffs.blur()
- this.$refs.staff.init()
- // 订单员回显
- getStaffDetails(id) {
- getStaff({id:id}).then(res => {
- console.log('订单员', res)
- if (res.code === 200 ) {
- this.staffOptions = res.data.tableBody
+ if (type == 'CONTACTS_PARAM' && title == '订单员') {
+ this.staffOptions = res.rows
+ if (type == 'CONTACTS_PARAM' && title == '采购员') {
+ this.staff2Options = res.rows
+ // 选择订单员
+ // acceptStaff (selections) {
+ // this.staffOptions = selections
+ // this.basicForm.orderPersonal = selections[0].code
+ // this.basicForm.orderPersonalName = selections[0].name
+ // this.getStaffDetails(selections[0].id)
+ // // 订单员显示列表
+ // chooseStaff () {
+ // this.$refs.staffs.blur()
+ // this.$refs.staff.init()
+ // // 订单员回显
+ // getStaffDetails(id) {
+ // getStaff({id:id}).then(res => {
+ // console.log('订单员', res)
+ // if (res.code === 200 ) {
+ // this.staffOptions = res.data.tableBody
+ // })
// 选择采购员
acceptStaff2 (selections) {
this.staff2Options = selections
this.basicForm.buyer = selections[0].code
+ this.basicForm.buyerName = selections[0].name
this.getStaffDetails2(selections[0].id)
// 采购员显示列表
@@ -5,50 +5,42 @@
<el-form-item label="物料一级大类编码">
- <el-select v-model="queryParams.materialClassifyOne" size="small" style="width: 200px" clearable placeholder="请选择">
- </el-select>
+ v-model="queryParams.materialClassifyOne"
+ clearable
<el-form-item label="物料一级大类名称">
- <el-select v-model="queryParams.materialClassifyOneName" size="small" style="width: 200px" clearable placeholder="请选择">
+ v-model="queryParams.materialClassifyOneName"
<el-form-item label="物料二级大类编码">
- <el-select v-model="queryParams.materialClassifyTwo" size="small" style="width: 200px" clearable placeholder="请选择">
+ v-model="queryParams.materialClassifyTwo"
<el-form-item label="物料二级大类名称">
- <el-select v-model="queryParams.materialClassifyTwoName" size="small" style="width: 200px" clearable placeholder="请选择">
+ v-model="queryParams.materialClassifyTwoName"
@@ -64,26 +56,22 @@
<el-form-item label="物料三级大类编码">
- <el-select v-model="queryParams.materialClassifyThree" size="small" style="width: 200px" clearable placeholder="请选择">
+ v-model="queryParams.materialClassifyThree"
<el-form-item label="物料三级大类名称">
- <el-select v-model="queryParams.materialClassifyThreeName" size="small" style="width: 200px" clearable placeholder="请选择">
+ v-model="queryParams.materialClassifyThreeName"
@@ -100,14 +88,12 @@
<el-form-item label="物料四级大类名称">
- <el-select v-model="queryParams.materialClassifyFourName" size="small" style="width: 200px" clearable placeholder="请选择">
+ v-model="queryParams.materialClassifyFourName"
@@ -211,19 +197,18 @@
导出<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="Excel导出">Excel导出</el-dropdown-item>
+ <el-dropdown-item command="Excel导出">Excel导出</el-dropdown-item>。
<el-dropdown-item command="导出明细">导出明细</el-dropdown-item>
<el-button type="primary" size="small">同步分配</el-button>
<el-button type="primary" size="small">删除</el-button>
- <el-button type="primary" size="small">打印</el-button>
@@ -236,7 +221,7 @@
<el-table-column label="物料编码" align="center" width="150" prop="material" />
<el-table-column label="物料名称" align="center" prop="materialName" />
<el-table-column label="生产厂商" align="center" width="150" prop="manufacturer" />
- <el-table-column label="所属组织" align="center" width="120" prop="orgName" />
+ <el-table-column label="所属组织" align="center" width="120" prop="orgName"/>
<el-table-column label="订单员" align="center" width="150" prop="orderPersonalName" />
<el-table-column label="采购员" align="center" width="150" prop="buyerName" />
<el-table-column label="订单部门" align="center" width="150" prop="orderDeptName" />
@@ -308,7 +293,7 @@ export default {
remark: '',
@@ -385,6 +370,7 @@ export default {
@@ -8,8 +8,7 @@
v-model="basicForm.code"
+ disabled
@@ -17,7 +16,7 @@
<el-form-item label="组织">
- <el-select size="small" v-model="basicForm.org" :disabled="disable" @focus="chooseOrg" style="width: 200px">
+ <el-select size="small" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
<el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
@@ -25,7 +24,7 @@
<el-form-item label="需求处理方式">
- <el-select v-model="basicForm.demandBusinessType" size="small" style="width: 200px">
+ <el-select disabled v-model="basicForm.demandBusinessType" size="small" style="width: 200px">
<el-option v-for="dict in dict.type.sys_processing_mode" :key="dict.value" :label="dict.label" :value="dict.value">
@@ -34,7 +33,7 @@
<el-form-item label="单据状态">
- <el-select v-model="basicForm.status" size="small" style="width: 200px" clearable placeholder="请选择">
+ <el-select disabled v-model="basicForm.status" size="small" style="width: 200px">
<el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
@@ -43,7 +42,7 @@
- <el-select size="small" v-model="basicForm.customer" :disabled="disable" @focus="chooseCustomer" style="width: 200px">
+ <el-select size="small" v-model="basicForm.customer" :disabled="sonDisable" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
<el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
@@ -51,19 +50,19 @@
<el-form-item label="需求客户名称">
- <el-input v-model="basicForm.customerName" size="small" style="width: 200px"></el-input>
+ <el-input disabled v-model="basicForm.customerName" size="small" style="width: 200px"></el-input>
<el-form-item label="客户负责人">
- <el-input v-model="basicForm.customerPrincipal" size="small" style="width: 200px"></el-input>
+ <el-input disabled v-model="basicForm.customerPrincipal" size="small" style="width: 200px"></el-input>
<el-form-item label="需求人员">
- <el-select size="small" v-model="basicForm.demandPersonal" :disabled="disable" @focus="choosePerson" style="width: 200px">
+ <el-select size="small" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
<el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.id" />
@@ -71,12 +70,12 @@
<el-form-item label="需求部门">
- <el-select v-model="basicForm.demandDept" size="small" style="width: 200px" clearable placeholder="请选择">
+ <el-select v-model="basicForm.demandDept" size="small" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
+ v-for="item in deptOptions"
+ :key="item.id"
+ :value="item.id">
@@ -86,6 +85,7 @@
<el-date-picker
v-model="basicForm.demandDate"
@@ -97,7 +97,7 @@
- <el-select v-model="basicForm.source" size="small" style="width: 200px">
+ <el-select v-model="basicForm.source" disabled size="small" style="width: 200px">
<el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
@@ -106,7 +106,7 @@
<el-form-item label="供应仓库">
- <el-select size="small" v-model="basicForm.warehouse" :disabled="disable" @focus="chooseHouse" style="width: 200px">
+ <el-select size="small" v-model="basicForm.warehouse" :disabled="sonDisable" @focus="chooseOrg('WAREHOUSE_PARAM', true, '供应仓库')" style="width: 200px">
<el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
@@ -114,7 +114,7 @@
<el-form-item label="供应货位">
- <el-select size="small" v-model="basicForm.goodsAllocation" :disabled="disable" @focus="chooseGoods" style="width: 200px">
+ <el-select size="small" v-model="basicForm.goodsAllocation" :disabled="sonDisable" @focus="chooseOrg('ALLOCATION_PARAM', true, '供应货位')" style="width: 200px">
<el-option v-for="item in goodsOptions" :key="item.id" :label="item.name" :value="item.id" />
@@ -122,7 +122,7 @@
- <el-select v-model="basicForm.billType" size="small" style="width: 200px">
+ <el-select v-model="basicForm.billType" :disabled="sonDisable" size="small" style="width: 200px">
<el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
@@ -131,7 +131,7 @@
<el-form-item label="是否客户指定">
- <el-select v-model="basicForm.isSpeical" size="small" style="width: 200px">
+ <el-select v-model="basicForm.isSpeical" :disabled="sonDisable" size="small" style="width: 200px">
<el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
@@ -155,8 +155,7 @@
v-model="basicForm.isMonthleyCalculate"
@@ -167,7 +166,7 @@
v-model="basicForm.remark"
+ :disabled="sonDisable"
@@ -179,9 +178,9 @@
<span>明细信息</span>
- <el-button type="primary" size="small" @click="addLine">增行</el-button>
- <el-button type="primary" size="small" >批量调整</el-button>
- <el-button type="primary" size="small" v-if="pageStu == 'check' || pageStu == 'edit'" @click="showReserved">货权预留单</el-button>
+ <el-button type="primary" size="small" @click="addLine" v-if="!sonDisable">增行</el-button>
+ <el-button type="primary" size="small" v-if="!sonDisable">批量调整</el-button>
+ <el-button type="primary" size="small" v-if="sonPageStu == 'check' || sonPageStu == 'edit'" @click="showReserved">货权预留单</el-button>
@@ -193,244 +192,326 @@
<el-table-column type="selection"/>
<el-table-column label="序号" type="index" align="center"/>
<el-table-column label="行状态" align="center" prop="status" />
- <el-table-column label="行号" align="center" >
+ <el-table-column label="行号" align="center" prop="rowNo" />
+ <el-table-column label="业务部门名称" align="center" width="180px">
+ <el-form-item class="hang">
+ <el-input readonly size="small" v-model="scope.row.businessDeptName"/>
+ <el-table-column label="业务部门" align="center" width="180px">
<el-form-item class="hang">
- <el-input v-model="scope.row.index"/>
+ <el-input readonly size="small" v-model="scope.row.businessDept">
+ <!-- <el-button :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'DEPT_PARAM', true, '选择部门')"></el-button> -->
- <el-table-column label="一级品类" align="center" width="150">
+ <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="180px">
- <el-input v-model="scope.row.materialClassifyOneName"/>
+ <el-input readonly size="small" v-model="scope.row.materialClassifyOneName"/>
- <el-table-column label="二级品类" align="center" width="150" prop="materialClassifyTwoName">
+ <el-table-column label="二级品类" align="center" prop="materialClassifyTwoName" width="180px">
- <el-input v-model="scope.row.materialClassifyTwoName"/>
+ <el-input readonly size="small" v-model="scope.row.materialClassifyTwoName"/>
- <el-table-column label="三级品类" align="center" width="150" prop="materialClassifyThreeName">
+ <el-table-column label="三级品类" align="center" prop="materialClassifyThreeName" width="180px">
- <el-input v-model="scope.row.materialClassifyThreeName"/>
+ <el-input readonly size="small" v-model="scope.row.materialClassifyThreeName"/>
- <el-table-column label="四级品类" align="center" width="150" prop="materialClassifyFourName">
+ <el-table-column label="四级品类" align="center" prop="materialClassifyFourName" width="180px">
- <el-input v-model="scope.row.materialClassifyFourName"/>
+ <el-input readonly size="small" v-model="scope.row.materialClassifyFourName"/>
- <el-table-column label="预留比例" align="center" width="150" prop="reservedProportion">
+ <el-table-column label="预留比例" align="center" prop="reservedProportion" width="150px">
- <el-input v-model="scope.row.reservedProportion"/>
+ <el-select :disabled="sonDisable" size="small" v-model="scope.row.reservedProportion">
+ <el-option v-for=" dict in dict.type.sys_reserve_ratio" :key="dict.value" :label="dict.label" :value="dict.value">
+ <!-- <el-input v-model="scope.row.reservedProportion"/> -->
- <el-table-column label="预留周期" align="center" width="150" prop="reservedPeriod">
+ <el-table-column label="预留周期" align="center" prop="reservedPeriod" width="150px">
- <el-input v-model="scope.row.reservedPeriod"/>
+ <el-input :readonly="sonDisable" size="small" v-model="scope.row.reservedPeriod"/>
- <el-table-column label="预留数量" align="center" width="150" prop="reservedQty">
+ <el-table-column label="预留数量" align="center" prop="reservedQty" width="150px">
- <el-input v-model="scope.row.reservedQty"/>
+ <el-input :readonly="sonDisable" size="small" v-model="scope.row.reservedQty"/>
- <el-table-column label="采购员名称" align="center" prop="buyerName" />
- <el-table-column label="采购员" align="center" width="150" prop="buyer" />
- <el-table-column label="物料编码" align="center" width="120" prop="materialCode">
+ <el-table-column label="采购员名称" align="center" prop="buyerName" width="120px"/>
+ <el-table-column label="采购员" align="center" prop="buyer"/>
+ <el-table-column label="物料编码" align="center" prop="materialCode" width="230px">
- <el-input v-model="scope.row.materialCode"/>
+ <el-input readonly size="small" v-model="scope.row.materialCode">
+ <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
- <el-table-column label="物料名称" align="center" width="150" prop="materialName" />
- <el-table-column label="规格" align="center" width="150" prop="specification" />
- <el-table-column label="型号" align="center" width="150" prop="model" />
- <el-table-column label="单位" align="center" width="150" prop="unit " />
- <el-table-column label="生产厂家/代理人" align="center" width="150" prop="registrant" />
- <el-table-column label="注册人" align="center" width="150" prop="registrant" />
- <el-table-column label="采购周期" align="center" width="150" prop="puPeriod">
+ <el-table-column label="物料名称" align="center" prop="materialName" width="230px" />
+ <el-table-column label="规格" align="center" prop="specification" />
+ <el-table-column label="型号" align="center" prop="model" />
+ <el-table-column label="单位" align="center" prop="unit" />
+ <el-table-column label="生产厂家/代理人" align="center" prop="manufacturerName" width="230px"/>
+ <el-table-column label="注册人" align="center" prop="registrant" width="150px"/>
+ <el-table-column label="采购周期" align="center" prop="puPeriod" width="150px">
- <el-input v-model="scope.row.puPeriod"/>
+ <el-input :readonly="sonDisable" size="small" v-model="scope.row.puPeriod"/>
- <el-table-column label="有效期单位" align="center" width="150" prop="expiryUnit" />
- <el-table-column label="有效期" align="center" width="150" prop="updateTime" />
- <el-table-column label="最小包装" align="center" width="150" prop="minPackage" />
- <el-table-column label="最小订货量" align="center" width="150" prop="minOrderQty" />
- <el-table-column label="最小批量" align="center" width="150" prop="minBatch " />
- <el-table-column label="安全库存" align="center" width="150" prop="safeStock ">
+ <el-table-column label="有效期单位" align="center" prop="expiryUnit" width="120px"/>
+ <el-table-column label="有效期" align="center" prop="expiry" width="120px"/>
+ <el-table-column label="最小包装" align="center" prop="minPackage" width="120px"/>
+ <el-table-column label="最小订货量" align="center" prop="minOrderQty" width="120px"/>
+ <el-table-column label="最小批量" align="center" prop="minBatch" width="120px"/>
+ <el-table-column label="安全库存" align="center" prop="safeStock" width="120px">
- <el-input v-model="scope.row.safeStock"/>
+ <el-input :readonly="sonDisable" size="small" v-model="scope.row.safeStock"/>
- <el-table-column label="月均销量" align="center" width="150" prop="averageQtyMonth" />
- <el-table-column label="实际(业务)需求量" align="center" width="150" prop="qty">
+ <el-table-column label="月均销量" align="center" prop="averageQtyMonth" width="120px"/>
+ <el-table-column label="实际(业务)需求量" align="center" prop="qty" width="120px">
- <el-input v-model="scope.row.qty"/>
+ <el-input :readonly="sonDisable" size="small" v-model="scope.row.qty"/>
- <el-table-column label="需求可用周期" align="center" width="150" prop="demandPeriod" />
- <el-table-column label="集团预测分类" align="center" width="150" prop="forecastClassify" />
- <el-table-column label="交货日期" align="center" width="150" prop="deliveryDate">
+ <el-table-column label="需求可用周期" align="center" prop="demandPeriod" width="120px"/>
+ <el-table-column label="集团预测分类" align="center" prop="forecastClassify" width="120px"/>
+ <el-table-column label="交货日期" align="center" prop="deliveryDate" width="230px">
- <el-input v-model="scope.row.deliveryDate"/>
+ v-model="scope.row.deliveryDate"
+ :readonly="sonDisable"
+ type="datetime"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ placeholder="选择日期">
- <el-table-column label="补单标识" align="center" width="150" prop="isReplenishment">
+ <el-table-column label="补单标识" align="center" prop="isReplenishment" width="100px">
- <el-input v-model="scope.row.isReplenishment"/>
- <el-table-column label="批号锁定标识" align="center" width="150" prop="isBatchLock">
+ <el-table-column label="批号锁定标识" align="center" prop="isBatchLock" width="100px">
- <el-input v-model="scope.row.isBatchLock"/>
- <el-table-column label="业务备注" align="center" width="150" prop="remark">
+ <el-table-column label="业务备注" align="center" prop="remark" width="150px">
- <el-input v-model="scope.row.remark"/>
+ <el-input :readonly="sonDisable" size="small" v-model="scope.row.remark"/>
- <el-table-column label="采购备注" align="center" width="150" prop="puRemark" />
- <!-- <el-table-column label="末级供应仓库存量" align="center" width="150" prop="lastWarehouseQty" /> -->
- <!-- <el-table-column label="调拨占有量" align="center" width="150" prop="superiorAllotQty"></el-table-column> -->
- <el-table-column label="最终净需求量" align="center" width="150" prop="resDemandQty">
+ <el-table-column label="采购备注" align="center" prop="puRemark" width="150px"/>
+ <!-- <el-table-column label="末级供应仓库存量" align="center" prop="lastWarehouseQty" /> -->
+ <!-- <el-table-column label="调拨占有量" align="center" prop="superiorAllotQty"></el-table-column> -->
+ <el-table-column label="最终净需求量" align="center" prop="resDemandQty" width="150px">
- <el-input v-model="scope.row.resDemandQty"/>
+ <el-input :readonly="sonDisable" size="small" v-model="scope.row.resDemandQty"/>
- <el-table-column label="末级供应仓库" align="center" width="150" prop="lastWarehouseName">
+ <el-table-column label="末级供应仓库" align="center" prop="lastWarehouseName" width="200px">
- <el-input v-model="scope.row.lastWarehouseName"/>
+ <el-input readonly size="small" v-model="scope.row.lastWarehouseName">
+ <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择末级供应仓库')"></el-button>
- <el-table-column label="收货仓库" align="center" width="150" prop="deliveryWarehouseName">
+ <el-table-column label="收货仓库" align="center" prop="deliveryWarehouseName" width="200px">
- <el-input v-model="scope.row.deliveryWarehouseName"/>
+ <el-input readonly size="small" v-model="scope.row.deliveryWarehouseName">
+ <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')"></el-button>
- <el-table-column label="末级供应货位" align="center" width="150" prop="lastAllocationName">
+ <el-table-column label="末级供应货位" align="center" prop="lastAllocationName" width="200px">
- <el-input v-model="scope.row.lastAllocationName"/>
+ <el-input readonly size="small" v-model="scope.row.lastAllocationName">
+ <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ALLOCATION_PARAM', true, '选择末级供应货位')"></el-button>
- <el-table-column label="收货货位编码" align="center" width="150" prop="deliveryAllocation" />
- <el-table-column label="收货货位" align="center" width="150" prop="deliveryAllocationName">
+ <el-table-column label="收货货位编码" align="center" prop="deliveryAllocation" width="200px"/>
+ <el-table-column label="收货货位" align="center" prop="deliveryAllocationName" width="200px">
- <el-input v-model="scope.row.deliveryAllocationName"/>
+ <el-input readonly size="small" v-model="scope.row.deliveryAllocationName">
+ <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位')"></el-button>
- <el-table-column label="紧急标识" align="center" width="150" prop="isUrgency">
+ <el-table-column label="紧急标识" align="center" prop="isUrgency" width="100px">
- <el-input v-model="scope.row.isUrgency"/>
- <el-table-column label="默认采购组织" align="center" width="150" prop="purOrgName" />
- <el-table-column label="默认采购组织编码" align="center" width="150" prop="puOrg" />
- <!-- <el-table-column label="末级供应调拨待入量" align="center" width="150" prop="lastStockQty">
+ <el-table-column label="默认采购组织" align="center" prop="purOrgName" width="200px"/>
+ <el-table-column label="默认采购组织编码" align="center" prop="puOrg" width="200px"/>
+ <el-table-column label="末级供应调拨待入量" align="center" prop="lastStockQty" width="150px">
- <el-input v-model="scope.row.lastStockQty"/>
+ <el-input :readonly="sonDisable" size="small" v-model="scope.row.lastStockQty"/>
- </el-table-column> -->
- <el-table-column label="上级供应中心现存量" align="center" width="150" prop="superiorCenterQty" />
- <el-table-column label="上级库存被调拨占用量" align="center" width="150" prop="superiorAllotQty" />
- <el-table-column label="可用量" align="center" width="150" prop="availableQty" />
- <el-table-column label="调拨状态" align="center" width="150" prop="statusAllot">
+ <el-table-column label="上级供应中心现存量" align="center" prop="superiorCenterQty" width="200px"/>
+ <el-table-column label="上级库存被调拨占用量" align="center" prop="superiorAllotQty" width="200px"/>
+ <el-table-column label="可用量" align="center" prop="availableQty"/>
+ <el-table-column label="调拨状态" align="center" prop="statusAllot" width="100px">
- <el-input v-model="scope.row.statusAllot"/>
+ v-model="scope.row.statusAllot"
- <el-table-column label="补单供应商编码" align="center" width="150" prop="additionalSupplier">
+ <el-table-column label="补单供应商编码" align="center" prop="additionalSupplier" width="200px">
- <el-input v-model="scope.row.additionalSupplier"/>
+ <el-input readonly size="small" v-model="scope.row.additionalSupplier">
+ <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
- <el-table-column label="补单供应商名称" align="center" width="150" prop="additionalSupplierCode">
+ <el-table-column label="补单供应商名称" align="center" prop="additionalSupplierCode" width="200px">
- <el-input v-model="scope.row.additionalSupplierCode"/>
+ <el-input readonly size="small" v-model="scope.row.additionalSupplierCode"/>
- <el-table-column label="周期单位" align="center" width="150" prop="periodUnit">
+ <el-table-column label="周期单位" align="center" prop="periodUnit" width="150px">
- <el-input v-model="scope.row.periodUnit"/>
+ <el-select :disabled="sonDisable" size="small" v-model="scope.row.periodUnit">
+ <el-option v-for=" dict in dict.type.sys_period_unit" :key="dict.value" :label="dict.label" :value="dict.value">
+ <!-- <el-input v-model="scope.row.periodUnit"/> -->
- <el-table-column label="需求客户" align="center" width="150" prop="customer">
+ <!-- <el-table-column label="需求客户" align="center" prop="customer">
<el-input v-model="scope.row.customer"/>
+ </el-table-column> -->
+ <el-table-column label="末级供应库存组织" align="center" prop="superiorStockOrgName" width="200px"></el-table-column>
+ <el-table-column label="中心仓可用量" align="center" prop="updateTime" width="200px"></el-table-column>
+ <el-table-column label="调拨单号" align="center" prop="allotCode"></el-table-column>
+ <el-table-column label="收货地址" align="center" prop="deliveryAddressName" width="200px">
+ <el-input readonly size="small" v-model="scope.row.deliveryAddressName">
+ <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')"></el-button>
+ <el-table-column label="收货地址编码" align="center" prop="deliveryAddress" width="200px"></el-table-column>
+ <el-table-column label="联系人" align="center" prop="contacts"/>
+ <el-table-column label="联系人电话" align="center" prop="contactsPhone" width="200px"/>
+ <el-table-column label="详细地址" align="center" prop="address" width="200px"/>
+ <el-table-column label="价格类型" align="center" prop="priceType" width="150px">
+ <el-select :disabled="sonDisable" size="small" v-model="scope.row.priceType">
+ <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
- <!-- <el-table-column label="末级供应库存组织" align="center" width="150" prop="updateTime"></el-table-column> -->
- <el-table-column label="中心仓可用量" align="center" width="150" prop="updateTime"></el-table-column>
- <!-- <el-table-column label="调拨单号" align="center" width="150" prop="updateTime"></el-table-column> -->
- <!-- <el-table-column label="收货地址" align="center" width="150" prop="updateTime"></el-table-column> -->
- <!-- <el-table-column label="收货地址编码" align="center" width="150" prop="updateTime" /> -->
- <el-table-column label="联系人" align="center" width="150" prop="contacts" />
- <!-- <el-table-column label="联系人电话" align="center" width="150" prop="updateTime" /> -->
- <!-- <el-table-column label="详细地址" align="center" width="150" prop="updateTime" /> -->
- <!-- <el-table-column label="价格类型" align="center" width="150" prop="updateTime"></el-table-column> -->
- fixed="right"
- label="操作"
+ fixed="right"
+ label="操作"
- <el-button type="text" size="small" @click="delLine(scope.row)">删除</el-button>
+ <el-button type="text" size="small" :disabled="sonDisable" @click="delLine(scope.$index, scope.row)">删除</el-button>
@@ -438,12 +519,15 @@
<div class="btn_group">
+ <el-col :span="1.5">
+ <el-button type="primary" size="small" plain @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
+ <el-button type="primary" size="small" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
<el-col :span="1.5" style="margin: 0 10px;">
- <el-button type="primary" size="small" plain @click="save" v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
+ <el-button type="primary" size="small" plain @click="submit" v-if="sonPageStu == 'check'">提交</el-button>
- <!-- <el-col :span="1.5" style="margin: 0 10px;">
- <el-button type="primary" size="small" plain @click="submit" v-if="pageStu == 'edit'">提交</el-button>
- </el-col> -->
<el-button size="small" plain @click="back">返回</el-button>
@@ -451,23 +535,29 @@
<Reserved v-if="dialog.config" :isVisible="dialog.config" :info="row" @updateReserved="updateReserved"/>
<Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
import Reserved from './reserved.vue'
-import Refers from './refers.vue'
-import {addDemand,getDemandDetail, getDemandSonDetail, editDemand} from '@/api/purchase/purchaseDemand.js'
+import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan } from '@/api/purchase/purchaseDemand.js'
// 用于回显参照框数据
import {getRefer} from '@/api/purchase/basic.js'
+// 明细行选择物料参照
name: 'addDemandList',
- dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business'],
+ dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business','sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
Reserved,
- Refers
model: {
prop: 'isList',
@@ -475,21 +565,26 @@ export default {
dialog: {
config: false
basicForm: {
- demandBusinessType: '',
- status: '',
+ orgName: '',
+ demandBusinessType: '1',
customer: '',
customerName: '',
+ customerCode: '',
customerPrincipal: '',
demandPersonal: '',
demandDept: '',
demandDate: '',
- source: '',
+ source: '1',
warehouse: '',
goodsAllocation: '',
billType: '',
@@ -508,12 +603,19 @@ export default {
referCondition: {
type: 'ORG_PARAM',
- search: '',
- title: '选择组织'
+ title: '选择组织',
+ pkOrg: '',
+ type: 'DEPT_PARAM',
+ title: '选择部门'
orgOptions: [],
personOptions: [],
customerOptions: [],
houseOptions: [],
goodsOptions: []
@@ -528,15 +630,41 @@ export default {
- save() {
- if(this.pageStu == 'add') {
- addDemand(this.basicForm).then(res => {
+ copy() {
+ this.$modal.msgSuccess("复制成功");
+ this.sonPageStu = 'add'
+ this.sonDisable = false
+ this.basicForm.id = ''
+ this.basicForm.code = ''
+ handleData() {
+ console.log('222')
+ // 复制新增把id,编码置为空,子表去掉id
+ if (this.basicForm.puDemandItemList.length !== 0) {
+ this.basicForm.puDemandItemList.forEach(item => {
+ if (item.id) {
+ delete item.id
+ if (item.demandId) {
+ delete item.demandId
+ async save() {
+ if(this.sonPageStu == 'add') {
+ await this.handleData()
+ await addDemand(this.basicForm).then(res => {
+ console.log(333)
this.$modal.msgSuccess("保存成功");
this.back()
- } else if (this.pageStu == 'edit') {
+ } else if (this.sonPageStu == 'edit') {
editDemand(this.basicForm).then(res => {
this.$modal.msgSuccess("编辑成功");
@@ -545,7 +673,14 @@ export default {
- submit() {},
+ submit() {
+ submitDemand(this.basicForm).then(res => {
+ this.$modal.msgSuccess("提交成功");
+ this.back()
// 增行
addLine() {
const newLine = {
@@ -567,12 +702,17 @@ export default {
materialClassifyFour: null,
materialClassifyFourName: null,
materialCode: null,
+ material: null,
materialName: null,
+ classifyId: null,
specification: null,
unit: null,
+ unitName: null,
+ manufacturerName: null,
registrant: null,
puPeriod: null,
expiryUnit: null,
+ expiry: null,
minPackage: null,
minOrderQty: null,
minBatch: null,
@@ -589,9 +729,9 @@ export default {
demandPeriod: null,
forecastClassify: null,
deliveryDate: null,
- isUrgency: null,
- isReplenishment: null,
- isBatchLock: null,
+ isUrgency: 'N',
+ isReplenishment: 'N',
+ isBatchLock: 'N',
remark: null,
puRemark: null,
lastWarehouseQty: null,
@@ -611,7 +751,7 @@ export default {
superiorCenterQty: null,
superiorAllotQty: null,
availableQty: null,
- statusAllot: null,
+ statusAllot: 'N',
additionalSupplier: null,
additionalSupplierCode: null,
periodUnit: null,
@@ -647,11 +787,12 @@ export default {
this.basicForm.puDemandItemList.push(newLine)
- delLine(row) {
- console.log('删除行:', row)
- this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
- return item.id !== row.id
+ delLine(index) {
+ console.log('删除行:', index)
+ // this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
+ // return item.id !== row.id
+ this.basicForm.puDemandItemList.splice(index,1)
back() {
@@ -673,8 +814,14 @@ export default {
reciveForm.puDemandItemList = res.rows
console.log('reciveForm',reciveForm)
this.basicForm = reciveForm
- this.reBackRefer({type: 'ORG_PARAM', search: this.basicForm.org, isPage: false})
+ if(this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
+ if(this.basicForm.customer) { this.reBackRefer('CUSTOMER_PARAM', this.basicForm.customer) }
+ if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal) }
+ if(this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
+ if(this.basicForm.warehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.warehouse) }
+ if(this.basicForm.goodsAllocation) { this.reBackRefer('ALLOCATION_PARAM', this.basicForm.goodsAllocation) }
+ console.log('111')
@@ -689,56 +836,56 @@ export default {
this.dialog.config = val
// 回显参照框
- reBackRefer(val) {
- getRefer(val).then(res => {
- console.log("🚀 ~ file: add.vue:706 ~ getRefer ~ res:", res)
+ reBackRefer(type, id) {
+ getRefer({type: type, id: id}).then(res => {
+ if(type == 'ORG_PARAM') {
+ this.orgOptions = res.rows
+ if (type == 'CUSTOMER_PARAM') {
+ this.customerOptions = res.rows
+ if (type == 'CONTACTS_PARAM') {
+ this.personOptions = res.rows
+ if (type == 'DEPT_PARAM') {
+ this.deptOptions = res.rows
+ if (type == 'WAREHOUSE_PARAM') {
+ this.houseOptions = res.rows
+ if (type == 'ALLOCATION_PARAM') {
+ this.goodsOptions = res.rows
- chooseOrg() {
- this.referCondition.type = 'ORG_PARAM'
- this.referCondition.search = ''
- this.referCondition.isPage = true
- this.referCondition.title = '选择组织'
- this.$refs.refer.init(this.referCondition)
- chooseCustomer () {
- this.referCondition.type = ''
- this.referCondition.title = '选择客户'
- choosePerson() {
- this.referCondition.type = 'CONTACTS_PARAM'
- this.referCondition.title = '需求人员'
- chooseHouse() {
- this.referCondition.type = 'WAREHOUSE_PARAM'
- this.referCondition.title = '供应仓库'
- chooseGoods() {
- this.referCondition.type = 'ALLOCATION_PARAM'
- this.referCondition.title = '供应货位'
+ chooseOrg(type, isPage, title) {
+ // 选择货位时要传入组织id
+ this.referCondition.pkOrg = this.basicForm.org
this.$refs.refer.init(this.referCondition)
selectionsToInput(selection) {
- console.log("🚀 ~ file: add.vue:732 ~ selectionsToInput ~ selection:", selection)
if(this.referCondition.type == 'ORG_PARAM') {
this.orgOptions = selection
this.basicForm.org = selection[0].id
+ if(this.referCondition.type == 'CUSTOMER_PARAM') {
+ this.basicForm.customer = selection[0].id
+ this.basicForm.customerName = selection[0].name
+ this.basicForm.customerCode = selection[0].code
if(this.referCondition.type == 'CONTACTS_PARAM') {
this.personOptions = selection
this.basicForm.demandPersonal = selection[0].id
+ if(this.referCondition.type == 'DEPT_PARAM') {
+ this.basicForm.demandDept = selection[0].id
if(this.referCondition.type == 'WAREHOUSE_PARAM') {
this.houseOptions = selection
this.basicForm.warehouse = selection[0].id
@@ -747,6 +894,83 @@ export default {
this.goodsOptions = selection
this.basicForm.goodsAllocation = selection[0].id
+ // if(this.referConditionMx.type == 'DEPT_PARAM') {
+ // this.basicForm.puDemandItemList[this.tableIndex].businessDept = selection[0].code
+ // this.basicForm.puDemandItemList[this.tableIndex].businessDeptName = selection[0].name
+ if(this.referConditionMx.title == '选择末级供应仓库') {
+ this.basicForm.puDemandItemList[this.tableIndex].lastWarehouseName = selection[0].name
+ if(this.referConditionMx.title == '选择收货仓库') {
+ this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouseName = selection[0].name
+ if(this.referConditionMx.title == '选择末级供应货位') {
+ this.basicForm.puDemandItemList[this.tableIndex].lastAllocationName = selection[0].name
+ if(this.referConditionMx.title == '选择收货货位') {
+ this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = selection[0].code
+ this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
+ if(this.referConditionMx.title == '选择补单供应商') {
+ this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].code
+ this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierCode = selection[0].name
+ if(this.referConditionMx.title == '选择收货地址') {
+ this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = selection[0].name
+ this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = selection[0].code
+ this.basicForm.puDemandItemList[this.tableIndex].contacts = selection[0].contactsName
+ this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = selection[0].contactsPhone
+ this.basicForm.puDemandItemList[this.tableIndex].address = selection[0].address
+ // 明细行选择物料编码带出数据
+ chooseMaterial(index) {
+ console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index)
+ console.log('选中的物料', selection)
+ // 通过选择物料查询采购员
+ queryMan(selection[0].id).then(res => {
+ if(res.code === 200 && res.rows.length !== 0) {
+ this.basicForm.puDemandItemList[this.tableIndex].buyer = res.rows[0].buyer
+ this.basicForm.puDemandItemList[this.tableIndex].buyerName = res.rows[0].buyerName
+ this.basicForm.puDemandItemList[this.tableIndex].businessDept = selection[0].businessDepartment
+ this.basicForm.puDemandItemList[this.tableIndex].businessDeptName = selection[0].businessDepartmentName
+ this.basicForm.puDemandItemList[this.tableIndex].materialCode = selection[0].code
+ this.basicForm.puDemandItemList[this.tableIndex].material = selection[0].id
+ this.basicForm.puDemandItemList[this.tableIndex].materialName = selection[0].name
+ this.basicForm.puDemandItemList[this.tableIndex].classifyId = selection[0].classifyId
+ this.basicForm.puDemandItemList[this.tableIndex].materialClassifyOneName = selection[0].oneClass
+ this.basicForm.puDemandItemList[this.tableIndex].materialClassifyTwoName = selection[0].twoClass
+ this.basicForm.puDemandItemList[this.tableIndex].materialClassifyThreeName = selection[0].threeClass
+ this.basicForm.puDemandItemList[this.tableIndex].materialClassifyFourName = selection[0].fourClass
+ this.basicForm.puDemandItemList[this.tableIndex].specification = selection[0].specification
+ this.basicForm.puDemandItemList[this.tableIndex].model = selection[0].model
+ this.basicForm.puDemandItemList[this.tableIndex].unit = selection[0].unitId
+ this.basicForm.puDemandItemList[this.tableIndex].unitName = selection[0].unitIdName
+ this.basicForm.puDemandItemList[this.tableIndex].registrant = selection[0].registrant
+ this.basicForm.puDemandItemList[this.tableIndex].manufacturerName = selection[0].manufacturerIdName
+ this.basicForm.puDemandItemList[this.tableIndex].puPeriod = selection[0].deliveryPeriod
+ this.basicForm.puDemandItemList[this.tableIndex].expiryUnit = selection[0].expiryUnitIdName
+ // this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].usefulLife
+ this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].minPackQty
+ this.basicForm.puDemandItemList[this.tableIndex].minOrderQty = selection[0].minOrderQty
+ this.basicForm.puDemandItemList[this.tableIndex].minBatch = selection[0].minBatchQty
+ this.basicForm.puDemandItemList[this.tableIndex].safeStock = selection[0].safeStock
+ this.basicForm.puDemandItemList[this.tableIndex].purOrgName = selection[0].purchasingOrganizationName
+ this.basicForm.puDemandItemList[this.tableIndex].puOrg = selection[0].purchasingOrganization
+ chooseDept(index, type, isPage, title) {
@@ -5,37 +5,24 @@
<el-form-item label="单据编码">
- <el-select v-model="queryParams.code" size="small" style="width: 200px" clearable placeholder="请选择">
- <el-select v-model="queryParams.warehouse" size="small" style="width: 200px" clearable placeholder="请选择">
+ <el-select size="small" v-model="queryParams.warehouse" @focus="chooseOrg('WAREHOUSE_PARAM', true, '供应仓库')" style="width: 200px">
+ <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
- <el-select v-model="queryParams.customer" size="small" style="width: 200px" clearable placeholder="请选择">
+ <el-select size="small" v-model="queryParams.customer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
@@ -53,8 +40,8 @@
+ <el-button type="primary" size="small" icon="el-icon-search" plain @click="searchList">搜索</el-button>
+ <el-button size="small" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
@@ -62,49 +49,23 @@
- <el-form-item label="单据类型">
- <el-select v-model="queryParams.threeName" size="small" style="width: 200px" clearable placeholder="请选择">
- <el-select v-model="queryParams.demandPersonal" size="small" style="width: 200px" clearable placeholder="请选择">
+ <el-select size="small" v-model="queryParams.demandPersonal" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
- <el-select v-model="queryParams.goodsAllocation" size="small" style="width: 200px" clearable placeholder="请选择">
+ <el-select size="small" v-model="queryParams.goodsAllocation" @focus="chooseOrg('ALLOCATION_PARAM', true, '供应货位')" style="width: 200px">
+ <el-option v-for="item in goodsOptions" :key="item.id" :label="item.name" :value="item.id" />
- <el-select v-model="queryParams.source" size="small" style="width: 200px" clearable placeholder="请选择">
+ <el-select v-model="queryParams.source" size="small" style="width: 200px">
+ <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
@@ -114,37 +75,34 @@
- <el-select v-model="queryParams.billType" size="small" style="width: 200px" clearable placeholder="请选择">
+ <el-select v-model="queryParams.billType" size="small" style="width: 200px">
+ <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
- <el-select v-model="queryParams.demandDept" size="small" style="width: 200px" clearable placeholder="请选择">
+ <el-select v-model="queryParams.demandDept" size="small" :disabled="disable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
- v-model="queryParams.demandDate"
@@ -152,7 +110,6 @@
v-model="queryParams.remark"
@@ -178,18 +135,18 @@
- <el-dropdown size="small" @command="handleCommand">
+ <el-dropdown size="small" @command="handleExport">
<el-button size="small" type="primary" style="margin: 0 10px;">
- <el-dropdown-item command="导出明细">导出明细</el-dropdown-item>
+ <el-dropdown-item command="选中导出">选中导出</el-dropdown-item>
+ <el-dropdown-item command="全部导出">全部导出</el-dropdown-item>
<el-button type="primary" size="small" @click="delItems">删除</el-button>
+ <!-- <el-button type="primary" size="small">打印</el-button> -->
@@ -198,19 +155,19 @@
- <el-table-column label="编码" align="center" prop="code"/>
- <el-table-column label="需求日期" align="center" width="200" prop="demandDate" />
- <el-table-column label="单据状态" align="center" prop="status" />
+ <el-table-column label="编码" align="center" width="200" prop="code"/>
+ <el-table-column label="需求日期" align="center" width="120" prop="demandDate"/>
+ <el-table-column label="单据状态" align="center" prop="satus" :formatter="formatterStatus"/>
<!-- <el-table-column label="是否已处理需求" align="center" width="150" prop="isProcess" /> -->
- <el-table-column label="业务类型" align="center" width="150" prop="billType"/>
+ <el-table-column label="业务类型" align="center" prop="billType" :formatter="formatterBillType"/>
<!-- <el-table-column label="是否特殊需求" align="center" width="150" prop="isSpeical" /> -->
- <el-table-column label="需求人员" align="center" width="150" prop="demandPersonalName" />
- <el-table-column label="需求客户" align="center" prop="customerName" />
- <el-table-column label="需求部门" align="center" width="150" prop="demandDeptName" />
+ <el-table-column label="需求人员" align="center" prop="demandPersonalName" />
+ <el-table-column label="需求客户" align="center" prop="customerName" width="150"/>
+ <el-table-column label="需求部门" align="center" prop="demandDeptName" width="150"/>
<!-- <el-table-column label="供应仓库" align="center" width="120" prop="warehouseName" /> -->
<!-- <el-table-column label="供应货位" align="center" width="150" prop="goodsAllocationName" /> -->
- <el-table-column label="单据来源" align="center" width="150" prop="source" />
- <el-table-column label="组织" align="center" width="150" prop="orgName" />
+ <el-table-column label="单据来源" align="center" prop="source" width="120" :formatter="formatterSource"/>
+ <el-table-column label="组织" align="center" width="200" prop="orgName"/>
<el-table-column label="备注" align="center" width="150" prop="remark" />
@@ -220,8 +177,8 @@
- <el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>
- <el-button type="text" size="small" @click="deleteids(scope.row)">删除</el-button>
+ <el-button type="text" size="small" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="edit(scope.row)">编辑</el-button>
+ <el-button type="text" size="small" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="deleteids(scope.row)">删除</el-button>
@@ -238,22 +195,75 @@
+ <!-- 用户导入对话框 -->
+ <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px">
+ <el-upload
+ ref="upload"
+ :limit="1"
+ accept=".xlsx, .xls"
+ :headers="upload.headers"
+ :action="upload.url + '?updateSupport=' + upload.updateSupport"
+ :disabled="upload.isUploading"
+ :on-progress="handleFileUploadProgress"
+ :on-success="handleFileSuccess"
+ :auto-upload="false"
+ drag
+ <i class="el-icon-upload"></i>
+ <div class="el-upload__text">
+ 将文件拖到此处,或
+ <em>点击上传</em>
+ <div class="el-upload__tip" slot="tip">
+ <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+ <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+ </el-upload>
+ <el-button type="primary" @click="submitFileForm">确 定</el-button>
+ <el-button @click="upload.open = false">取 消</el-button>
+// 导入的token
+import { getToken } from "@/utils/auth";
-import {getDemandList, delDemand, downLoadDemand} from '@/api/purchase/purchaseDemand.js'
+import {getDemandList, delDemand, downLoadDemand, exportDemand } from '@/api/purchase/purchaseDemand.js'
name: 'PurchaseDemandList',
+ Refers
+ dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business', 'sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
+ // 导入参数
+ upload: {
+ // 是否显示弹出层(导入)
+ open: false,
+ // 弹出层标题(导入)
+ title: "",
+ // 是否禁用上传
+ isUploading: false,
+ // 是否更新已经存在的用户数据
+ updateSupport: 0,
+ // 设置上传的请求头部
+ headers: { Authorization: "Bearer " + getToken() },
+ // 上传的地址
+ url: process.env.VUE_APP_BASE_API + "/pu/demand/import"
+ // 下拉收起配置
@@ -264,7 +274,6 @@ export default {
isProcess: '',
- threeName: '',
source: '',
@@ -273,13 +282,23 @@ export default {
- value: '1', label: '是',
+ value: '0', label: '是',
- value: '0', label: '否'
+ value: '2', label: '否'
+ houseOptions: [],
+ goodsOptions: [],
@@ -291,6 +310,70 @@ export default {
+ // 格式化表格内容
+ formatterStatus(row) {
+ switch(row.status){
+ return '未提交'
+ return '审批中'
+ return '已完成'
+ return '已驳回'
+ formatterBillType(row) {
+ switch (row.billType) {
+ case 'ZQBH':
+ return '周期备货'
+ case 'FXXQ':
+ return '分销需求'
+ case 'TSXQ':
+ return '特殊采购需求'
+ case 'BDXQ':
+ return '补单需求'
+ case 'JJXQ':
+ return '紧急需求单'
+ case 'XPXQ':
+ return '新品需求'
+ case 'HZBM':
+ return '合作部门需求'
+ formatterSource(row) {
+ switch (row.source) {
+ return '手工导入'
+ return '按客户计算'
+ return '按仓库计算'
+ return '手工新增'
+ searchList() {
+ resetList() {
+ warehouse: '',
+ isProcess: '',
+ demandPersonal: '',
+ goodsAllocation: '',
+ source: '',
+ billType: '',
+ demandDept: '',
+ remark: '',
getDemandList(params).then(res => {
@@ -325,6 +408,69 @@ export default {
window.URL.revokeObjectURL(href); // 释放blob对象
+ if (command == '数据导入') {
+ this.upload.title = "用户导入"
+ this.upload.open = true
+ // 文件上传中处理
+ handleFileUploadProgress(event, file, fileList) {
+ this.upload.isUploading = true;
+ // 文件上传成功处理
+ handleFileSuccess(response, file, fileList) {
+ this.upload.open = false;
+ this.upload.isUploading = false;
+ this.$refs.upload.clearFiles();
+ this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+ this.getList(this.queryParams);
+ // 提交上传文件
+ submitFileForm() {
+ this.$refs.upload.submit();
+ handleExport(command) {
+ if(command == '选中导出') {
+ if (this.ids.length == 0) {
+ this.$modal.msgWarning("请选中至少一条数据");
+ let param = {all: false, ids: this.ids}
+ exportDemand(param).then(res => {
+ const blob = new Blob([res], {
+ type: "application/vnd.ms-excel;charset=UTF-8",
+ });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+ const downloadElement = document.createElement("a"); //创建a标签
+ const href = window.URL.createObjectURL(blob); // 创建下载的链接
+ // var temp = res.headers["content-disposition"];
+ // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+ // var name = fileName.split(";")[0]; //切割成文件名
+ downloadElement.href = href; //下载地址
+ downloadElement.download = '选中导出'; // 下载后文件名
+ document.body.appendChild(downloadElement);
+ downloadElement.click(); // 点击下载
+ document.body.removeChild(downloadElement); // 下载完成移除元素
+ window.URL.revokeObjectURL(href); // 释放blob对象
+ let param2 = {all: true}
+ exportDemand(param2).then(res => {
+ downloadElement.download = '全部导出'; // 下载后文件名
addDivision() {
this.isList = false
@@ -346,7 +492,7 @@ export default {
// 行内删除
deleteids(row) {
console.log('row', row)
- this.$modal.confirm('确认信息').then(() => {
+ this.$modal.confirm('确定删除选择数据?').then(() => {
delDemand(row.id).then(res => {
this.$modal.msgSuccess("删除成功");
@@ -383,6 +529,35 @@ export default {
+ if (this.referCondition.type == 'WAREHOUSE_PARAM') {
+ this.houseOptions = selection
+ this.queryParams.warehouse = selection[0].id
+ if (this.referCondition.type == 'CUSTOMER_PARAM') {
+ if (this.referCondition.type == 'CONTACTS_PARAM') {
+ this.queryParams.demandPersonal = selection[0].id
+ if (this.referCondition.type == 'ALLOCATION_PARAM') {
+ this.goodsOptions = selection
+ this.queryParams.goodsAllocation = selection[0].id
+ if (this.referCondition.type == 'DEPT_PARAM') {
+ this.queryParams.demandDept = selection[0].id
@@ -393,6 +568,7 @@ export default {
@@ -83,7 +83,7 @@ export default {
getDetails(row) {
- getResevedDetail(row.id).then(res => {
+ getResevedDetail(row.code).then(res => {
// this.basicForm = res.data
@@ -1,11 +1,14 @@
-const columns = [
+export const Columns = [
- key: "puOrg",
+ key: "puOrgName",
title: "采购组织",
type: "InputDialog",
config: {
- componentName: "Organization",
- dataMapping: { puOrg: "deptName" },
+ componentName: "ORG_PARAM",
+ puOrg: "code",
+ puOrgName: "name",
require: true,
@@ -17,25 +20,30 @@ const columns = [
- key: "buyer",
+ key: "buyerName",
title: "采购员",
- componentName: "User",
dataMapping: {
- buyer: "userName",
- puDept: "deptName",
+ buyer: "userId",
+ buyerName: "userName",
+ puDept: "deptId",
+ puDeptName: "deptName",
- key: "supplier",
+ key: "supplierName",
title: "供应商",
- componentName: "Supplier",
- dataMapping: { supplier: "name" },
+ componentName: "SUPPLIER_PARAM",
+ supplier: "code",
+ supplierName: "name",
@@ -51,14 +59,20 @@ const columns = [
key: "puMoneyYear",
title: "本年度采购额",
+ type: "InputNumber",
- key: "puDept",
+ key: "puDeptName",
title: "采购部门",
- config: { componentName: "Department" },
+ componentName: "DEPT_PARAM",
+ puDept: "code",
+ puDeptName: "name",
@@ -100,7 +114,6 @@ const columns = [
title: "合同生效日期",
type: "DatePicker",
- config: { type: "date" },
key: "brandGrossRate",
@@ -125,14 +138,13 @@ const columns = [
title: "合同终止日期",
key: "invoiceTax",
title: "发票税率",
- componentName: "Tax",
invoiceTax: "mattaxesname",
@@ -154,7 +166,6 @@ const columns = [
title: "合同签订日期",
key: "deliveryType",
@@ -172,13 +183,14 @@ const columns = [
disabled: true,
- key: "contractPartyc",
+ key: "contractPartycName",
title: "合同丙方",
- contractPartyc: "name",
+ contractPartyc: "code",
+ contractPartycName: "name",
@@ -201,7 +213,6 @@ const columns = [
title: "合同创建时间",
key: "isTarget",
@@ -272,14 +283,14 @@ const columns = [
{ key: "area", title: "区域", type: "Input" },
{ key: "consigneePhone", title: "收货人联系方式", type: "Input" },
- key: "paymentAgreement",
+ key: "paymentAgreementName",
title: "付款协议",
- componentName: "PaymentPlan",
+ componentName: "PAYAGREEMENT_PARAM",
+ paymentAgreement: "code",
+ paymentAgreementName: "name",
@@ -288,16 +299,16 @@ const columns = [
key: "taxPrice",
title: "价税合计",
type: "InputNumber",
- config: { controlsPosition: "right" },
- key: "currency",
+ key: "currencyName",
title: "币种",
- componentName: "Currency",
+ componentName: "CURRENCY_PARAM",
- currency: "name",
+ currency: "code",
+ currencyName: "name",
@@ -319,83 +330,185 @@ const columns = [
// { key: "delFlag", title: "删除标记" },
];
-export const initColumns = () => columns;
-const tabColumns = [
+export const TabColumns = [
+ show: {
+ contractType: [1, 2],
title: "物料基本信息",
- key: "first",
+ key: "contractItemList",
tableColumns: [
- { title: "序号", key: "" },
- { title: "赠品", key: "" },
- { title: "物料编码", key: "" },
- { title: "物料名称", key: "" },
- { title: "规格", key: "" },
- { title: "生产厂家", key: "" },
- { title: "收货客户", key: "" },
- { title: "品牌", key: "" },
- { title: "采购数量", key: "" },
- { title: "采购单位", key: "" },
- { title: "计价数量", key: "" },
- { title: "税率%", key: "" },
- { title: "含税单价", key: "" },
- { title: "含税金额合计", key: "", width: 150 },
- { title: "价格有效期(起)", key: "", width: 150 },
- { title: "计划到货日期", key: "", width: 150 },
- { title: "来源类型", key: "" },
- { title: "来源单号", key: "" },
- { title: "需求单号", key: "" },
- { title: "备注", key: "" },
+ { title: "物料编码", key: "material", width: 200 },
+ title: "物料名称",
+ key: "materialName",
+ type: "InputDialog",
+ width: 200,
+ componentName: "MATERIAL_PARAM",
+ material: "code",
+ materialName: "name",
+ title: "规格",
+ key: "specification",
+ title: "品牌",
+ key: "brand",
+ { title: "生产厂家", key: "manufacturer", type: "Input", width: 200 },
+ title: "采购单位",
+ key: "puUnit",
+ title: "税率%",
+ key: "tax",
+ title: "采购数量",
+ key: "qty",
+ title: "含税单价",
+ key: "taxPrice",
+ { title: "含税金额合计", key: "taxMoney", width: 200 },
+ { title: "无税单价", key: "taxFreePrice" },
+ { title: "无税金额合计", key: "taxFreeMoney", width: 200 },
+ title: "注册证号及备案凭证号",
+ key: "registration",
+ title: "收货客户",
+ key: "customerName",
+ { title: "备注", key: "remark", type: "Input", width: 200 },
title: "合同条款",
- key: "second",
+ key: "contractClauseList",
- { title: "条款编码", key: "" },
- { title: "条款名称", key: "" },
- { title: "条款内容", key: "" },
- { title: "变量序号", key: "" },
- { title: "变量内容", key: "" },
+ { title: "条款编码", key: "code", type: "Input" },
+ { title: "条款名称", key: "name", type: "Input" },
+ { title: "条款内容", key: "content", type: "Input" },
+ { title: "变量序号", key: "variableRowno" },
+ { title: "变量内容", key: "variableContent", type: "Input" },
+ { title: "备注", key: "remark", type: "Input" },
title: "合同费用",
- key: "third",
+ key: "contractExpenseList",
- { title: "费用编码", key: "" },
- { title: "费用名称", key: "" },
- { title: "费用金额", key: "" },
+ { title: "费用编码", key: "code", type: "Input" },
+ { title: "费用名称", key: "name", type: "Input" },
+ title: "费用金额",
+ key: "money",
title: "付款协议信息",
- key: "fourth",
+ key: "contractAgreementList",
- { title: "付款阶段", key: "" },
- { title: "是否预付款", key: "" },
- { title: "是否质保金", key: "" },
- { title: "结算方式", key: "" },
- { title: "付款起点", key: "" },
- { title: "付款金额", key: "" },
- { title: "付款比例%", key: "" },
- { title: "账期天数", key: "" },
+ title: "付款阶段",
+ key: "satge",
+ title: "付款起点",
+ key: "origin",
+ { title: "账期天数", key: "paymetDays", type: "Input", width: 200 },
+ { title: "付款比例%", key: "ratio", type: "Input", width: 200 },
+ { title: "付款金额", key: "money", type: "Input", width: 200 },
+ { title: "是否预付款", key: "isAdvance", width: 200 },
+ { title: "是否质保金", key: "isQuality", width: 200 },
+ { title: "结算方式", key: "paymentMeans", type: "Input", width: 200 },
+ { title: "需进度确认", key: "schedule", type: "Select", width: 200 },
title: "合同执行组织范围",
- key: "fifth",
+ key: "contractApplyOrgList",
- { title: "组织名称", key: "" },
- { title: "组织编码", key: "" },
+ { title: "组织名称", key: "orgName", type: "Input" },
+ { title: "组织编码", key: "org", type: "Input" },
-export const initTabColumns = () => tabColumns;
@@ -0,0 +1,380 @@
+import { Columns, TabColumns } from "./column";
+import { add, generateCode } from "@/api/business/purchase/contract";
+import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
+const NewColumns = initColumns(Columns);
+const NewTabColumns = TabColumns.map((element) => ({
+ ...element,
+ tableColumns: initColumns(element.tableColumns),
+}));
+ name: "AddDrawer",
+ dicts: initDicts(NewColumns),
+ components: {
+ DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+ size: "mini",
+ columns: NewColumns,
+ rules: initRules(NewColumns),
+ params: {
+ ...initParams(NewColumns),
+ contractItemList: [],
+ contractClauseList: [],
+ contractExpenseList: [],
+ contractAgreementList: [],
+ contractApplyOrgList: [],
+ tabColumns: NewTabColumns,
+ tabName: "contractItemList",
+ computed: {},
+ "params.contractType": function (newProp) {
+ this.tabColumns = NewTabColumns.filter((element) =>
+ newProp === "1" ? element.key !== "contractItemList" : element
+ this.tabName = this.tabColumns[0].key;
+ beforeOpen() {
+ const { deptName, deptId, name, id, orgName, orgId } =
+ this.$store.state.user;
+ this.params.puOrg = orgId;
+ this.params.puOrgName = orgName;
+ this.params.buyer = id;
+ this.params.buyerName = name;
+ this.params.puDept = deptId;
+ this.params.puDeptName = deptName;
+ this.fetchCode();
+ setVisible(prop) {
+ this.visible = prop;
+ async fetchCode() {
+ this.params.code = await generateCode();
+ } catch (err) {
+ this.$notify.error({ title: "error", message: err });
+ addTableRow(prop) {
+ const arr = this.tabColumns.find(
+ (element) => element.key === this.tabName
+ ).tableColumns;
+ console.log("arr", arr);
+ prop.push(initParams(arr, "key", "value"));
+ delTableRow(prop, index) {
+ prop.splice(index, 1);
+ // 取消
+ handleCancel() {
+ this.setVisible(false);
+ this.params = initParams(this.columns, "key", "value");
+ // 保存
+ handleSava() {
+ // 保存并新增
+ async handleSubmit() {
+ const createById = this.params.buyer;
+ const createByName = this.params.buyerName;
+ const updateById = this.$store.state.user.id;
+ const updateByName = this.$store.state.user.name;
+ const { code, msg } = await add({
+ createById,
+ createByName,
+ updateById,
+ updateByName,
+ ...this.params,
+ this.$notify.success({ title: msg });
+ this.$notify.warning({ title: msg });
+ // this.setVisible(false);
+ created() {
+ console.log("ADD CREATED");
+ mounted() {},
+ destroyed() {},
+ <el-drawer
+ direction="btt"
+ size="100%"
+ :with-header="false"
+ :visible.sync="visible"
+ @open="beforeOpen"
+ @close="$emit('close')"
+ <el-form
+ v-loading="loading"
+ :size="size"
+ label-position="right"
+ label-width="135px"
+ :model="params"
+ :rules="rules"
+ <el-card
+ :body-style="{
+ padding: '20px',
+ display: 'flex',
+ 'flex-wrap': 'wrap',
+ style="margin: 10px"
+ <div
+ slot="header"
+ style="
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ "
+ <h3>新增</h3>
+ <div style="text-align: right">
+ <el-button :size="size" @click="handleCancel">取 消</el-button>
+ <el-button :size="size" type="danger" @click="handleSava"
+ >保 存</el-button
+ <el-button :size="size" type="info" @click="handleSubmit">
+ 新 增
+ </el-button>
+ v-for="(column, index) in columns"
+ :key="index"
+ :span="column.span || 6"
+ <el-form-item :prop="column.key" :label="column.title">
+ v-if="column.type === 'Input'"
+ v-model="params[column.key]"
+ :placeholder="column.placeholder"
+ :clearable="column.clearable"
+ :disabled="column.disabled"
+ style="width: 100%"
+ ></el-input>
+ v-if="column.type === 'InputDialog'"
+ :readonly="column.readonly"
+ :title="column.title"
+ :type="column.config.componentName"
+ :data-mapping="column.config.dataMapping"
+ :source.sync="params"
+ </dr-input-dialog>
+ v-if="column.type === 'Textarea'"
+ type="textarea"
+ <el-input-number
+ v-if="column.type === 'InputNumber'"
+ :controls-position="column.config.controlsPosition"
+ ></el-input-number>
+ v-if="column.type === 'Select'"
+ v-for="item in dict.type[column.config.optionsName]"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ v-if="column.type === 'TagSelect'"
+ multiple
+ collapse-tags
+ <template #prefix>
+ <el-icon
+ class="el-icon-view"
+ style="cursor: pointer"
+ @click.stop="$message.info(234)"
+ ></el-icon>
+ v-for="item in options"
+ v-if="column.type === 'DatePicker'"
+ :type="column.config.type"
+ :picker-options="column.pickerOptions"
+ v-if="column.type === 'Upload'"
+ :file-list="params[column.key]"
+ action="https://sy.derom.com/document-center/fastdfs/upload"
+ 将文件拖到此处,或<em>点击上传</em>
+ <!-- <div class="el-upload__tip" slot="tip">
+ 只能上传jpg/png文件,且不超过500kb
+ </div> -->
+ </el-card>
+ position: 'relative',
+ <el-tabs v-model="tabName" style="width: 100%">
+ <el-tab-pane
+ v-for="(column, index) in tabColumns"
+ :label="column.title"
+ :name="column.key"
+ <el-table :data="params[column.key]" style="width: 100%">
+ <el-table-column label="序号">
+ {{ scope.$index + 1 }}
+ v-for="(cColumn, cIndex) in column.tableColumns"
+ :key="cIndex"
+ :prop="cColumn.key"
+ :label="cColumn.title"
+ :width="cColumn.width"
+ <span v-if="!cColumn.type">
+ {{ scope.row[cColumn.key] }}</span
+ v-if="cColumn.type === 'Input'"
+ v-model="scope.row[cColumn.key]"
+ :placeholder="cColumn.placeholder"
+ :clearable="cColumn.clearable"
+ :disabled="cColumn.disabled"
+ v-if="cColumn.type === 'InputDialog'"
+ :readonly="cColumn.readonly"
+ :title="cColumn.title"
+ :type="cColumn.config.componentName"
+ :data-mapping="cColumn.config.dataMapping"
+ :source.sync="scope.row"
+ v-if="cColumn.type === 'InputNumber'"
+ :controls-position="cColumn.config.controlsPosition"
+ <el-table-column fixed="right" label="操作" width="120">
+ @click.native.prevent="
+ delTableRow(params[tabName], scope.$index)
+ type="text"
+ 删行
+ </el-table>
+ </el-tabs>
+ <el-row style="position: absolute; top: 20px; right: 20px">
+ <el-button :size="size" @click="addTableRow(params[tabName])"
+ >增行</el-button
+ </el-drawer>
@@ -0,0 +1,50 @@
+ { key: "id", title: "id" },
+ { key: "status", title: "单据状态" },
+ { key: "priceName", title: "价格名称" },
+ { key: "supplier", title: "供应商" },
+ title: "供应商名称",
+ { key: "puOrg", title: "采购组织" },
+ title: "采购组织名称",
+ { key: "currency", title: "币种" },
+ { key: "currencyName", title: "币种名称" },
+ { key: "explain", title: "价格合理性说明" },
+ { key: "buyer", title: "采购员" },
+ { key: "buyerName", title: "采购员名称" },
+ { key: "puDept", title: "采购部门" },
+ { key: "puDeptName", title: "采购部门名称" },
+ { key: "sourceType", title: "来源单据类型" },
+ { key: "source", title: "来源单据号" },
+ { key: "isEffective", title: "是否已推价格" },
+ { key: "effectiveDate", title: "生效日期" },
+ { key: "file", title: "附件" },
+ { key: "tenantId", title: "租户号" },
+ { key: "revision", title: "乐观锁" },
+ { key: "createByName", title: "创建人名称" },
+ { key: "updateByName", title: "更新人" },
+ { key: "delFlag", title: "删除标记" },
+export const SearchColumns = TableColumns.filter((element) => element.search);
@@ -0,0 +1,400 @@
+import { Columns, TabColumns } from "../add/column";
+import {
+ item,
+ itemTableList,
+} from "@/api/business/purchase/contract";
+ name: "EditDrawer",
+ tabName: function (newProp) {
+ const { id } = this.params;
+ this.fetchTable(id, newProp);
+ // 查询详细
+ async fetchItem(prop) {
+ const { code, msg, data } = await item(prop);
+ this.params = data;
+ // 查询详情关联TABLE
+ async fetchTable(prop, name) {
+ const { code, msg, rows } = await itemTableList({ id: prop }, name);
+ this.params[name] = rows;
+ // 新增行
+ // 删除行
+ const { code, msg } = await edit({
+ beforeOpen(){},
+ <h3>编辑</h3>
+ >更 新</el-button
@@ -0,0 +1,194 @@
+import { TableColumns, SearchColumns } from "./column";
+import { list, remove } from "@/api/business/purchase/apply";
+import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
+ name: "PuchaseContract",
+ AddDrawer: () => import("./add/index.vue"),
+ SeeDrawer: () => import("./see/index.vue"),
+ EditDrawer: () => import("./edit/index.vue"),
+ searchColumns: SearchColumns,
+ params: initParams(SearchColumns),
+ tableColumns: TableColumns,
+ page: initPage(),
+ layout: initLayout(),
+ pageSizes: initPageSizes(),
+ this.handleQueryList();
+ async fetchList(params, page) {
+ const { pageNum, pageSize } = page;
+ const { code, msg, rows, total } = await list({
+ pageNum,
+ pageSize,
+ ...params,
+ // 查询操作
+ handleQueryList() {
+ this.fetchList(this.params, this.page);
+ // 重置操作
+ handleResetList() {
+ this.page = initPage();
+ this.params = initParams(SearchColumns);
+ // 删除操作
+ async handleDeleteList(prop) {
+ const { id } = prop;
+ const { code, msg } = await remove(id);
+ // 页大小变
+ handleSizeChange(prop) {
+ this.page.pageSize = prop;
+ // 当前页变
+ handleCurrentChange(prop) {
+ this.page.pageNum = prop;
+ // 打开新增drawer
+ handleOpenAddDrawer() {
+ console.log(this.$refs.AddDrawerFef);
+ const { setVisible } = this.$refs.AddDrawerFef;
+ setVisible(true);
+ // 打开查看drawer
+ async handleOpenSeeDrawer(prop) {
+ const { setVisible, fetchItem } = this.$refs.SeeDrawerFef;
+ await setVisible(true);
+ await fetchItem(id);
+ // 打开编辑drawer
+ async handleOpenEditDrawer(prop) {
+ const { setVisible, fetchItem } = this.$refs.EditDrawerFef;
+ style="width: calc(100% - 24px); height: 100%; margin: 10px"
+ :body-style="{ padding: 0 }"
+ <see-drawer ref="SeeDrawerFef"></see-drawer>
+ <add-drawer ref="AddDrawerFef" @close="handleResetList"></add-drawer>
+ <edit-drawer ref="EditDrawerFef" @close="handleResetList"></edit-drawer>
+ <el-form :size="size" label-position="top" :model="params">
+ <el-row :gutter="24" style="padding: 0 20px">
+ v-for="column in searchColumns"
+ :key="column.title"
+ :xl="4"
+ :lg="4"
+ :md="8"
+ :sm="12"
+ :xs="24"
+ <el-col :xl="6" :lg="6" :md="8" :sm="12" :xs="24"> </el-col>
+ <el-button :size="size" icon="el-icon-search" @click="handleQueryList"
+ >搜索</el-button
+ <el-button :size="size" icon="el-icon-refresh" @click="handleResetList"
+ >重置</el-button
+ <el-table
+ @row-dblclick="handleOpenSeeDrawer"
+ :data="tableData"
+ style="width: 100%; margin: 20px 0 0 0"
+ v-for="(column, index) in tableColumns"
+ :prop="column.key"
+ :width="column.width || 180"
+ :show-overflow-tooltip="column.showOverflowTooltip || true"
+ @click.native.prevent="handleDeleteList(scope.row)"
+ 删 除
+ <el-pagination
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ :total="page.total"
+ :page-sizes="pageSizes"
+ :page-size="page.pageSize"
+ :current-page="page.pageNum"
+ :layout="layout"
+ style="margin: 16px 0"
+ </el-pagination>
@@ -0,0 +1,317 @@
+import { item, itemTableList } from "@/api/business/purchase/contract";
+const NewColumns = initColumns(Columns, { disabled: true, readonly: true });
+ tableColumns: initColumns(element.tableColumns, {
+ disabled: true,
+ readonly: true,
+ }),
+ name: "SeeDrawer",
+ // 取消操作
+ this.params = initParams(Columns);
+ // 编辑操作
+ handleOpenEditDrawer(prop) {
+ this.$parent.$parent.handleOpenEditDrawer(prop);
+ created() {},
+ destroy-on-close
+ size="mini"
+ <h3>查看</h3>
+ <el-button size="mini" @click="handleOpenEditDrawer(params)"
+ >编 辑</el-button
+ <el-button size="mini" @click="handleCancel">取 消</el-button>
+ v-else-if="column.type === 'InputNumber'"
+ v-else-if="column.type === 'Select'"
+ v-else-if="column.type === 'DatePicker'"
+ v-else-if="column.type === 'Upload'"
+ action="https://jsonplaceholder.typicode.com/posts/"
+ v-else
+ <el-tag v-if="cColumn.key === 'index'">
+ </el-tag>
+ style="width: 100%; cursor: pointer"
+ @click.native.stop="openAsyncInputDialog(column, params)"
+ <template #suffix>
+ <el-icon class="el-icon-thumb"></el-icon>
+ <!-- <el-table-column fixed="right" label="操作" width="120">
+ <!-- <el-row style="position: absolute; top: 20px; right: 20px">
+ <el-button size="mini" @click="addTableRow(params[tabName])"
+ </el-row> -->
@@ -0,0 +1,514 @@
+ title: "采购组织",
+ { key: "code", title: "合同编码", type: "Input" },
+ key: "lastPuMoney",
+ title: "上年度采购额",
+ title: "采购员",
+ title: "供应商",
+ key: "contractType",
+ title: "合同类型",
+ type: "Select",
+ optionsName: "purchase_contract_contract_type",
+ key: "puMoneyYear",
+ title: "本年度采购额",
+ title: "采购部门",
+ key: "supplierTier",
+ title: "供应商层级",
+ optionsName: "purchase_contract_supplier_tier",
+ { key: "contractName", title: "合同名称", type: "Input", require: true },
+ key: "grossRateAverage",
+ title: "平均毛利率",
+ key: "approveFlow",
+ title: "审批流程",
+ optionsName: "purchase_contract_approve_flow",
+ key: "consumableClass",
+ title: "耗材类别",
+ optionsName: "purchase_contract_consumable_class",
+ key: "effectiveDate",
+ title: "合同生效日期",
+ type: "DatePicker",
+ key: "brandGrossRate",
+ title: "同类品牌及毛利率",
+ key: "contractFormat",
+ title: "合同格式",
+ key: "productName",
+ title: "产品类别&名称",
+ key: "endDate",
+ title: "合同终止日期",
+ key: "invoiceTax",
+ title: "发票税率",
+ invoiceTax: "mattaxesname",
+ key: "emergencyDegree",
+ title: "紧急程度",
+ optionsName: "purchase_contract_emergency_degree",
+ { key: "project", title: "项目医院", type: "Input", require: true },
+ key: "signDate",
+ title: "合同签订日期",
+ key: "deliveryType",
+ title: "交货方式",
+ optionsName: "purchase_contract_delivery_type",
+ key: "source",
+ title: "合同来源",
+ value: "自制",
+ title: "合同丙方",
+ key: "guaranteePeriodEnd",
+ title: "质保期限",
+ key: "freightMethods",
+ title: "运费承担方式",
+ optionsName: "purchase_contract_freight_methods",
+ title: "合同创建时间",
+ key: "isTarget",
+ title: "是否有指标",
+ optionsName: "purchase_contract_is_target",
+ key: "contractTarget",
+ title: "合同指标",
+ placeholder: '当【是否有指标】="有"时,必填',
+ key: "exemptionPostageCondtion",
+ title: "包邮条件",
+ placeholder:
+ "当运费承担方式为供应商有条件承担时,该字段必填,填写要求,写明什么条件下供应商承担全部,什么条件下我方承担,什么条件下分别承担",
+ span: 12,
+ key: "isRebate",
+ title: "是否有返利",
+ optionsName: "purchase_contract_is_rebate",
+ key: "rebatePolicy",
+ title: "返利政策",
+ placeholder: '当【是否有返利】="有"时,必填',
+ span: 18,
+ { key: "externalContract", title: "外部合同号", type: "Input" },
+ key: "rollbackPolicy",
+ title: "退换货政策",
+ key: "contractContent",
+ title: "合同主要内容",
+ type: "Textarea",
+ span: 24,
+ { key: "refusalReasons", title: "拒绝理由", type: "Input", span: 24 },
+ { key: "enquiryCode", title: "询价单号", type: "Input" },
+ { key: "externalFile", title: "对外附件", type: "Upload", span: 24 },
+ { key: "puFile", title: "采购商盖章合同附件", type: "Upload", span: 24 },
+ key: "supplierFile",
+ title: "供应商盖章合同附件",
+ type: "Upload",
+ { key: "projectCode", title: "项目编号", type: "Input" },
+ { key: "projectName", title: "项目名称", type: "Input" },
+ { key: "area", title: "区域", type: "Input" },
+ { key: "consigneePhone", title: "收货人联系方式", type: "Input" },
+ title: "付款协议",
+ title: "价税合计",
+ title: "币种",
+ { key: "guaranteePeriod", title: "质保期", type: "Input" },
+ // { key: "buyerName", title: "采购员名称" },
+ // { key: "supplierName", title: "供应商名称" },
+ // { key: "puDeptName", title: "采购部门名称" },
+ // { key: "contractPartycName", title: "合同丙方名称" },
+ // { key: "currencyName", title: "币种名称" },
+ // { key: "tenantId", title: "租户号" },
+ // { key: "revision", title: "乐观锁" },
+ // { key: "createByName", title: "创建人" },
+ // { key: "updateByName", title: "创建人名称" },
+ // { key: "delFlag", title: "删除标记" },
+ title: "物料基本信息",
+ tableColumns: [
+ title: "合同条款",
+ title: "合同费用",
+ title: "付款协议信息",
+ title: "合同执行组织范围",
+ { key: "material", title: "物料编码", search: true },
+ { key: "materialClassify", title: "物料一级分类", search: true },
+ { key: "manufacturer", title: "生产厂家" },
+ { key: "materialName", title: "物料名称" },
+ { key: "model", title: "物料型号" },
+ { key: "specification", title: "物料规格" },
+ { key: "customer", title: "客户" },
+ { key: "customerName", title: "客户名称" },
+ { key: "taxPrice", title: "主含税单价" },
+ { key: "unit", title: "主单位" },
+ { key: "unitName", title: "主单位名称" },
+ { key: "effectiveDate", title: "价格生效日期" },
+ { key: "endDate", title: "价格失效日期" },
+ { key: "source", title: "来源单据编号", search: true },
+ { key: "status", title: "有效状态" },
+ { key: "enableStatus", title: "启用状态" },
+ { key: "convertRate", title: "换算率" },
+ { key: "materialStatus", title: "物料启用状态" },
+ { key: "isDistribution", title: "配送价" },
+ { key: "priceType", title: "价格类型" },
+ { key: "demandCode", title: "采购需求单号" },
+ { key: "expiryEarly", title: "效期预警" },
+ { key: "priority", title: "含税/无税优先" },
+ { key: "createByName", title: "创建人" },
+ { key: "updateByName", title: "更新人名称" },
@@ -0,0 +1,399 @@
+import { list, remove } from "@/api/business/purchase/catalogue";
@@ -0,0 +1,64 @@
+ { key: "puOrgName", title: "采购组织名称" },
+ { key: "code", title: "合同编码" },
+ { key: "lastPuMoney", title: "上年度采购额" },
+ { key: "supplierName", title: "供应商名称" },
+ { key: "contractType", title: "合同类型" },
+ { key: "puMoneyYear", title: "本年度采购额" },
+ { key: "supplierTier", title: "供应商层级" },
+ { key: "contractName", title: "合同名称", search: true, type: "Input" },
+ { key: "grossRateAverage", title: "平均毛利率" },
+ { key: "approveFlow", title: "审批流程" },
+ { key: "consumableClass", title: "耗材类别" },
+ { key: "effectiveDate", title: "合同生效日期" },
+ { key: "brandGrossRate", title: "同类品牌及毛利率" },
+ { key: "contractFormat", title: "合同格式" },
+ { key: "productName", title: "产品类别&名称" },
+ { key: "endDate", title: "合同终止日期" },
+ { key: "invoiceTax", title: "发票税率" },
+ { key: "emergencyDegree", title: "紧急程度" },
+ { key: "project", title: "项目医院" },
+ { key: "signDate", title: "合同签订日期" },
+ { key: "deliveryType", title: "交货方式" },
+ { key: "source", title: "合同来源" },
+ { key: "contractPartyc", title: "合同丙方" },
+ { key: "contractPartycName", title: "合同丙方名称" },
+ { key: "guaranteePeriodEnd", title: "质保期限" },
+ { key: "freightMethods", title: "运费承担方式" },
+ { key: "isTarget", title: "是否有指标" },
+ { key: "contractTarget", title: "合同指标" },
+ { key: "exemptionPostageCondtion", title: "包邮条件" },
+ { key: "isRebate", title: "是否有返利" },
+ { key: "rebatePolicy", title: "返利政策" },
+ { key: "externalContract", title: "外部合同号" },
+ { key: "rollbackPolicy", title: "退换货政策" },
+ { key: "contractContent", title: "合同主要内容" },
+ { key: "refusalReasons", title: "拒绝理由" },
+ { key: "enquiryCode", title: "询价单号" },
+ { key: "externalFile", title: "对外附件" },
+ { key: "supplierFile", title: "供应商盖章合同附件" },
+ { key: "puFile", title: "采购商盖章合同附件" },
+ { key: "projectCode", title: "项目编号" },
+ { key: "projectName", title: "项目名称" },
+ { key: "area", title: "区域区域" },
+ { key: "consigneePhone", title: "收货人联系方式" },
+ { key: "paymentAgreement", title: "付款协议" },
+ { key: "taxPrice", title: "价税合计" },
+ { key: "guaranteePeriod", title: "质保期" },
+ { key: "updateByName", title: "创建人名称" },
@@ -0,0 +1,225 @@
+ // 刷新操作
+ handleRefreshList() {
+ label-width="85px"
+ <el-row :gutter="24">
+ :xl="6"
+ :lg="6"
+ <el-col :xl="6" :lg="6" :md="8" :sm="12" :xs="24">
+ circle
+ icon="el-icon-search"
+ @click="handleQueryList"
+ ></el-button>
+ icon="el-icon-refresh"
+ @click="handleResetList"
+ <el-col :span="6">
+ type="danger"
+ icon="el-icon-plus"
+ @click="handleOpenAddDrawer"
+ 新增
+ icon="el-icon-refresh-right"
+ @click="handleRefreshList"
+ 刷新
@@ -28,24 +28,16 @@
<el-form-item label="仓库档案名称">
- v-model="basicForm.warehouseCode"
- :disabled="disable"
+ <el-select size="small" v-model="basicForm.warehouseCode" :disabled="disable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
- <el-form-item label="仓库属性">
- <el-select v-model="basicForm.warehouseProperty" size="small" style="width: 200px" clearable :disabled="disable">
+ <el-form-item label="仓库属性">
+ <el-select :disabled="disable" v-model="basicForm.warehouseProperty" size="small" style="width: 200px">
+ <el-option v-for="dict in dict.type.sys_warehouse_attribute" :key="dict.value" :label="dict.label" :value="dict.value">
@@ -65,13 +57,9 @@
<el-form-item label="联系人">
- v-model="basicForm.contactsName"
+ <el-select size="small" v-model="basicForm.contactsName" :disabled="disable" @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
+ <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.id" />
@@ -89,13 +77,16 @@
<el-form-item label="物料分类">
v-model="basicForm.materialClassify"
+ @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '物料分类')"
@@ -151,14 +142,25 @@
import {addAddress, getAddressDetail, editAddress} from '@/api/purchase/deliveryAddress.js'
name: 'addAddress',
+ dicts: ['sys_warehouse_attribute'],
+ TreeRefers
event: 'jugislist'
@@ -181,11 +183,19 @@ export default {
sendStatus: '',
value: '1', label: '是',
value: '0', label: '否'
+ contactsOptions: [],
basicRules: {}
@@ -232,6 +242,32 @@ export default {
+ this.basicForm.warehouseCode = selection[0].id
+ this.contactsOptions = selection
+ this.basicForm.contactsName = selection[0].id
+ this.basicForm.materialClassify = selection.id
@@ -179,12 +179,11 @@
<el-button type="primary" size="small">停用</el-button>
<el-button type="primary" size="small">同步NC</el-button>
@@ -346,6 +345,7 @@ export default {
-import { taskList } from "@/api/business/purchase/purchase-task";
-// import AddPurchaseTaskDrawer from "./add-purchase-task.vue";
-// import SeePurchaseTaskDrawer from "./see-purchase-task.vue";
+import { taskList } from "@/api/business/purchase/task";
+// import AddPurchaseTaskDrawer from "./add-task.vue";
+// import SeePurchaseTaskDrawer from "./see-task.vue";
// import DirectSourcingTable from "./direct-sourcing.vue";
name: "PuchaseTask",
@@ -1,314 +0,0 @@
-import { add } from "@/api/business/purchase/purchase-contract";
-import {
- initDicts,
- initRules,
- initParams,
- initComponents,
-} from "@/utils/init-something";
-import { initColumns } from "./config/add";
- name: "AddPurchaseContractDrawer",
- components: initComponents(initColumns()),
- dicts: initDicts(initColumns()),
- visible: true,
- columns: initColumns(),
- rules: initRules(initColumns()),
- params: initParams(initColumns()),
- tabColumns: initTabColumns(),
- tabName: "first",
- tabTableDatas: {
- first: [],
- second: [],
- third: [],
- fourth: [],
- fifth: [],
- currentComponent: { name: "", title: "", value: "", row: {} },
- const { deptName, nickName, orgName } = this.$store.state.user;
- this.params.puOrg = orgName;
- this.params.buyer = nickName;
- this.params.puDept = deptName;
- addTableRow() {},
- cancel() {
- this.params = arr2obj(this.columns, "key", "value");
- sava() {
- async submitSava() {
- console.log(this.params);
- const res = await add(this.params);
- console.log("res", res);
- openAsyncInputDialog(prop, type) {
- const {
- key,
- title,
- config: { componentName },
- } = prop;
- this.currentComponent.row = prop;
- this.currentComponent.title = title;
- this.currentComponent.name = componentName;
- if (type === "change") {
- this.currentComponent.value = this.params[key];
- if (type === "click") {
- this.currentComponent.value = "";
- const { setVisible } = this.$refs[componentName];
- setVisible(true);
- updateParams(prop) {
- config: { dataMapping },
- } = this.currentComponent.row;
- for (let key in dataMapping) {
- this.params[key] = prop[dataMapping[key]];
- created() {
- // console.log("this,", initComponents(initColumns()));
- <el-drawer
- direction="btt"
- size="100%"
- :with-header="false"
- <el-card
- :body-style="{
- padding: '20px',
- display: 'flex',
- 'flex-wrap': 'wrap',
- style="margin: 10px"
- slot="header"
- style="
- justify-content: space-between;
- <h3>新增</h3>
- <div style="text-align: right">
- <el-button size="mini" @click="cancel">取消</el-button>
- <el-button size="mini" type="danger" @click="sava">保存</el-button>
- <el-button size="mini" type="info" @click="submitSava">
- 保存并新增
- </el-button>
- <component
- v-if="currentComponent.name"
- :is="currentComponent.name"
- :ref="currentComponent.name"
- :title="currentComponent.title"
- :value="currentComponent.value"
- @confirm="updateParams"
- ></component>
- <el-row>
- label-position="right"
- label-width="135px"
- :model="params"
- :rules="rules"
- <el-col
- v-for="(column, index) in columns"
- :span="column.span || 6"
- <el-form-item :prop="column.key" :label="column.title">
- v-if="column.type === 'Input'"
- v-model="params[column.key]"
- :placeholder="column.placeholder"
- :clearable="column.clearable"
- :disabled="column.disabled"
- v-if="column.type === 'InputDialog'"
- @blur="openAsyncInputDialog(column, 'change')"
- @change="openAsyncInputDialog(column, 'change')"
- <template #suffix>
- <el-icon
- class="el-icon-s-operation"
- style="cursor: pointer"
- @click.native.stop="openAsyncInputDialog(column, 'click')"
- ></el-icon>
- </template>
- </el-input>
- v-if="column.type === 'Textarea'"
- type="textarea"
- <el-input-number
- v-if="column.type === 'InputNumber'"
- :controls-position="column.config.controlsPosition"
- ></el-input-number>
- <el-select
- v-if="column.type === 'Select'"
- v-for="item in dict.type[column.config.optionsName]"
- :value="item.value"
- v-if="column.type === 'TagSelect'"
- multiple
- collapse-tags
- <template #prefix>
- @click.stop="$message.info(234)"
- <el-date-picker
- v-if="column.type === 'DatePicker'"
- :type="column.config.type"
- :picker-options="column.pickerOptions"
- </el-date-picker>
- <el-upload
- v-if="column.type === 'Upload'"
- :file-list="params[column.key]"
- drag
- action="https://jsonplaceholder.typicode.com/posts/"
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- 将文件拖到此处,或<em>点击上传</em>
- <div class="el-upload__tip" slot="tip">
- 只能上传jpg/png文件,且不超过500kb
- </el-upload>
- </el-row>
- </el-card>
- position: 'relative',
- <el-tabs v-model="tabName" @tab-click="handleClick" style="width: 100%">
- <el-tab-pane
- v-for="(column, index) in tabColumns"
- :name="column.key"
- <el-table :data="tabTableDatas[column.key]" style="width: 100%">
- v-for="(cColumn, cIndex) in column.tableColumns"
- :key="cIndex"
- :prop="cColumn.key"
- :label="cColumn.title"
- :width="cColumn.width"
- </el-tab-pane>
- </el-tabs>
- <el-row style="position: absolute; top: 20px; right: 20px">
- <el-button size="mini" @click="addTableRow">增行</el-button>
- </el-drawer>
@@ -1,386 +0,0 @@
- name: "DirectSourcing",
- { title: "价格来源", key: "a" },
- { title: "供应商", key: "b" },
- { title: "采购组织", key: "c" },
- { title: "客户", key: "d" },
- { title: "价格类型", key: "e" },
- { title: "配送价", key: "f" },
- { title: "币种", key: "g" },
- { title: "价格有效期", key: "h" },
- { title: "税率", key: "i" },
- { title: "协议单价", key: "j" },
- title: "未执行量",
- key: "k",
- edit: true,
- editConfig: { type: "InputNumber", controlsPosition: "right" },
- title: "采购量",
- key: "l",
- title: "计划到货",
- key: "m",
- editConfig: { type: "DatePicker", showType: "date" },
- title: "期望到货",
- key: "n",
- title: "备注",
- key: "o",
- editConfig: { type: "Textarea" },
- data: [
- a: 1,
- b: 1,
- c: 1,
- d: 1,
- e: 1,
- f: 1,
- g: 1,
- h: 1,
- i: 1,
- j: 1,
- k: 1,
- l: 1,
- m: 1,
- n: 1,
- o: 1,
- pageSizes: [25, 50, 100],
- watch: {
- data: {
- handler: function (n) {
- console.log(n);
- deep: true,
- methods: {},
- <div class="directSourcing" style="height: 50vh">
- <el-table :data="data" height="calc(50vh)" style="width: 100%">
- :width="column.width || 180"
- :show-overflow-tooltip="column.showOverflowTooltip || true"
- <template slot-scope="scope">
- v-if="column.edit && column.editConfig.type === 'InputNumber'"
- v-model="scope.row[column.key]"
- :controls-position="column.editConfig.controlsPosition"
- :min="column.editConfig.min"
- :max="column.editConfig.max"
- :size="column.editConfig.size || 'mini'"
- :placeholder="column.editConfig.placeholder"
- style="width: 90%"
- v-else-if="column.edit && column.editConfig.type === 'DatePicker'"
- :type="column.editConfig.showType"
- :picker-options="column.editConfig.pickerOptions"
- ></el-date-picker>
- v-else-if="column.edit && column.editConfig.type === 'Textarea'"
- :autosize="column.editConfig.autosize || true"
- <span v-else>{{ scope.row[column.key] }}</span>
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- hide-on-single-page
- layout="total, prev, pager, next, sizes, jumper"
@@ -1,264 +0,0 @@
-import { list } from "@/api/business/purchase/purchase-contract";
-import AddPurchaseContractDrawer from "./add-purchase-contract.vue";
-import SeePurchaseContractDrawer from "./see-purchase-contract.vue";
-// import DirectSourcingTable from "./direct-sourcing.vue";
- name: "PuchaseTask",
- components: {
- AddPurchaseContractDrawer,
- SeePurchaseContractDrawer,
- // DirectSourcingTable,
- { title: "合同名称", key: "contractName", type: "Input" },
- { key: "id", title: "id" },
- { key: "puOrg", title: "采购组织" },
- { key: "puOrgName", title: "采购组织名称" },
- { key: "code", title: "合同编码" },
- { key: "lastPuMoney", title: "上年度采购额" },
- { key: "buyer", title: "采购员" },
- { key: "buyerName", title: "采购员名称" },
- { key: "supplier", title: "供应商" },
- { key: "supplierName", title: "供应商名称" },
- { key: "contractType", title: "合同类型" },
- { key: "puMoneyYear", title: "本年度采购额" },
- { key: "puDept", title: "采购部门" },
- { key: "puDeptName", title: "采购部门名称" },
- { key: "supplierTier", title: "供应商层级" },
- { key: "contractName", title: "合同名称" },
- { key: "grossRateAverage", title: "平均毛利率" },
- { key: "approveFlow", title: "审批流程" },
- { key: "consumableClass", title: "耗材类别" },
- { key: "effectiveDate", title: "合同生效日期" },
- { key: "brandGrossRate", title: "同类品牌及毛利率" },
- { key: "contractFormat", title: "合同格式" },
- { key: "productName", title: "产品类别&名称" },
- { key: "endDate", title: "合同终止日期" },
- { key: "invoiceTax", title: "发票税率" },
- { key: "emergencyDegree", title: "紧急程度" },
- { key: "project", title: "项目医院" },
- { key: "signDate", title: "合同签订日期" },
- { key: "deliveryType", title: "交货方式" },
- { key: "source", title: "合同来源" },
- { key: "contractPartyc", title: "合同丙方" },
- { key: "contractPartycName", title: "合同丙方名称" },
- { key: "guaranteePeriodEnd", title: "质保期限" },
- { key: "freightMethods", title: "运费承担方式" },
- { key: "isTarget", title: "是否有指标" },
- { key: "contractTarget", title: "合同指标" },
- { key: "exemptionPostageCondtion", title: "包邮条件" },
- { key: "isRebate", title: "是否有返利" },
- { key: "rebatePolicy", title: "返利政策" },
- { key: "externalContract", title: "外部合同号" },
- { key: "rollbackPolicy", title: "退换货政策" },
- { key: "contractContent", title: "合同主要内容" },
- { key: "refusalReasons", title: "拒绝理由" },
- { key: "enquiryCode", title: "询价单号" },
- { key: "externalFile", title: "对外附件" },
- { key: "supplierFile", title: "供应商盖章合同附件" },
- { key: "puFile", title: "采购商盖章合同附件" },
- { key: "projectCode", title: "项目编号" },
- { key: "projectName", title: "项目名称" },
- { key: "area", title: "区域区域" },
- { key: "consigneePhone", title: "收货人联系方式" },
- { key: "paymentAgreement", title: "付款协议" },
- { key: "taxPrice", title: "价税合计" },
- { key: "currency", title: "币种" },
- { key: "currencyName", title: "币种名称" },
- { key: "guaranteePeriod", title: "质保期" },
- { key: "tenantId", title: "租户号" },
- { key: "revision", title: "乐观锁" },
- { key: "createByName", title: "创建人" },
- { key: "updateByName", title: "创建人名称" },
- { key: "delFlag", title: "删除标记" },
- isSimpleSearch: true,
- searchParams: {
- isAsc: "desc",
- reasonable: "",
- orderByColumn: "",
- tableData: [{ materialName: 1 }],
- computed: {
- showSearchColumns() {
- return this.isSimpleSearch
- ? this.searchColumns.slice(0, 4)
- : this.searchColumns;
- // watch: {
- // $route: {
- // handler: function (route) {
- // this.redirect = route.query && route.query.redirect;
- // },
- // immediate: true,
- this.fetchTaskList();
- console.log("Vue", this);
- async fetchTaskList() {
- const { code, msg, rows, total } = await list({
- ...this.page,
- ...this.searchParams,
- this.total = total;
- this.tableData = rows;
- handleSearchChange() {
- this.isSimpleSearch = !this.isSimpleSearch;
- this.$notify.info({
- title: this.isSimpleSearch ? "Simple Search" : "All Search",
- handleSizeChange() {},
- handleCurrentChange() {},
- handleOpenAddDrawer() {
- const { setVisible } = this.$refs.addDrawerFef;
- this.$notify.info("Open Add Drawer");
- handleOpenSeeDrawer() {
- const { setVisible } = this.$refs.seeDrawerFef;
- this.$notify.info("Open See Drawer");
- style="width: calc(100% - 24px); height: 100%; margin: 10px"
- :body-style="{ padding: 0 }"
- <AddPurchaseContractDrawer ref="addDrawerFef"></AddPurchaseContractDrawer>
- <SeePurchaseContractDrawer ref="seeDrawerFef"></SeePurchaseContractDrawer>
- label-width="85px"
- :model="searchParams"
- style="padding: 20px 0 0 0"
- <el-row :gutter="24">
- <el-col :span="20">
- <el-row :gutter="20">
- v-for="column in showSearchColumns"
- :key="column.title"
- :xl="6"
- :lg="6"
- :md="8"
- :sm="12"
- :xs="24"
- v-model="searchParams[column.key]"
- :span="3"
- :offset="1"
- style="text-align: right; padding-right: 40px"
- <el-button type="primary" size="mini">搜索</el-button>
- <el-button size="mini">重置</el-button>
- <el-divider>
- <i
- :class="isSimpleSearch ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
- @click="handleSearchChange"
- ></i>
- </el-divider>
- <el-row :gutter="24" style="padding: 0 20px">
- <el-col :span="6">123</el-col>
- <el-col :span="18" style="text-align: right">
- type="danger"
- style="margin: 0 10px 0 0"
- @click="handleOpenAddDrawer"
- 新增
- @row-dblclick="handleOpenSeeDrawer"
- :data="tableData"
- style="width: 100%; margin: 20px 0 0 0"
@@ -1,404 +0,0 @@
- name: "SeePurchaseContractDrawer",
- { key: "puOrg", title: "采购组织", type: "TagSelect", require: true },
- { key: "code", title: "合同编码", type: "Input" },
- { key: "contractName", title: "合同名称", type: "Input", require: true },
- { key: "supplier", title: "供应商", type: "TagSelect", require: true },
- { key: "contractType", title: "合同类型", type: "Select", require: true },
- { key: "puDept", title: "采购部门", type: "TagSelect", require: true },
- { key: "buyer", title: "采购员", type: "TagSelect" },
- { key: "source", title: "合同来源", type: "Select" },
- key: "signDate",
- title: "合同签订日期",
- type: "DatePicker",
- require: true,
- key: "effectiveDate",
- title: "合同生效日期",
- { key: "endDate", title: "合同终止日期", type: "DatePicker" },
- { key: "externalContract", title: "外部合同号", type: "Input" },
- { key: "refusalReasons", title: "拒绝理由", type: "Input" },
- { key: "enquiryCode", title: "询价单号", type: "Input" },
- { key: "externalFile", title: "对外附件", type: "Upload", span: 24 },
- { key: "puFile", title: "采购商盖章合同附件", type: "Upload", span: 24 },
- key: "supplierFile",
- title: "供应商盖章合同附件",
- type: "Upload",
- span: 24,
- { key: "projectName", title: "项目名称", type: "TagSelect" },
- { key: "projectCode", title: "项目编号", type: "Input" },
- { key: "area", title: "区域", type: "Input" },
- { key: "consigneePhone", title: "收货人联系方式", type: "Input" },
- { key: "paymentAgreement", title: "付款协议", type: "TagSelect" },
- { key: "currency", title: "币种", type: "TagSelect", require: true },
- { key: "taxPrice", title: "价税合计", type: "InputNumber" },
- { key: "guaranteePeriod", title: "质保期", type: "Input" },
- // { key: "lastPuMoney", title: "上年度采购额" },
- // { key: "buyerName", title: "采购员名称" },
- // { key: "supplierName", title: "供应商名称" },
- // { key: "puMoneyYear", title: "本年度采购额" },
- // { key: "puDeptName", title: "采购部门名称" },
- // { key: "supplierTier", title: "供应商层级" },
- // { key: "grossRateAverage", title: "平均毛利率" },
- // { key: "approveFlow", title: "审批流程" },
- // { key: "consumableClass", title: "耗材类别" },
- // { key: "brandGrossRate", title: "同类品牌及毛利率" },
- // { key: "contractFormat", title: "合同格式" },
- // { key: "productName", title: "产品类别&名称" },
- // { key: "invoiceTax", title: "发票税率" },
- // { key: "emergencyDegree", title: "紧急程度" },
- // { key: "project", title: "项目医院" },
- // { key: "deliveryType", title: "交货方式" },
- // { key: "contractPartyc", title: "合同丙方" },
- // { key: "contractPartycName", title: "合同丙方名称" },
- // { key: "guaranteePeriodEnd", title: "质保期限" },
- // { key: "freightMethods", title: "运费承担方式" },
- // { key: "isTarget", title: "是否有指标" },
- // { key: "contractTarget", title: "合同指标" },
- // { key: "exemptionPostageCondtion", title: "包邮条件" },
- // { key: "isRebate", title: "是否有返利" },
- // { key: "rebatePolicy", title: "返利政策" },
- // { key: "rollbackPolicy", title: "退换货政策" },
- // { key: "contractContent", title: "合同主要内容" },
- // { key: "currencyName", title: "币种名称" },
- // { key: "tenantId", title: "租户号" },
- // { key: "revision", title: "乐观锁" },
- // { key: "createByName", title: "创建人" },
- // { key: "updateByName", title: "创建人名称" },
- // { key: "delFlag", title: "删除标记" },
- const initColumns = () =>
- columns.map((column) => {
- if (column.type === "InputNumber") {
- if (column.type === "DatePicker") {
- const initParams = () => arr2Obj(initColumns(), "key", "value");
- const tabColumns = [
- title: "物料基本信息",
- tableColumns: [
- { title: "含税金额合计", key: "" },
- { title: "价格有效期(起)", key: "" },
- { title: "计划到货日期", key: "" },
- title: "合同条款",
- title: "合同费用",
- title: "付款协议信息",
- title: "合同执行组织范围",
- const initTabColumns = () => tabColumns;
- params: initParams(),
- options: [
- value: "选项1",
- label: "黄金糕",
- value: "选项2",
- label: "双皮奶",
- value: "选项3",
- label: "蚵仔煎",
- value: "选项4",
- label: "龙须面",
- value: "选项5",
- label: "北京烤鸭",
- console.log(this.params, this.columns);
- title="我是标题"
- :before-close="handleClose"
- <h3>查看</h3>
- <el-button size="mini" @click="setVisible(false)">取消</el-button>
- <el-button size="mini" type="info" @click="setVisible(false)"
- >保存并新增</el-button
- <el-button size="mini" type="danger" @click="setVisible(false)"
- >保存</el-button
- :span="column.span || 8"
- :required="column.required"
@@ -0,0 +1,459 @@
+ key: "billTypeName",
+ title: "订单类型",
+ optionsName: "sys_order_type", // 字典名
+ // { key: "billTypeName", title: "订单类型名称", },
+ { key: "oaDemandNo", title: "OA需求单号", type: "Input", },
+ { key: "code", title: "订单编号", type: "Input", },
+ key: "billDate",
+ title: "订单日期",
+ config: { type: "date" },
+ key: "finalTypeName",
+ componentName: "BALATYPE_PARAM",
+ finalType: "code",
+ finalTypeName: "name",
+ componentName: "CUSTOMER_PARAM",
+ customer: "code",
+ customerName: "name",
+ title: "总数量",
+ config: { controlsPosition: "right" },
+ key: "originalQty",
+ title: "原始总数量",
+ { key: "money", title: "价税合计", type: "Input", },
+ { key: "originalMoney", title: "原始总金额", type: "Input", },
+ { key: "notaxMoney", title: "无税金额", type: "Input", },
+ key: "status",
+ title: "单据状态",
+ optionsName: "sys_status", // 字典名
+ { key: "freezeCause", title: "冻结原因", type: "Checkbox", },
+ { key: "isBack", title: "退货", type: "Input", type: "Checkbox", },
+ { key: "isMarketing", title: "已协同生成销售订单", type: "Checkbox", },
+ { key: "isMarketingSource", title: "由销售订单协同生成", type: "Checkbox", },
+ key: "warehouseName",
+ title: "WMS入库仓库", // 收货仓库
+ componentName: "WAREHOUSE_PARAM",
+ warehouse: "code",
+ warehouseName: "name",
+ key: "goodsAllocationName",
+ componentName: "ALLOCATION_PARAM",
+ goodsAllocation: "code",
+ goodsAllocationName: "name",
+ pkOrg: 'puOrg',
+ { key: "isSendSrm", title: "是否同步SRM", type: "Checkbox", },
+ { key: "isInvoice", title: "发票标识", type: "Checkbox", },
+ { key: "supplierOrderNo", title: "供应商订单号", type: "Input", },
+ { key: "rebateMoney", title: "订单使用返利金额", type: "Input", },
+ { key: "deductionMoney", title: "订单抵扣余款金额", type: "Input", },
+ { key: "address", title: "收货地址", type: "Input", },
+ { key: "contacts", title: "收货联系人", type: "Input", },
+ key: "customerDeptName",
+ title: "客户部门",
+ componentName: "CUSTOMERDEPT_PARAM",
+ customerDept: "code",
+ customerDeptName: "name",
+ key: "supplierContactsName",
+ title: "供应商业务联系人",
+ componentName: "SUPPLIERCONTACTS_PARAM",
+ supplierContacts: "code",
+ supplierContactsName: "name",
+ { key: "isUrgency", title: "紧急程度", type: "Checkbox", },
+ { key: "isSendWms", title: "已同步WMS", type: "Checkbox", },
+ // { key: "agent", title: "代理人", type: "Input", }, // 建议删除
+ // { key: "agentName", title: "代理人名称", },
+ { key: "isClose", title: "最终关闭", type: "Checkbox", },
+ { key: "closeTime", title: "最终关闭日期", type: "Input", },
+ { key: "applyPaymentMoney", title: "累计付款申请金额", type: "Input", },
+ { key: "paymentMoney", title: "累计付款金额", type: "Input", },
+ { key: "invoiceMoney", title: "发票金额", type: "Input", },
+ // key: "supplierPersonal",
+ // title: "供应商业务员",
+ // // type: "InputDialog",
+ { key: "supplierPersonalName", title: "供应商业务员名称", type: "Input", },
+ { key: "isDeliver", title: "是否发货", type: "Checkbox", },
+ key: "retReason",
+ componentName: "RETREASON_PARAM",
+ retReason: "code",
+ // retReasonName: "name",
+ key: "processTypeName",
+ componentName: "PROCESSTYPE_PARAM",
+ processType: "code",
+ processTypeName: "name",
+ { key: "isEnd", title: "整单关闭标识", type: "Input", },
+ key: "projectNow",
+ title: "在建工程项目",
+ componentName: "PROJECT_PARAM",
+ projectNow: "code",
+ // processTypeName: "name",
+ key: "operatingItems",
+ title: "经营性项目",
+ componentName: "OPERATING_PARAM",
+ operatingItems: "code",
+ { key: "isArrivalReson", title: "到货超期原因", type: "Input", },
+ { key: "midOrderNo", title: "中台采购订单号", type: "Input", },
+ { key: "marketingCode", title: "销售订单号", type: "Input", },
+ { key: "isArrival", title: "到货超期", type: "Checkbox", },
+ { key: "createByName", title: "创建人名称", type: "Input", },
+ { key: "updateByName", title: "更新人名称", type: "Input", },
+ { key: "flowId", title: "OA流程ID", type: "Input", },
+ { key: "approver", title: "审批人", type: "Input", },
+ key: "approverFinishTime",
+ title: "审批时间",
+ key: "approveTime",
+ title: "提交时间",
+// export const initColumns = () => columns;
+ title: '物料信息',
+ key: 'puOrderItemList',
+ // { key: "id", title: "主键" },
+ { key: "rowNo", title: "行号", type: "Input", },
+ { key: "orderId", title: "采购订单ID", type: "Input", },
+ // {key: "material",title: "物料",type: "Input", },
+ { key: "materialName", title: "物料名称", type: "Input", },
+ key: "materialCode",
+ title: "物料编码",
+ material: "id",
+ materialCode: "code",
+ { key: "materialClassify", title: "物料分类", type: "Input", },
+ { key: "materialManufacturersCode", title: "厂家物料编码", type: "Input", },
+ { key: "specification", title: "规格", type: "Input", },
+ { key: "model", title: "型号", type: "Input", },
+ { key: "isMedcine", title: "医药物料", type: "Input", },
+ { key: "manufacturer", title: "生产厂家代理人", type: "Input", },
+ { key: "isDrug", title: "物料药品属性", type: "Input", },
+ { key: "unit", title: "单位", type: "Input", },
+ { key: "qty", title: "数量", type: "Input", },
+ { key: "taxPrice", title: "含税单价", type: "Input", },
+ { key: "tax", title: "税率", type: "Input", },
+ { key: "taxDeductMoneya", title: "折扣金额", type: "Input", },
+ { key: "arrivalQty", title: "已到货数量", type: "Input", },
+ { key: "unarrivedQty", title: "未到货数量", type: "Input", },
+ { key: "priceSource", title: "价格目录ID", type: "Input", },
+ { key: "isStorage", title: "入库关闭", type: "Input", },
+ { key: "isInvoice", title: "开票关闭", type: "Input", },
+ { key: "isArrival", title: "到货关闭", type: "Input", },
+ { key: "isPayment", title: "付款关闭", type: "Input", },
+ { key: "isGift", title: "赠品", type: "Input", },
+ title: "收货仓库", //WMS入库仓库
+ { key: "place", title: "收货地点", type: "Input", },
+ { key: "productBatch", title: "产品批号", type: "Input", },
+ { key: "manufactureDate", title: "生产日期", type: "Input", },
+ { key: "efficacyLoseDate", title: "有效期至/失效日期", type: "Input", },
+ { key: "approvalNumber", title: "批准文号", type: "Input", },
+ { key: "registration", title: "注册证号", type: "Input", },
+ key: "storageCondition",
+ title: "存储条件",
+ optionsName: "sys_storage_condition",
+ key: "carriageCondition",
+ title: "运输条件",
+ optionsName: "sys_conditions_carriage",
+ { key: "isBatchLock", title: "批号锁定标识", type: "Input", },
+ { key: "isReplenishment", title: "补单标识", type: "Input", },
+ { key: "isUrgency", title: "紧急标识", type: "Input", },
+ { key: "originalQty", title: "原始数量", type: "Input", },
+ { key: "originalMoney", title: "原始金额", type: "Input", },
+ { key: "directProductBatch", title: "直运产品批号", type: "Input", },
+ { key: "discountRule", title: "折扣规则编码", type: "Input", },
+ { key: "reservedQty", title: "预留数量", type: "Input", },
+ { key: "reservedPeriod", title: "预留周期", type: "Input", },
+ { key: "taxDeductClassify", title: "扣税类别", type: "Input", },
+ { key: "exchangeRate", title: "折本汇率", type: "Input", },
+ { key: "source", title: "上游单据号", type: "Input", },
+ { key: "sourceId", title: "上游单据ID", type: "Input", },
+ { key: "demandCode", title: "采购需求单号", type: "Input", },
+ { key: "arrivalDatePlan", title: "计划到货日期", type: "Input", },
+ key: "priceType",
+ title: "价格类型",
+ optionsName: "sys_price_type",
+ { key: "isDistributionPrice", title: "配送价", type: "Input", },
+ // { key: "materialClassifyOne", title: "物料一级分类",type: "Input", },
+ { key: "materialClassifyOneName", title: "物料一级分类名称", type: "Input", },
+ // { key: "materialClassifyTwo", title: "物料二级分类",type: "Input", },
+ { key: "materialClassifyTwoName", title: "物料二级分类名称", type: "Input", },
+ // { key: "materialClassifyThree", title: "物料三级分类",type: "Input", },
+ { key: "materialClassifyThreeName", title: "物料三级分类名称", type: "Input", },
+ // { key: "materialClassifyFour", title: "物料四级分类",type: "Input", },
+ { key: "materialClassifyFourName", title: "物料四级分类名称", type: "Input", },
+ { key: "price", title: "无税单价", type: "Input", }
+ title: '执行结果',
+ key: 'puOrderExecuteList',
+ // { key: "id", title: "主键",type: "Input", },
+ { key: "rowno", title: "行号", type: "Input", },
+ title: "物料",
+ // materialCode: "code",
+ // { key: "materialName", title: "物料名称", type: "Input", },
+ { key: "stroageQty", title: "累计到货主数量", type: "Input", },
+ { key: "stockQty", title: "累计入库主数量", type: "Input", },
+ { key: "invoiceQty", title: "累计开票主数量", type: "Input", },
+ { key: "rollbackQty", title: "累计退货主数量", type: "Checkbox", },
+ { key: "backStockQty", title: "累计退库主数量", type: "Input", },
+ { key: "floatQty", title: "未到货数量", type: "Input", },
+// export const initTabColumns = () => tabColumns;
@@ -0,0 +1,266 @@
+import orderApi from "@/api/business/purchase/purchase-order";
+const SelectColumns = NewColumns.filter(column => column.type === 'Select')
+NewTabColumns.forEach(column => {
+ SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.type === 'Select'))
+});
+ name: "AddPurchaseOrderDrawer",
+ dicts: initDicts(SelectColumns),
+ puOrderItemList: [],
+ puOrderExecuteList: [],
+ tabName: "puOrderItemList",
+ watch: {},
+ // 增行
+ // 删行
+ async handleSava() {
+ console.log(this.params, 'params');
+ const { code, msg } = await orderApi.create(this.params);
+ const { code, msg } = await orderApi.create({
+ <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+ @close="$emit('close')">
+ <el-form size="mini" label-position="right" label-width="135px" :model="params" :rules="rules">
+ <el-card :body-style="{
+ }" style="margin: 10px">
+ <div slot="header" style="
+ ">
+ <el-button size="mini" @click="handleCancel">取消</el-button>
+ <el-button size="mini" type="danger" @click="handleSava">保存</el-button>
+ <el-button size="mini" type="info" @click="handleSubmit">
+ 保存并新增
+ <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
+ <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
+ :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
+ <dr-input-dialog v-if="column.type === 'InputDialog'" v-model="params[column.key]"
+ :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+ :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
+ :data-mapping="column.config.dataMapping" :query-params="column.config.queryParams" :source.sync="params">
+ <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
+ style="width: 100%"></el-input>
+ <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
+ :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+ :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
+ <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
+ :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+ <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
+ :value="item.value">
+ <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
+ style="width: 100%">
+ <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+ <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
+ :picker-options="column.pickerOptions" style="width: 100%">
+ <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
+ false-label="N"></el-checkbox>
+ <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
+ action="https://jsonplaceholder.typicode.com/posts/" multiple>
+ <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+ <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+ :label="cColumn.title" :width="cColumn.width">
+ <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
+ :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+ size="mini" style="width: 100%"></el-input>
+ <dr-input-dialog v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
+ :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
+ :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" size="mini">
+ <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
+ :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+ :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini" style="width: 100%">
+ </el-input-number>
+ <el-select v-if="cColumn.type === 'Select'" v-model="params[cColumn.key]"
+ :placeholder="column.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+ <el-option v-for="item in dict.type[cColumn.config.optionsName]" :key="item.value" :label="item.label"
+ <el-checkbox v-else-if="cColumn.type === 'Checkbox'" v-model="params[cColumn.key]" true-label="Y"
+ <!-- <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
+ :readonly="column.readonly" style="width: 100%; cursor: pointer">
+ </el-input> -->
+ <el-button @click.native.prevent="
+ " type="text" size="small">
+ <el-button size="mini" @click="addTableRow(params[tabName])">增行</el-button>
@@ -0,0 +1,179 @@
+ // { key: "puOrg", title: "采购组织" },
+ { key: "puOrgName", title: "采购组织名称",search: true, type: "Input" },
+ { key: "billType", title: "订单类型" },
+ { key: "code", title: "订单编号",search: true, type: "Input" },
+ { key: "billDate", title: "订单日期" },
+ // { key: "supplier", title: "供应商" },
+ { key: "supplierName", title: "供应商名称",search: true, type: "Input" },
+ // { key: "currency", title: "币种" },
+ // { key: "buyer", title: "采购员" },
+ { key: "buyerName", title: "采购员" },
+ // { key: "puDept", title: "采购部门" },
+ // { key: "customer", title: "收货客户" },
+ { key: "customerName", title: "收货客户名称" },
+ { key: "isDeliver", title: "是否发货" },
+ { key: "isArrival", title: "到货超期" },
+ { key: "isBack", title: "退货" },
+ // { key: "freezeCause", title: "冻结原因" },
+ { key: "qty", title: "总数量" },
+ { key: "money", title: "总数量" },
+ { key: "isMarketing", title: "已协同生成销售订单" },
+ { key: "isMarketingSource", title: "由销售订单协同生成" },
+ // { key: "personal", title: "人员" },
+ { key: "personalName", title: "人员名称" },
+ // { key: "isSendSrm", title: "是否同步SRM" },
+ { key: "isInvoice", title: "发票标识" },
+ { key: "rebateMoney", title: "订单使用返利金额" },
+ { key: "deductionMoney", title: "订单抵扣余款金额" },
+ // { key: "warehouse", title: "WMS入库仓库" },
+ { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
+ // { key: "goodsAllocation", title: "货位" },
+ { key: "goodsAllocationName", title: "货位名称" },
+ // { key: "customerDept", title: "客户部门" },
+ { key: "customerDeptName", title: "客户部门名称" },
+ // { key: "supplierContacts", title: "供应商业务联系人" },
+ { key: "supplierContactsName", title: "供应商业务联系人名称" },
+ { key: "isUrgency", title: "紧急程度" },
+ // { key: "agent", title: "代理人" }, // 建议删除
+ { key: "agentName", title: "代理人名称" },
+ { key: "isClose", title: "最终关闭" },
+ { key: "applyPaymentMoney", title: "累计付款申请金额" },
+ { key: "paymentMoney", title: "累计付款金额" },
+ { key: "invoiceMoney", title: "发票金额" },
+ // { key: "supplierPersonal", title: "供应商业务员" },
+ { key: "supplierPersonalName", title: "供应商业务员名称" },
+ { key: "marketingCode", title: "销售订单号" },
+ { key: "flowId", title: "OA流程ID" },
+ { key: "approver", title: "审批人" },
+ { key: "approverFinishTime", title: "审批时间" },
+ { key: "approveTime", title: "提交时间" },
+ { key: "createTime", title: "制单日期/创建时间" },
+ { key: "remark", title: "备注" },
+ { key: "updateTime", title: "最后修改时间" },
+ { key: "oaDemandNo", title: "OA需求单号" },
+ { key: "address", title: "收货地址" },
+ { key: "contacts", title: "收获联系人" },
+ { key: "isSendWms", title: "已同步WMS" },
+ { key: "retReason", title: "退换原因" },
+ { key: "closeTime", title: "最终关闭日期" },
+ { key: "processType", title: "处理方式" },
+ { key: "isEnd", title: "整单关闭标识" },
+ { key: "projectNow", title: "在建工程项目" },
+ { key: "operatingItems", title: "经营性项目" },
+ { key: "isArrivalReson", title: "到货超期原因" },
+ { key: "midOrderNo", title: "中台采购订单号" }
+ { key: "rowNo", title: "行号" },
+ { key: "orderId", title: "采购订单ID" },
+ { key: "material", title: "物料" },
+ { key: "materialCode", title: "物料编码" },
+ { key: "materialClassify", title: "物料分类" },
+ { key: "materialManufacturersCode", title: "厂家物料编码" },
+ { key: "specification", title: "规格" },
+ { key: "model", title: "型号" },
+ { key: "isMedcine", title: "医药物料" },
+ { key: "manufacturer", title: "生产厂家代理人" },
+ { key: "isDrug", title: "物料药品属性" },
+ { key: "unit", title: "单位" },
+ { key: "qty", title: "数量" },
+ { key: "taxPrice", title: "含税单价" },
+ { key: "money", title: "价税合计" },
+ { key: "tax", title: "税率" },
+ { key: "taxDeductMoneya", title: "折扣金额" },
+ { key: "arrivalQty", title: "已到货数量" },
+ { key: "unarrivedQty", title: "未到货数量" },
+ { key: "notaxMoney", title: "无税金额" },
+ { key: "priceSource", title: "价格目录ID" },
+ { key: "isStorage", title: "入库关闭" },
+ { key: "isInvoice", title: "开票关闭" },
+ { key: "isArrival", title: "到货关闭" },
+ { key: "isPayment", title: "付款关闭" },
+ { key: "isGift", title: "赠品" },
+ { key: "warehouse", title: "收货仓库" },
+ { key: "place", title: "收货地点" },
+ { key: "productBatch", title: "产品批号" },
+ { key: "manufactureDate", title: "生产日期" },
+ { key: "efficacyLoseDate", title: "有效期至/失效日期" },
+ { key: "approvalNumber", title: "批准文号" },
+ { key: "registration", title: "注册证号" },
+ { key: "storageCondition", title: "存储条件" },
+ { key: "carriageCondition", title: "运输条件" },
+ { key: "isBatchLock", title: "批号锁定标识" },
+ { key: "isReplenishment", title: "补单标识" },
+ { key: "isUrgency", title: "紧急标识" },
+ { key: "originalQty", title: "原始数量" },
+ { key: "originalMoney", title: "原始金额" },
+ { key: "directProductBatch", title: "直运产品批号" },
+ { key: "discountRule", title: "折扣规则编码" },
+ { key: "reservedQty", title: "预留数量" },
+ { key: "reservedPeriod", title: "预留周期" },
+ { key: "taxDeductClassify", title: "扣税类别" },
+ { key: "exchangeRate", title: "折本汇率" },
+ { key: "source", title: "上游单据号" },
+ { key: "sourceId", title: "上游单据ID" },
+ { key: "arrivalDatePlan", title: "计划到货日期" },
+ { key: "isDistributionPrice", title: "配送价" },
+ // { key: "materialClassifyOne", title: "物料一级分类" },
+ { key: "materialClassifyOneName", title: "物料一级分类名称" },
+ // { key: "materialClassifyTwo", title: "物料二级分类" },
+ { key: "materialClassifyTwoName", title: "物料二级分类名称" },
+ // { key: "materialClassifyThree", title: "物料三级分类" },
+ { key: "materialClassifyThreeName", title: "物料三级分类名称" },
+ // { key: "materialClassifyFour", title: "物料四级分类" },
+ { key: "materialClassifyFourName", title: "物料四级分类名称" },
+ { key: "price", title: "无税单价" }
+ { key: "rowno", title: "行号" },
+ { key: "stroageQty", title: "累计到货主数量" },
+ { key: "stockQty", title: "累计入库主数量" },
+ { key: "invoiceQty", title: "累计开票主数量" },
+ { key: "rollbackQty", title: "累计退货主数量" },
+ { key: "backStockQty", title: "累计退库主数量" },
+ { key: "floatQty", title: "未到货数量" },
+ // { key: "delFlag", title: "删除标记" }
@@ -0,0 +1,282 @@
+//
+ name: "EditPurchaseOrderDrawer",
+ newProp === "1" ? element.key !== "puOrderItemList" : element
+ // this.fetchTable(id, newProp);
+ const { code, msg, data } = await orderApi.details(prop);
+ this.params = { ...this.params, ...data };
+ console.log(this.params, 'this.params----------');
+ // async fetchTable(prop, name) {
+ // const { code, msg, rows } = await itemTableList({ id: prop }, name);
+ // if (code === 200) {
+ // this.params[name] = rows;
+ // this.$notify.success({ title: msg });
+ // } else {
+ // this.$notify.warning({ title: msg });
+ // } catch (err) {
+ // this.$notify.error({ title: "error", message: err });
+ const { code, msg } = await (this.handleIsRevise(this.params.status) ?
+ orderApi.revision(this.params)
+ : orderApi.edit(this.params)
+ // 判断修订还是编辑
+ handleIsRevise(status) {
+ return status == '2';
+ console.log(this.params, 'this.params');
+ <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
+ <h3>{{ handleIsRevise(params.status) ? '修订' : '编辑' }}</h3>
+ <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
+ :readonly="column.readonly" :query-params="column.config.queryParams" :title="column.title"
+ :type="column.config.componentName" :data-mapping="column.config.dataMapping" :source.sync="params">
+ <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" :disabled="column.disabled"
+ true-label="Y" false-label="N">
+ </el-checkbox>
+ action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
+ {{ scope.row[cColumn.key] }}</span>
+ :size="size" style="width: 100%">
+ :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
+ false-label="N">
+ :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size" style="width: 100%">
+ <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
@@ -0,0 +1,365 @@
+<!-- 采购订单修订—— 列表 -->
+import { TableColumns, SearchColumns, TabColumns } from "./column";
+ name: "PuchaseOrder",
+ AddDrawer: () => import('./add/index.vue'),
+ SeeDrawer: () => import('./see/index.vue'),
+ EditDrawer: () => import('./edit/index.vue'),
+ // const tabColumns = [
+ // title: '物料信息',
+ // key: 'first',
+ // tableColumns: [
+ // { key: "rowNo", title: "行号" },
+ // { key: "orderId", title: "采购订单ID" },
+ // { key: "material", title: "物料" },
+ // { key: "materialName", title: "物料名称" },
+ // { key: "materialCode", title: "物料编码" },
+ // { key: "materialClassify", title: "物料分类" },
+ // { key: "materialManufacturersCode", title: "厂家物料编码" },
+ // { key: "specification", title: "规格" },
+ // { key: "model", title: "型号" },
+ // { key: "isMedcine", title: "医药物料" },
+ // { key: "manufacturer", title: "生产厂家代理人" },
+ // { key: "isDrug", title: "物料药品属性" },
+ // { key: "unit", title: "单位" },
+ // { key: "qty", title: "数量" },
+ // { key: "taxPrice", title: "含税单价" },
+ // { key: "money", title: "价税合计" },
+ // { key: "tax", title: "税率" },
+ // { key: "taxDeductMoneya", title: "折扣金额" },
+ // { key: "arrivalQty", title: "已到货数量" },
+ // { key: "unarrivedQty", title: "未到货数量" },
+ // { key: "notaxMoney", title: "无税金额" },
+ // { key: "priceSource", title: "价格目录ID" },
+ // { key: "isStorage", title: "入库关闭" },
+ // { key: "isInvoice", title: "开票关闭" },
+ // { key: "isArrival", title: "到货关闭" },
+ // { key: "isPayment", title: "付款关闭" },
+ // { key: "isGift", title: "赠品" },
+ // { key: "warehouse", title: "收货仓库" },
+ // { key: "place", title: "收货地点" },
+ // { key: "address", title: "收货地址" },
+ // { key: "productBatch", title: "产品批号" },
+ // { key: "manufactureDate", title: "生产日期" },
+ // { key: "efficacyLoseDate", title: "有效期至/失效日期" },
+ // { key: "approvalNumber", title: "批准文号" },
+ // { key: "registration", title: "注册证号" },
+ // { key: "storageCondition", title: "存储条件" },
+ // { key: "carriageCondition", title: "运输条件" },
+ // { key: "isBatchLock", title: "批号锁定标识" },
+ // { key: "isReplenishment", title: "补单标识" },
+ // { key: "isUrgency", title: "紧急标识" },
+ // { key: "originalQty", title: "原始数量" },
+ // { key: "originalMoney", title: "原始金额" },
+ // { key: "directProductBatch", title: "直运产品批号" },
+ // { key: "discountRule", title: "折扣规则编码" },
+ // { key: "reservedQty", title: "预留数量" },
+ // { key: "reservedPeriod", title: "预留周期" },
+ // { key: "taxDeductClassify", title: "扣税类别" },
+ // { key: "exchangeRate", title: "折本汇率" },
+ // { key: "source", title: "上游单据号" },
+ // { key: "sourceId", title: "上游单据ID" },
+ // { key: "demandCode", title: "采购需求单号" },
+ // { key: "arrivalDatePlan", title: "计划到货日期" },
+ // { key: "priceType", title: "价格类型" },
+ // { key: "isDistributionPrice", title: "配送价" },
+ // // { key: "tenantId", title: "租户号" },
+ // // { key: "revision", title: "乐观锁" },
+ // { key: "createByName", title: "创建人名称" },
+ // { key: "updateByName", title: "更新人名称" },
+ // // { key: "delFlag", title: "删除标记" },
+ // // { key: "materialClassifyOne", title: "物料一级分类" },
+ // { key: "materialClassifyOneName", title: "物料一级分类名称" },
+ // // { key: "materialClassifyTwo", title: "物料二级分类" },
+ // { key: "materialClassifyTwoName", title: "物料二级分类名称" },
+ // // { key: "materialClassifyThree", title: "物料三级分类" },
+ // { key: "materialClassifyThreeName", title: "物料三级分类名称" },
+ // // { key: "materialClassifyFour", title: "物料四级分类" },
+ // { key: "materialClassifyFourName", title: "物料四级分类名称" },
+ // { key: "price", title: "无税单价" }
+ // ]
+ // title: '执行结果',
+ // key: 'second',
+ // // { key: "id", title: "主键" },
+ // { key: "rowno", title: "行号" },
+ // { key: "stroageQty", title: "累计到货主数量" },
+ // { key: "stockQty", title: "累计入库主数量" },
+ // { key: "invoiceQty", title: "累计开票主数量" },
+ // { key: "rollbackQty", title: "累计退货主数量" },
+ // { key: "backStockQty", title: "累计退库主数量" },
+ // { key: "floatQty", title: "未到货数量" },
+ // // { key: "delFlag", title: "删除标记" }
+ // ];
+ const initTabColumns = () => TabColumns;
+ isSimpleSearch: true,
+ tabColumns: initTabColumns(),
+ tabTableDatas: {
+ computed: {
+ showSearchColumns() {
+ console.log(this.searchColumns, 'this.searchColumns');
+ return this.isSimpleSearch
+ ? this.searchColumns.slice(0, 4)
+ : this.searchColumns;
+ // watch: {
+ // $route: {
+ // handler: function (route) {
+ // this.redirect = route.query && route.query.redirect;
+ // immediate: true,
+ console.log("Vue", this);
+ const { code, msg, rows, total } = await orderApi.list({
+ handleSearchChange() {
+ this.isSimpleSearch = !this.isSimpleSearch;
+ this.$notify.info({
+ title: this.isSimpleSearch ? "Simple Search" : "All Search",
+ handleTabClick() { },
+ // 新增
+ const { setVisible } = this.$refs.addDrawerFef;
+ // 查看
+ async handleOpenSeeDrawer(row) {
+ const { id } = row;
+ const { setVisible, fetchItem } = this.$refs.seeDrawerFef;
+ // 编辑、修订
+ async handleOpenEditDrawer(row) {
+ const { setVisible, fetchItem } = this.$refs.editDrawerFef;
+ // 获取子表信息
+ async handleDetailsData(row) {
+ console.log(row, '获取详情信息');
+ const { code, msg, data } = await orderApi.details(row.id);
+ // 物料信息:puOrderItemList 执行结果:puOrderExecuteList
+ for (const key in this.tabTableDatas) {
+ this.tabTableDatas[key] = data[key];
+ async handleDeleteList(row) {
+ console.log(id, 'id');
+ const { code, msg } = await orderApi.remove(id);
+ // 提交
+ async handleSubmit(row) {
+ <el-card v-loading="loading" style="width: calc(100% - 24px); height: 100%; margin: 10px" :body-style="{ padding: 0 }">
+ <SeeDrawer ref="seeDrawerFef"></SeeDrawer>
+ <AddDrawer ref="addDrawerFef" @close="handleRefreshList"></AddDrawer>
+ <EditDrawer ref="editDrawerFef" @close="handleRefreshList"></EditDrawer>
+ <el-form size="mini" label-position="right" label-width="100px" :model="params" style="padding: 20px 0 0 0">
+ <el-col :span="20">
+ <el-row :gutter="20">
+ <el-col v-for="column in showSearchColumns" :key="column.title" :xl="6" :lg="6" :md="8" :sm="12" :xs="24">
+ <el-input v-model="params[column.key]" :placeholder="column.placeholder"></el-input>
+ <el-col :span="4" style="text-align: right; padding-right: 40px">
+ <el-button type="primary" size="mini" @click="handleQueryList">搜索</el-button>
+ <el-button size="mini" @click="handleResetList">重置</el-button>
+ <el-divider>
+ <i :class="isSimpleSearch ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" style="cursor: pointer"
+ @click="handleSearchChange"></i>
+ </el-divider>
+ <!-- 操作 -->
+ <!-- <el-col :span="6">123</el-col> -->
+ <el-col :span="24" style="text-align: right;margin: 0 10px 0 0">
+ <el-button-group style="margin-left: 10px">
+ <el-button size="mini" type="danger" @click="handleOpenAddDrawer">新增</el-button>
+ <el-button size="mini">复制</el-button>
+ </el-button-group>
+ <el-button size="mini">退回</el-button>
+ <el-button size="mini">采购退货</el-button>
+ <el-button size="mini">整单关闭</el-button>
+ <el-button size="mini">附件管理</el-button>
+ <el-button size="mini">单据追溯</el-button>
+ <el-table @row-dblclick="handleOpenSeeDrawer" @row-click="handleDetailsData" :data="tableData" size="mini"
+ highlight-current-row style="width: 100%; margin: 20px 0 0 0">
+ <el-table-column type="index" width="50" label="序号"></el-table-column>
+ <el-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.key" :label="column.title"
+ :width="column.width || 180" :show-overflow-tooltip="column.showOverflowTooltip || true">
+ <!-- <el-button @click.stop="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button> -->
+ <el-button type="text" size="small" @click.stop="handleOpenEditDrawer(scope.row)">
+ {{ scope.row.status == '2' ? '修订' : '编辑' }}</el-button>
+ <!-- 0=自由态,1=审批中,2=已审核,3=已驳回 -->
+ <el-button type="text" size="small" @click.stop="handleDeleteList(scope.row)">删除</el-button>
+ <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" type="text" size="mini"
+ @click.stop="handleSubmit(scope.row)">提交</el-button>
+ :page-sizes="pageSizes" :page-size="page.pageSize" :current-page="page.pageNum" hide-on-single-page
+ <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
+ <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row>
+ <el-table-column width="100" v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+ :label="cColumn.title">
@@ -0,0 +1,190 @@
+<!-- 采购订单修订—— 查看 -->
+ initColumns,
+ initDicts,
+ initRules,
+ initParams,
+} from "@/utils/init";
+ name: "SeePurchaseOrderDrawer",
+ //查询详情
+ // 取 消
+ beforeOpen() { },
+ created() { },
+ :readonly="column.readonly" style="width: 100%"></el-input>
+ <el-input-number v-else-if="column.type === 'InputNumber'" v-model="params[column.key]"
+ :clearable="column.clearable" :disabled="column.disabled" :readonly="column.readonly"
+ style="width: 100%"></el-input-number>
+ <el-select v-else-if="column.type === 'Select'" v-model="params[column.key]"
+ :readonly="column.readonly" style="width: 100%">
+ false-label="N" :disabled="column.disabled" :readonly="column.readonly">
+ <el-date-picker v-else-if="column.type === 'DatePicker'" v-model="params[column.key]"
+ :type="column.config.type" :placeholder="column.placeholder" :clearable="column.clearable"
+ :disabled="column.disabled" :readonly="column.readonly" :picker-options="column.pickerOptions"
+ <el-upload v-else-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled"
+ :readonly="column.readonly" drag action="https://jsonplaceholder.typicode.com/posts/" multiple>
+ <el-input v-else v-model="params[column.key]" :placeholder="column.placeholder"
+ :readonly="cColumn.readonly" size="mini" style="width: 100%"></el-input>
+ :clearable="cColumn.clearable" :disabled="cColumn.disabled" :readonly="cColumn.readonly" size="mini"
+ <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
+ :placeholder="column.placeholder" :clearable="column.clearable" :disabled="cColumn.disabled"
+ :readonly="cColumn.readonly" style="width: 100%; cursor: pointer"
+ @click.native.stop="openAsyncInputDialog(column, params)">
+ :disabled="cColumn.disabled" false-label="N"></el-checkbox>
@@ -1,249 +0,0 @@
- name: "AddPurchaseTaskDrawer",
- // components: initComponents(initColumns()),
- :controls-position="
- column.config && column.config.controlsPosition
@@ -1,598 +0,0 @@
-import AddPurchaseTaskDrawer from "./add-purchase-task.vue";
-import SeePurchaseTaskDrawer from "./see-purchase-task.vue";
-import DirectSourcingTable from "./direct-sourcing.vue";
- AddPurchaseTaskDrawer,
- SeePurchaseTaskDrawer,
- DirectSourcingTable,
- { title: "物料分类", key: "", type: "TagSelect" },
- { title: "物料", key: "", type: "TagSelect" },
- { title: "物料编码", key: "material", type: "Input" },
- { title: "物料描述", key: "materialDesc", type: "Input" },
- { title: "需求组织", key: "", type: "TagSelect" },
- { title: "需求日期", key: "", type: "DatePicker" },
- { title: "计划人员", key: "", type: "TagSelect" },
- { title: "采购组织", key: "", type: "TagSelect" },
- { title: "创建时间", key: "", type: "DatePicker" },
- { title: "采购员", key: "", type: "TagSelect" },
- { title: "状态", key: "", type: "Select" },
- title: "来源单据号",
- placeholder: "请输入来源单据号,多个用英文逗号分割",
- { title: "收货组织", key: "", type: "TagSelect" },
- { title: "采购分类", key: "", type: "Input" },
- // { title: "受理人", key: "", type: "TagSelect" },
- { title: "项目", key: "", type: "TagSelect" },
- { title: "需求部门", key: "", type: "TagSelect" },
- { title: "需求人", key: "", type: "TagSelect" },
- { title: "ERP信息", key: "", type: "Input" },
- title: "物料名称",
- key: "materialName",
- title: "物料编码",
- key: "material",
- title: "来源单据行号",
- title: "采购数量",
- title: "采购单位",
- title: "采购换算率",
- title: "主数量",
- title: "主计量单位",
- title: "计价单位",
- title: "计价换算率",
- title: "计价数量",
- title: "未执行数量",
- title: "主未执行数量",
- title: "计价未执行数量",
- title: "已执行数量",
- title: "交易类型",
- title: "分配日期",
- title: "SKU编码",
- title: "SKU名称",
- title: "SKU规格说明",
- title: "SKU型号",
- title: "SKU规格",
- title: "产品规格",
- title: "产品型号",
- title: "物料描述",
- title: "品牌",
- title: "计划价",
- title: "需求附件",
- title: "物料附件",
- title: "项目",
- title: "建议供应商",
- title: "需求组织",
- title: "需求部门",
- title: "需求人",
- title: "已下单采购数量",
- title: "采购组织",
- title: "采购员",
- title: "计划员",
- title: "计划部门",
- title: "联系电话",
- title: "采购分类",
- title: "收货人",
- title: "收货地址",
- title: "收货人电话",
- title: "需求时间",
- // {
- // title: "受理状态",
- // key: "material",
- title: "状态",
- // title: "受理人",
- title: "委托受理人",
- title: "弹性分单条件",
- title: "ERP相关信息",
- title: "创建时间",
- title: "最新价格",
- title: "生产厂家",
- title: "报价供应商",
- title: "历史最低价",
- title: "生产订单状态",
- // title: "寻源退回原因",
- title: "收货仓库档案编码",
- title: "自定义项16",
- title: "收货客户",
- title: "入库仓库",
- title: "货位",
- title: "指定供应商",
- title: "单位",
- title: "自定义项15",
- title: "收货联系人",
- title: "需求来源",
- const initTableData = () => {
- const data = [];
- for (let index = 0; index < 25; index++) {
- data.push({ materialName: index });
- return data;
- tableData: initTableData(),
- // this.fetchTaskList();
- const { code, msg, rows, total } = await taskList({
- <AddPurchaseTaskDrawer ref="addDrawerFef"></AddPurchaseTaskDrawer>
- <SeePurchaseTaskDrawer ref="seeDrawerFef"></SeePurchaseTaskDrawer>
- <el-col :span="22">
- <el-col :span="2">
- <el-col :span="24">
- v-show="!isSimpleSearch"
- :span="24"
- style="margin: 10px 0 0"
- <el-dropdown placement="bottom-start">
- <el-button size="mini" style="margin: 0 10px 0 0">
- 发布
- <i class="el-icon-arrow-down el-icon--right"></i>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item>发布寻源</el-dropdown-item>
- <el-dropdown-item>发布委托</el-dropdown-item>
- <el-dropdown-item>采购方案</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- style="border-right: 0; border-radius: 3px 0 0 3px"
- 首次协议直采
- <el-dropdown-item>首次协议直采</el-dropdown-item>
- <el-dropdown-item>余量协议直采</el-dropdown-item>
- <el-button size="mini" style="border-right: 0; border-radius: 0">
- 跟单采购
- <el-dropdown-item>按合同(普通)取价</el-dropdown-item>
- Excel导出
- style="margin: 0; border-right: 0; border-radius: 0"
- 退回请购
- 清单采购
- <el-dropdown-item>商超匹配下单</el-dropdown-item>
- disabled
- style="margin: 0 10px 0 0; border-radius: 0 3px 3px 0"
- 一键合同下单
- <el-button size="mini" style="margin: 0 10px 0 0">删除</el-button>
- <el-dropdown placement="bottom-end">
- <el-button size="mini">
- 更多
- <el-dropdown-item>抢单</el-dropdown-item>
- <el-dropdown-item>批量修改收货组织</el-dropdown-item>
- <el-dropdown-item>批量退回</el-dropdown-item>
- <el-dropdown-item>退回需求申请</el-dropdown-item>
- <el-dropdown-item>刷新缓存</el-dropdown-item>
- <DirectSourcingTable></DirectSourcingTable>
@@ -1,158 +0,0 @@
- name: "SeePurchaseTaskDrawer",
- type: "TagSelect",
- value: [],
- required: true,
- { title: "需求来源", key: "source", type: "Input", value: "采购创建" },
- { title: "采购员", key: "buyer", value: [], type: "TagSelect" },
- { title: "交易类型", key: "billYpe", value: [], type: "TagSelect" },
- { title: "物料编码", key: "material", type: "Input", required: true },
- title: "物料/物料描述",
- key: "materialDesc",
- { title: "生产厂家", key: "manufacturer", type: "Input" },
- { title: "收货客户", key: "customer", type: "TagSelect", value: [] },
- key: "puUnit",
- key: "puQty",
- type: "InputNumber",
- key: "demandDate",
- { title: "项目名称", key: "projectName", type: "TagSelect", value: [] },
- { title: "需求人", key: "demandPersonal", type: "TagSelect", value: [] },
- key: "demandOrg",
- { title: "需求部门", key: "demandDept", type: "TagSelect", value: [] },
- { title: "建议供应商", key: "supplier", type: "TagSelect", value: [] },
- { title: "收货人", key: "a", type: "TagSelect", value: [] },
- { title: "收货组织", key: "b", type: "TagSelect", value: [] },
- { title: "收货人联系方式", key: "c", type: "Input" },
- { title: "收货地址", key: "d", type: "Input" },
- { title: "收货仓库", key: "e", type: "TagSelect", value: [] },
- key: "assignSupplier",
- { title: "单位", key: "unit", type: "TagSelect", value: [] },
- { title: "收货地址", key: "f", type: "TagSelect", value: [] },
- const initColumns = () => columns;
- async fetchTaskItem() {
- // do something
- <el-descriptions title="采购任务详情" direction="vertical" :column="3">
- <el-descriptions-item
- {{ params[column.key] }}
- </el-descriptions-item>
- </el-descriptions>
- 'text-align': 'right',
- padding: '10px 20px',
- position: fixed;
- left: 0;
- bottom: 0;
- margin: 10px;
- width: calc(100% - 20px);
- <el-button size="mini" @click="setVisible(false)">返回</el-button>
+ { key: "id", title: "主键" },
+ { key: "material", title: "物料", search: true, type: "Input" },
+ { key: "materialName", title: "物料名称", search: true, type: "Input" },
+ title: "状态",
+ optionsName: "purchase_task_status",
+ { key: "materialDesc", title: "物料/物料描述", search: true, type: "Input" },
+ { key: "manufacturerName", title: "生产厂家名称" },
+ { key: "buyerName", title: "采购员名称", search: true, type: "Input" },
+ { key: "supplier", title: "建议供应商" },
+ { key: "supplierName", title: "建议供应商名称" },
+ { key: "puOrgName", title: "采购组织名称", search: true, type: "Input" },
+ { key: "billYpe", title: "交易类型" },
+ { key: "source", title: "需求来源" },
+ { key: "customer", title: "收货客户" },
+ { key: "puUnit", title: "采购单位" },
+ { key: "puUnitName", title: "采购单位名称" },
+ { key: "puQty", title: "采购数量" },
+ { key: "demandDate", title: "需求时间", search: true, type: "Input" },
+ { key: "demandPersonal", title: "需求人" },
+ key: "demandPersonalName",
+ title: "需求人名称",
+ { key: "demandOrg", title: "需求组织", search: true, type: "Input" },
+ { key: "demandOrgName", title: "需求组织名称" },
+ { key: "demandDept", title: "需求部门" },
+ { key: "demandDeptName", title: "需求部门名称", search: true, type: "Input" },
+ { key: "isBack", title: "是否退回" },
+ { key: "baskCause", title: "退回原因" },
+ { key: "backDate", title: "退回日期" },
+ { key: "assignSupplier", title: "指定供应商" },
+ { key: "assignSupplierName", title: "指定供应商名称" },
+ { key: "unitName", title: "单位名称" },