切换分支备份

purchase
anthonyywj2 3 years ago
parent c5e9d69a61
commit 0070296594

@ -1,7 +1,7 @@
{
"UDI_SYNC_SERVER_IP": "http://192.168.0.109:9991/",
"BASE_URL": "http://192.168.0.109:9991",
"SERVER_IP": "http://192.168.0.109:9991",
"WEBSOCKET_URL": "ws://192.168.0.109:9991/UDI_WMS_MC/api/websocket/",
"UDI_SYNC_SERVER_IP": "http://192.168.1.18:9991/",
"BASE_URL": "http://192.168.1.18:9991",
"SERVER_IP": "http://192.168.1.18:9991",
"WEBSOCKET_URL": "ws://192.168.1.18:9991/UDI_WMS_MC/api/websocket/",
"hosp_name": "平和县医院"
}

@ -0,0 +1,72 @@
import request from '@/utils/axios'
import axios from "@/utils/axios";
// 查询pur列表
export function listApply(query) {
return request({
url: '/purchase/apply/list',
method: 'get',
params: query
})
}
// 查询详情列表
export function listApplyDetail(query) {
return request({
url: '/purchase/apply/list/detail',
method: 'get',
params: query
})
}
// 查询pur详细
export function getApply(id) {
return request({
url: '/purchase/apply/' + id,
method: 'get'
})
}
// 新增pur
export function addApply(data) {
return request({
url: '/purchase/apply',
method: 'post',
data: data
})
}
// 修改pur
export function updateApply(data) {
return request({
url: '/purchase/apply',
method: 'put',
data: data
})
}
// 删除pur
export function delApply(id) {
return request({
url: '/purchase/apply/' + id,
method: 'delete'
})
}
export function inserThrOrderWeb(query) {
return axios({
url: "/purchase/apply/postOrder",
method: "post",
data: query
});
}
// 删除pur
export function delApplyDetail(id) {
return request({
url: '/purchase/apply/detail/' + id,
method: 'delete'
})
}

@ -15,6 +15,11 @@ import axios from "axios";
import "../public/config.json";
import myReq from "./utils/axios";
import myReq2 from "./utils/axios2";
import {parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree} from "@/utils/ruoyi";
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
// 注册全局组件register global
Vue.component("icon-svg", IconSvg);
Vue.use(allTools);

@ -124,6 +124,13 @@ import BasicEntrutsRece from "../views/basic/BasicEntrutsRece.vue";
//同步管理
import sysUdimsDownloadData from "../views/thrsys/SysUdimsDownloadData";
//采购管理
import purApply from "../views/purchase/purApply";
import purPlan from "../views/purchase/purPlan";
// Vue.use(VueRouter);
const err401 = r =>
@ -799,6 +806,84 @@ export const asyncRouterMap = [
]
},
{
path: "/purchase",
component: Home,
redirect: "/purchase/apply",
icon: "tongyong",
name: "采购管理",
noDropdown: false,
meta: {
authRule: ["purchase"]
},
children: [
{
path: "/apply",
component: Empty,
name: "产品申购管理",
redirect: "/apply/applyAdd",
meta: {
authRule: ["purchase/apply"]
},
children: [
{
path: "applyAdd",
component: purApply,
name: "新增申购单据",
meta: {
authRule: ["purchase/apply/add"]
}
},
{
path: "applySearch",
component: purApply,
name: "申购单据查询",
meta: {
authRule: ["purchase/apply/search"]
}
},
]
},
{
path: "/plan",
component: Empty,
name: "采购计划管理",
redirect: "/plan/planAdd",
meta: {
authRule: ["plan/planAdd"]
},
children: [
{
path: "planAdd",
component: purPlan,
name: "新增采购计划",
meta: {
authRule: ["purchase/plan/planAdd"]
}
},
{
path: "planSearch",
component: purPlan,
name: "采购计划查询",
meta: {
authRule: ["purchase/plan/planSearch"]
}
},
]
},
]
},
{
path: "/warehouse",
redirect: "/warehouse/product",

@ -0,0 +1,237 @@
/**
* 通用js方法封装处理
* Copyright (c) 2019 ruoyi
*/
// 日期格式化
export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) {
return null
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
// 表单重置
export function resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
}
// 添加日期范围
export function addDateRange(params, dateRange, propName) {
let search = params;
search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {};
dateRange = Array.isArray(dateRange) ? dateRange : [];
if (typeof (propName) === 'undefined') {
search.params['beginTime'] = dateRange[0];
search.params['endTime'] = dateRange[1];
} else {
search.params['begin' + propName] = dateRange[0];
search.params['end' + propName] = dateRange[1];
}
return search;
}
// 回显数据字典
export function selectDictLabel(datas, value) {
if (value === undefined) {
return "";
}
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].value == ('' + value)) {
actions.push(datas[key].label);
return true;
}
})
if (actions.length === 0) {
actions.push(value);
}
return actions.join('');
}
// 回显数据字典(字符串数组)
export function selectDictLabels(datas, value, separator) {
if (value === undefined) {
return "";
}
var actions = [];
var currentSeparator = undefined === separator ? "," : separator;
var temp = value.split(currentSeparator);
Object.keys(value.split(currentSeparator)).some((val) => {
var match = false;
Object.keys(datas).some((key) => {
if (datas[key].value == ('' + temp[val])) {
actions.push(datas[key].label + currentSeparator);
match = true;
}
})
if (!match) {
actions.push(temp[val] + currentSeparator);
}
})
return actions.join('').substring(0, actions.join('').length - 1);
}
// 字符串格式化(%s )
export function sprintf(str) {
var args = arguments, flag = true, i = 1;
str = str.replace(/%s/g, function () {
var arg = args[i++];
if (typeof arg === 'undefined') {
flag = false;
return '';
}
return arg;
});
return flag ? str : '';
}
// 转换字符串undefined,null等转化为""
export function parseStrEmpty(str) {
if (!str || str == "undefined" || str == "null") {
return "";
}
return str;
}
// 数据合并
export function mergeRecursive(source, target) {
for (var p in target) {
try {
if (target[p].constructor == Object) {
source[p] = mergeRecursive(source[p], target[p]);
} else {
source[p] = target[p];
}
} catch (e) {
source[p] = target[p];
}
}
return source;
};
/**
* 构造树型结构数据
* @param {*} data 数据源
* @param {*} id id字段 默认 'id'
* @param {*} parentId 父节点字段 默认 'parentId'
* @param {*} children 孩子节点字段 默认 'children'
*/
export function handleTree(data, id, parentId, children) {
let config = {
id: id || 'id',
parentId: parentId || 'parentId',
childrenList: children || 'children'
};
var childrenListMap = {};
var nodeIds = {};
var tree = [];
for (let d of data) {
let parentId = d[config.parentId];
if (childrenListMap[parentId] == null) {
childrenListMap[parentId] = [];
}
nodeIds[d[config.id]] = d;
childrenListMap[parentId].push(d);
}
for (let d of data) {
let parentId = d[config.parentId];
if (nodeIds[parentId] == null) {
tree.push(d);
}
}
for (let t of tree) {
adaptToChildrenList(t);
}
function adaptToChildrenList(o) {
if (childrenListMap[o[config.id]] !== null) {
o[config.childrenList] = childrenListMap[o[config.id]];
}
if (o[config.childrenList]) {
for (let c of o[config.childrenList]) {
adaptToChildrenList(c);
}
}
}
return tree;
}
/**
* 参数处理
* @param {*} params 参数
*/
export function tansParams(params) {
let result = ''
for (const propName of Object.keys(params)) {
const value = params[propName];
var part = encodeURIComponent(propName) + "=";
if (value !== null && value !== "" && typeof (value) !== "undefined") {
if (typeof value === 'object') {
for (const key of Object.keys(value)) {
if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') {
let params = propName + '[' + key + ']';
var subPart = encodeURIComponent(params) + "=";
result += subPart + encodeURIComponent(value[key]) + "&";
}
}
} else {
result += part + encodeURIComponent(value) + "&";
}
}
}
return result
}
// 验证是否为blob格式
export async function blobValidate(data) {
try {
const text = await data.text();
JSON.parse(text);
return false;
} catch (error) {
return true;
}
}

@ -0,0 +1,383 @@
<template>
<div>
<el-card class="el-card">
<el-form :inline="true" :model="filterQuery"
class="query-form" size="mini">
<el-row>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.billNo"
placeholder="单据号"
clearable
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<span style="color: #000; margin-left: 10px; margin-right: 6px">单据日期:</span>
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button-group style="display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="onSubmitFind"></el-button>
<el-button type="primary" icon="search" @click="newDistributionForm()" :loading="loading">
新增单据
</el-button>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row="true"
@current-change="handleDetail">
<el-table-column label="序号" type="index" width="60"></el-table-column>
<el-table-column label="单据号" prop="billNo"></el-table-column>
<el-table-column label="申购日期" prop="billDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.billDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="创建人" prop="createBy"></el-table-column>
<el-table-column label="部门" prop="deptCode"></el-table-column>
<el-table-column label="申购说明" prop="remark"></el-table-column>
<el-table-column label="状态" prop="status">
<template slot-scope="scope">
<el-tag :type="(scope.row.status) | statusFilterType">
{{ statusMap[scope.row.status] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.stop="submitOrder(scope.row)"
>提交
</el-button>
<el-button
type="text"
size="small"
@click.native="newDistributionForm(scope.$index, scope.row)"
>编辑
</el-button
>
<el-button type="text" size="small" @click.native.stop="deleteDialog(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
:current-page="filterQuery.page"
></el-pagination>
</el-card>
<el-card class="el-card">
<el-table v-loading="loading" :data="detailList" style="width: 100%">
<el-table-column label="序号" type="index" width="120"></el-table-column>
<el-table-column label="产品编码" prop="productId"></el-table-column>
<el-table-column label="产品通用名" prop="productName" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="生产企业" prop="manufactory" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="计量单位" prop="measname" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="申购数量" prop="count"></el-table-column>
</el-table>
</el-card>
<el-dialog
:title="formMap[formName]"
:visible.sync="newSpDistributionVisible"
width="80%"
v-if="newSpDistributionVisible"
@close='closeDialog'
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<pureApplyEdit
:closeDialog="closeDialog"
:idQuery="idQuery"
></pureApplyEdit>
</el-dialog>
</div>
</template>
<script>
import pureApplyEdit from "./pureApplyEdit";
import {delApply, inserThrOrderWeb, listApply, listApplyDetail} from "@/api/purchase/purApply";
export default {
data() {
return {
filterQuery: {
billAction: null,
billNo: "",
originType: null,
thirdSysFk: "",
page: 1,
limit: 10,
corpName: null,
type: 1,
editStatus: 1,
},
formName: null,
formMap: {
add: "新增领用单据",
update: "编辑领用单据",
},
statusMap: {
1: "草稿",
2: "未审核",
3: "已审核",
},
idQuery: {},
total: 0,
thirdSys: [],
thirdSysDetail: null,
busTypes: [],
originTypes: [],
list: [],
detailList: [],
loading: false,
actDateRange: [],
newSpDistributionVisible: false,
pickerOptions: {
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
billNo: "",
thirdSysFk: "",
billFlag: null,
billAction: null,
startDate: null,
endDate: null,
page: 1,
limit: 10,
corpName: null,
type: 1,
editStatus: 1,
};
this.actDateRange = [];
this.getList();
},
onSubmitFind() {
this.filterQuery.page = 1;
this.getList();
},
getList() {
if (this.actDateRange != null) {
this.filterQuery.startDate = this.actDateRange[0];
this.filterQuery.endDate = this.actDateRange[1];
} else {
this.filterQuery.startDate = null;
this.filterQuery.endDate = null;
}
this.loading = true;
listApply(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
} else {
this.$message.error(response.message);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
handleDetail(row) {
let query = {orderIdFk: row.id};
this.loading = true;
listApplyDetail(query) //
.then((response) => {
this.detailList = response.data.list || [];
this.total = response.data.total || 0;
this.loading = false;
})
.catch(() => {
this.loading = false;
this.detailList = [];
this.total = 0;
});
},
submitOrder(row) {
this.loading = true;
let tQuery = {
editStatus: 2,
purApplyEntity: row,
}
inserThrOrderWeb(tQuery)
.then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("提交成功!");
this.getList();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
})
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delApply(row.id)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
this.getList();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
closeDialog() {
this.newSpDistributionVisible = false;
this.getList();
this.detailList = [];
},
newDistributionForm(index, row) {
this.idQuery.id = '';
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.idQuery.id = row.id;
this.idQuery.formData = row;
this.formName = "update";
} else
this.formName = "add";
this.newSpDistributionVisible = true;
},
}
,
components: {
pureApplyEdit,
}
,
filters: {
statusFilterType(status) {
const statusMap = {
1: "warning",
2: "success",
};
return statusMap[status];
}
,
}
,
mounted() {
}
,
created() {
let end = new Date();
let start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.actDateRange = [start, end];
this.getList();
}
,
}
;
</script>
<style scoped>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 25%;
}
.text {
font-size: 13px;
font-family: "Microsoft YaHei";
}
.query-form-item {
display: block !important;
margin-right: 10px;
margin-bottom: 5px;
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "purPlan"
}
</script>
<style scoped>
</style>

@ -0,0 +1,431 @@
<template>
<div>
<el-form :model="formData" :rules="formRules" ref="dataForm">
<el-row type="flex" justify="end">
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px">
<el-button
type="primary"
@click.native="saveOrder('1')"
:loading="loading"
>草稿保存
</el-button
>
<el-button
type="primary"
@click.native="saveOrder('2')"
:loading="loading"
>提交单据
</el-button
>
</el-button-group>
</el-row>
<el-card style="margin-top: -5px;">
<el-row :gutter="20" style="margin-top: 10px;">
<el-col :span="3">
<div class="ao-text">
<span>单据号</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="billNo">
<el-input v-model="formData.billNo" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>单据日期</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="billdate">
<el-date-picker
v-model="formData.billDate"
type="datetime"
placeholder="选择日期"
style="width: 100%"
:clearable="false"
value-format="yyyy-MM-dd HH:mm:ss"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" style="margin-top: -10px">
<el-col :span="3">
<div class="ao-text">
<span>申购部门</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="billNo">
<el-input v-model="formData.deptCode" auto-complete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>申购说明</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="billNo">
<el-input v-model="formData.remark" auto-complete="off" type="textarea" autosize></el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card>
<el-button-group style="display: flex">
<el-button
type="primary"
size="small"
@click.native.stop="selectProductFunction()"
style="margin: 0px 60px 10px auto; height: 35px"
:loading="loading"
>产品录入
</el-button
>
</el-button-group>
<el-table v-loading="loading" :data="codeArray" style="width: 100%;"
:row-class-name="tableRowClassName"
max-height="300" height="300" ref="multipleTable">
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column
label="产品通用名"
prop="productName"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="规格型号"
prop="spec"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="计量单位"
prop="measname"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="生产厂家"
prop="manufactory"
show-overflow-tooltip
></el-table-column>
<el-table-column width="150" label="单据数量">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.count"
placeholder="请输入数量" style="width: 80%"
type='number'
@change="tableCountChange(scope.row)"
:disabled="scope.row.index !== selectedIndex"
oninput="value=value.replace(/[^\d]/g,'')"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button
type="text"
size="small"
:disabled="scope.row.index === selectedIndex"
@click.stop="true"
@click.native="rowChange(scope.row)"
>编辑
</el-button
>
<el-button
type="text"
size="small"
@click.stop="true"
@click.native="deleteCodeArray(scope.$index, scope.row)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
</el-form>
<el-dialog
title="产品录入"
:visible.sync="selectProductVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="85%"
v-if="selectProductVisible"
:append-to-body='true'
>
<stockOrderNewSelectProduct
:closeDialog="closeDialogC2"
:data="thisData"
></stockOrderNewSelectProduct>
</el-dialog>
</div>
</template>
<script>
import draggable from "vuedraggable";
import stockOrderNewSelectProduct from "../business/stockOrderNewSelectProduct";
import {inserThrOrderWeb, delApplyDetail, listApplyDetail} from "@/api/purchase/purApply";
export default {
name: "idQuery",
props: {
closeDialog: {
type: Function,
required: true,
},
idQuery: {
type: Object,
required: true,
},
},
data() {
return {
code: "",
query: {
orderIdFk: "",
page: 1,
limit: 10,
},
formData: {
id: null,
billNo: null,
billDate: "",
remark: "",
deptCode: null,
},
formRules: {},
codeArray: [],
total: 0,
loading: false,
index: null,
formLoading: false,
formVisible: false,
deleteLoading: false,
orderNo: null,
statusMap: {
1: "草稿",
2: "未审核",
3: "已审核",
},
typeMap: {
1: "预入库",
2: "普通采购",
},
orderEditor: true,
sOptions: [],
sValue: [],
sList: [],
sLoading: false,
busTypes: [],
currentRow: {},
selectedIndex: "",
selectProductVisible: false,
thisData: {},
storageList: [],
invQueryData: {},
};
},
components: {
draggable,
stockOrderNewSelectProduct,
},
methods: {
saveOrder(status) {
this.$refs["dataForm"].validate(valid => {
if (valid) {
if (this.codeArray.length < 1) {
this.$message.warning('未添加产品');
return;
}
if (status === '0') {
for (let i = 0; i < this.codeArray.length; i++) {
if (this.$isBlank(this.codeArray[i].count) || this.codeArray[i].count == "0") {
return this.$message.error('单据数量不能为0');
}
}
}
if (status == "1") {
this.submitFunction(status);
} else {
let tip = "是否确定提交订单?";
this.$confirm(tip, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.submitFunction(status);
}).catch(() => {
this.loading = false;
});
}
}
});
},
submitFunction(status) {
let tMessage = status === '1' ? '保存' : '提交';
this.loading = true;
let tQuery = {
editStatus: status,
purApplyEntity: this.formData,
subErpOrders: this.codeArray,
}
inserThrOrderWeb(tQuery)
.then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success(tMessage + "成功");
this.closeDialog(true);
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
})
},
selectProductFunction() {
this.selectProductVisible = true;
},
closeDialogC2(rData) {
this.selectProductVisible = false;
this.thisData = {};
if (this.$isNotBlank(rData)) {
this.codeArray = [];
rData.forEach((obj, index) => {
this.codeArray.unshift(obj);
});
this.$refs.multipleTable.setCurrentRow(this.codeArray[0]);
this.currentRow = this.codeArray[0];
this.selectedIndex = 0;
}
},
rowChange(val) {
this.currentRow = val;
this.selectedIndex = val.index;
},
tableCountChange(row) {
if (this.$isNotBlank(row)) {
// row.count = row.reCount;
}
},
tableRowClassName({row, rowIndex}) {
row.index = rowIndex;
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$refs["dataForm"].resetFields();
this.getList();
}
},
deleteCodeArray(index, row) {
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.$refs.multipleTable.setCurrentRow();
this.currentRow = {};
this.selectedIndex = "";
if (this.orderEditor) {
this.detailLoading = true;
if (this.$isNotBlank(row.id)) {
delApplyDetail(row.id)
.then(response => {
this.detailLoading = false;
if (response.code === 20000) {
this.$message.success(response.data);
// this.getStockOrderDetailList();
this.codeArray.splice(index, 1);
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.detailLoading = false;
})
} else {
this.$message.success('删除成功');
this.codeArray.splice(index, 1);
}
} else {
this.$message.success('删除成功');
this.codeArray.splice(index, 1);
}
}).catch(() => {
});
},
getStockOrderDetailList() {
this.loading = true;
listApplyDetail(this.query) //
.then((response) => {
console.log(response)
this.codeArray = response.data.list || [];
this.total = response.data.total || 0;
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
},
filters: {},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
},
created() {
if (this.$isNotBlank(this.idQuery.id)) {
this.query.limit = 100;
this.query.orderIdFk = this.idQuery.id;
this.formData = this.idQuery.formData;
this.orderEditor = true;
this.sValue = this.formData.corpName;
this.getStockOrderDetailList();
} else {
this.formData = {
id: null,
billNo: null,
billDate: "",
remark: "",
};
this.orderEditor = false;
}
this.codeArray = [];
},
};
</script>
<style>
.ao-text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
float: right;
text-align: right;
margin-top: 10px;
}
</style>
Loading…
Cancel
Save