Browse Source

备件 看板相关

branch_ccpg_220107
44673626 3 years ago
parent
commit
af4dd2b4da
  1. 12
      vue/src/components/ImportExcel-base/index.vue
  2. 10
      vue/src/router/modules/hq_out_order.js
  3. 2
      vue/src/views/login/index.vue
  4. 105
      vue/src/views/ux/billManage/kanbanWithOutOrder/detail.vue
  5. 38
      vue/src/views/ux/billManage/sparepartOutOrder/detail.vue
  6. 761
      vue/src/views/ux/vw/dataInput/hq_kb_output/detail.vue
  7. 340
      vue/src/views/ux/vw/dataInput/hq_kb_output/index.vue
  8. 138
      vue/src/views/ux/vw/dataInput/hq_y_outorder/detail.vue
  9. 706
      vue/src/views/ux/vw/dataInput/hq_y_outorder/detail_old.vue

12
vue/src/components/ImportExcel-base/index.vue

@ -310,6 +310,7 @@ export default {
hqYPlatform: "一汽轿车", //轿 hqYPlatform: "一汽轿车", //轿
vwoutorder: "准时化出库单", vwoutorder: "准时化出库单",
sparepartoutorder: "大众备件出库单", sparepartoutorder: "大众备件出库单",
sparepartoutorder90: "大众备件调整出库单",
kanbanoutorder: "大众看板出库单", kanbanoutorder: "大众看板出库单",
HQ_H_OUTORDER: "红旗H平台出库单", HQ_H_OUTORDER: "红旗H平台出库单",
HQ_M_OUTORDER: "红旗M平台出库单", HQ_M_OUTORDER: "红旗M平台出库单",
@ -319,7 +320,7 @@ export default {
bomdatabase: "产品结构BOM", bomdatabase: "产品结构BOM",
HQ_H_CHECKOUT: "红旗H平台备件出库单", HQ_H_CHECKOUT: "红旗H平台备件出库单",
HQ_M_CHECKOUT: "红旗M平台备件出库单", HQ_M_CHECKOUT: "红旗M平台备件出库单",
HQ_Y_CHECKOUT: "一汽轿车平台备件出库单", //HQ_Y_CHECKOUT: "轿",
prebatch: "预批量", prebatch: "预批量",
secondaryPriceRatio: "二配结算价格比例", secondaryPriceRatio: "二配结算价格比例",
factory: "工厂设置", factory: "工厂设置",
@ -334,6 +335,7 @@ export default {
customerStorageLocation: "客户存储地点", customerStorageLocation: "客户存储地点",
secondaryAdjustment: "二配数量调整输入", secondaryAdjustment: "二配数量调整输入",
secondaryDiscount: "二配折扣调整输入", secondaryDiscount: "二配折扣调整输入",
Wms_HqKB_Output: "红旗数据调整",
}[this.crmType] || "" }[this.crmType] || ""
); );
}, },
@ -365,6 +367,8 @@ export default {
sparepartoutorder: sparepartoutorder:
"/api/settleaccount/wmsSharePartoutput/ExcelImport", // "/api/settleaccount/wmsSharePartoutput/ExcelImport", //
sparepartoutorder90:
"/api/settleaccount/wmsSharePart90output/ExcelImport", //
bomdatabase: "/api/settleaccount/bom/ExcelImport", bomdatabase: "/api/settleaccount/bom/ExcelImport",
prebatch: "/api/settleaccount/Prebatch/ExcelImport", prebatch: "/api/settleaccount/Prebatch/ExcelImport",
secondaryPriceRatio: secondaryPriceRatio:
@ -389,7 +393,9 @@ export default {
HQ_H_CHECKOUT: "/api/settleaccount/WmsHQHSharePartoutput/ExcelImport", //H HQ_H_CHECKOUT: "/api/settleaccount/WmsHQHSharePartoutput/ExcelImport", //H
HQ_M_CHECKOUT: "/api/settleaccount/WmsHQMSharePartoutput/ExcelImport", //M HQ_M_CHECKOUT: "/api/settleaccount/WmsHQMSharePartoutput/ExcelImport", //M
HQ_Y_CHECKOUT: "/api/settleaccount//ExcelImport", //轿 Wms_HqKB_Output:
"/api/settleaccount/WmsHQMSharePartoutput/ExcelImport", //
//HQ_Y_CHECKOUT: "/api/settleaccount//ExcelImport", //轿
}[this.crmType] || "" }[this.crmType] || ""
); );
}, },
@ -527,7 +533,7 @@ export default {
}, },
// //
sureClick() { sureClick() {
if(this.versionValue==''){ if (this.versionValue == "") {
this.$message.error("必须选择版本!"); this.$message.error("必须选择版本!");
return false; return false;
} }

10
vue/src/router/modules/hq_out_order.js

@ -87,6 +87,16 @@ const hqOutOrderDataRouter = {
icon: '售后' icon: '售后'
} }
}, },
{
path: 'hq-kb-outorder',
component: () => import('@/views/ux/vw/dataInput/hq_kb_output'),
name: 'WmsHQKBOutput',//命名路由
meta: {
title: '红旗数据调整出库单',
roles: ['SettleAccount.WMSHQ'],//控制页面角色(可以设置多个角色)
icon: '红旗'
}
},
// { // {
// path: 'hq-y-checkout', // path: 'hq-y-checkout',
// component: () => import('@/views/ux/vw/dataInput/hq_y_checkout'), // component: () => import('@/views/ux/vw/dataInput/hq_y_checkout'),

2
vue/src/views/login/index.vue

@ -12,7 +12,7 @@
长春市闻荫科技 长春市闻荫科技
<a <a
target="_blank" target="_blank"
href="http://www.ccwin-in.com">©2021 闻荫科技-长春派格结算管理系统</a> href="http://www.ccwin-in.com">©2022 闻荫科技-长春派格结算管理系统</a>
</div> </div>
</div> </div>
</div> </div>

105
vue/src/views/ux/billManage/kanbanWithOutOrder/detail.vue

@ -69,6 +69,22 @@
@filter="handleFilters" @filter="handleFilters"
> >
</c-r-m-table-head> </c-r-m-table-head>
<div v-if="this.resultData && this.resultData.errSize > 0">
<el-card shadow="always">
<!-- <i class="el-icon-error" /> -->
<p>
<span style="color:red">{{ this.resultData.successMessage }} </span>
<el-button type="text" @click="downloadErrData"
>下载错误数据</el-button
>
</p>
</el-card>
</div>
<div v-else-if="this.resultData.errSize === 0">
<p>
<span>{{ this.resultData.successMessage }} </span>
</p>
</div>
</flexbox> </flexbox>
<!--表格渲染--> <!--表格渲染-->
<el-table <el-table
@ -171,10 +187,7 @@
<el-button type="text" @click="dialogFormVisible = false" <el-button type="text" @click="dialogFormVisible = false"
>取消</el-button >取消</el-button
> >
<el-button <el-button v-loading="formLoading" type="primary" @click="save()"
v-loading="formLoading"
type="primary"
@click="handleCreateBills()"
>确认</el-button >确认</el-button
> >
</div> </div>
@ -243,6 +256,13 @@ export default {
return {}; return {};
}, },
}, },
resultData: {
totalSize: 0,
errSize: 0,
errTemplate: "",
errMessage: "",
successMessage: "",
},
listQuery: { listQuery: {
Filters: [ Filters: [
{ {
@ -338,6 +358,42 @@ export default {
}, },
}, },
methods: { methods: {
/**
* 下载错误模板
*/
downloadErrData() {
let fileNameOfProject = this.resultData.errTemplate;
this.$axios
.BolbGets(
"/api/settleaccount/getblobfile/download/" + fileNameOfProject
)
.then((response) => {
if (fileNameOfProject.indexOf("_") != -1) {
let downName =
fileNameOfProject.slice(0, fileNameOfProject.lastIndexOf("_")) +
fileNameOfProject.slice(fileNameOfProject.lastIndexOf("."));
downloadFile(response, downName);
this.$notify({
title: "成功",
message: "错误数据-导出成功!",
type: "success",
duration: 2000,
});
} else {
downloadFile(response, fileNameOfProject);
this.$notify({
title: "成功",
message: "错误数据-导出成功!",
type: "success",
duration: 2000,
});
}
this.listLoading = false;
})
.catch((error) => {
this.listLoading = false;
});
},
// //
handleEdit(index, row) { handleEdit(index, row) {
console.log(index, row); console.log(index, row);
@ -462,7 +518,13 @@ export default {
// //
handleCreateBills(row) { handleCreateBills(row) {
this.dialogFormVisible = true; this.dialogFormVisible = true;
this.formLoading = true; this.resultData = {};
},
//
save(row) {
this.dialogFormVisible = true;
this.resultData.errSize == 0; //
//this.formLoading = true;
this.listOutPutQuery.guids = []; this.listOutPutQuery.guids = [];
this.listOutPutQuery.version = this.customerInfo.version; this.listOutPutQuery.version = this.customerInfo.version;
this.listOutPutQuery.billNum = this.customerInfo.parentId; this.listOutPutQuery.billNum = this.customerInfo.parentId;
@ -480,25 +542,34 @@ export default {
} }
//this.listOutPutQuery.accountDate = this.accountDatelist; //this.listOutPutQuery.accountDate = this.accountDatelist;
console.log( console.log(
"未选择时全部确认出库条件:" + JSON.stringify(this.listOutPutQuery) "无条码看板-全部确认出库条件:" + JSON.stringify(this.listOutPutQuery)
); );
this.$axios this.$axios
.posts( .posts(
"/api/settleaccount/wmskanbanoutputextend/WmsKanbanOutPut-Pass", "/api/settleaccount/wmskanbanoutputextend/WmsKanbanOutPut-Pass",
this.listOutPutQuery this.listOutPutQuery
) )
.then((response) => { .then((res) => {
const index = this.list.indexOf(row); const index = this.list.indexOf(row);
this.$notify({ if (res === "Success") {
title: "成功", this.$notify({
message: "生成成功", title: "成功",
type: "success", message: "确认成功!",
duration: 2000, type: "success",
}); duration: 2000,
this.accountDatelist.accountDate = ""; });
this.dialogFormVisible = false; this.accountDatelist.accountDate = "";
this.getList(); this.resultData.errSize = 0;
this.dialogFormVisible = false;
this.resultData.successMessage = "出库成功!";
this.getList();
} else {
this.dialogFormVisible = false;
this.resultData.errTemplate = res; //
this.resultData.errSize = 1; //0
this.resultData.successMessage = "有错误检验信息!";
alert(JSON.stringify(this.resultData));
}
this.formLoading = false; this.formLoading = false;
}) })
.catch(() => { .catch(() => {

38
vue/src/views/ux/billManage/sparepartOutOrder/detail.vue

@ -383,24 +383,24 @@ export default {
"大众备件调整结算数量按钮:" + JSON.stringify(this.listOutPutQuery) "大众备件调整结算数量按钮:" + JSON.stringify(this.listOutPutQuery)
); );
//"taskId": "3fa85f64-5717-4562-b3fc-2c963f66afa6","outPutQty": 0 //"taskId": "3fa85f64-5717-4562-b3fc-2c963f66afa6","outPutQty": 0
// this.$axios this.$axios
// .posts( .posts(
// "/api/settleaccount/wmsSharePartoutput/WmsSharePartOutPutModify", "/api/settleaccount/wmsSharePartoutput/WmsSharePartOutPutModify",
// this.listOutPutQuery this.listOutPutQuery
// ) )
// .then((response) => { .then((response) => {
// const index = this.list.indexOf(row); const index = this.list.indexOf(row);
// this.$notify({ this.$notify({
// title: "", title: "成功",
// message: "", message: "操作成功",
// type: "success", type: "success",
// duration: 2000, duration: 2000,
// }); });
// this.getList(); this.getList();
// }) })
// .catch(() => { .catch(() => {
// this.listLoading = false; this.listLoading = false;
// }); });
} }
}, },
// //
@ -469,7 +469,7 @@ export default {
// //
handleCreateBills(row) { handleCreateBills(row) {
this.dialogFormVisible = true; this.dialogFormVisible = true;
this.formLoading = true; //this.formLoading = true;
this.listOutPutQuery.guids = []; this.listOutPutQuery.guids = [];
this.listOutPutQuery.version = this.customerInfo.version; this.listOutPutQuery.version = this.customerInfo.version;
this.listOutPutQuery.billNum = this.customerInfo.parentId; this.listOutPutQuery.billNum = this.customerInfo.parentId;

761
vue/src/views/ux/vw/dataInput/hq_kb_output/detail.vue

@ -0,0 +1,761 @@
<!---明细数据-->
<template>
<div class="cr-body-content">
<flexbox class="content-header">
<!-- <el-button
class="filter-item"
size="mini"
type="info"
icon="el-icon-download"
@click="handleDownload()"
>导出全部
</el-button> -->
<JobSelectVerson
:options="JobVersionList"
style="width: 150px; margin-left: -10px"
class="search-container"
@value-change="JobVersionValue"
></JobSelectVerson>
<el-button
class="filter-item"
type="success"
icon="el-icon-check"
size="mini"
@click="handleCreateBills()"
>确认出库单</el-button
>
<el-button
class="filter-item"
size="mini"
type="warning"
icon="el-icon-download"
@click="print()"
>取消出库(支持批量)
</el-button>
<el-button
class="filter-item"
size="mini"
type="danger"
icon="el-icon-download"
@click="handleDelete()"
>删除出库单(支持批量)
</el-button>
<el-input
v-model="searchContent"
clearable
size="small"
placeholder="按照零件号搜索..."
style="width: 230px"
class="search-container"
@keyup.enter.native="handleFilter"
/>
<el-button
size="mini"
type="success"
icon="el-icon-search"
@click="handleFilter"
>搜索
</el-button>
<!--表格头组件filter查询-->
<c-r-m-table-head
ref="crmTableHead"
:crm-type="crmType"
@handle="handleHandle"
@filter="handleFilters"
>
</c-r-m-table-head>
</flexbox>
<!--表格渲染-->
<el-table
ref="multipleTable"
v-loading="listLoading"
element-loading-text="拼命加载中..."
element-loading-spinner="el-icon-loading"
class="cr-table"
:data="list"
:height="tableHeight"
:cell-style="cellStyle"
:header-cell-style="headerRowStyle"
size="small"
stripe
border
highlight-current-row
style="width: 100%"
@sort-change="sortChange"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<el-table-column type="selection" width="44px"></el-table-column>
<el-table-column
v-for="(item, index) in getDefaultField"
:key="index"
:prop="item.prop"
:label="item.label"
:min-width="item.width"
:formatter="fieldFormatter"
sortable="custom"
show-overflow-tooltip
:gutter="0"
>
<template slot="header" slot-scope="scope">
{{ scope.column.label }}
</template>
</el-table-column>
<el-table-column
prop="outputQty"
label="出库数量"
v-model="outPutQtylist.outputQty"
width="100"
>
<template slot-scope="list">
<el-input
size="small"
v-model="list.row.outPutQty"
@change="handleEdit(list.$index, list.row)"
></el-input>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="list">
<el-button
type="primary"
v-if="(list.$index = 1)"
@click="handle(list.row)"
>确定</el-button
>
</template>
</el-table-column>
</el-table>
<div class="table-footer">
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"-->
<pagination
v-show="totalCount > 0"
:total="totalCount"
:page.sync="page"
:limit.sync="listQuery.MaxResultCount"
@pagination="getList"
/>
</div>
<div>
<el-dialog
:append-to-body="true"
:visible.sync="dialogFormVisible"
:title="formTitle"
width="700px"
>
<el-form
ref="accountDatelist"
:inline="true"
:model="accountDatelist"
:rules="rules"
size="small"
label-width="120px"
>
<el-form-item label="日期" prop="accountDate">
<el-date-picker
v-model="accountDatelist.accountDate"
type="date"
clearable
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="dialogFormVisible = false"
>取消</el-button
>
<el-button
v-loading="formLoading"
type="primary"
@click="handleCreateBills()"
>确认</el-button
>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import permission from "@/directive/permission/index.js";
import CRMTableHead from "../../../components/CRMTableHead";
import { downloadFile } from "@/utils/crmindex.js";
import JobSelectVerson from "@/components/CreateCom/Job-Select.vue";
export default {
name: "sendUnsettledDiffReport",
components: { Pagination, CRMTableHead, CRMTableHead, JobSelectVerson },
directives: { permission },
props: {
customerInfos: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
crmType: "sparepartOutOrder",
rules: {
//
erpMaterialCode: [
{ required: true, message: "必须输入!", trigger: "blur" },
],
accountDate: [
{ required: true, message: "日期必须输入!", trigger: "blur" },
],
},
searchContent: "", //
customerInfo: {
parentId: "",
version: "",
},
form: {
dicDetailID: "",
customerId: "",
projectId: "",
},
list: null,
totalCount: 0,
listLoading: true,
formLoading: false,
JobVersionList: [
{ value: "0", label: "未处理" },
{ value: "1", label: "申请出库" },
{ value: "2", label: "确认出库" },
{ value: "3", label: "不能出库" },
{ value: "4", label: "取消出库" },
],
PurchaseDateList: [],
//
filterObj: {
type: Object,
default: () => {
return {};
},
},
listQuery: {
Filters: [
{
logic: 0,
column: "state",
action: 0,
value: "0",
}, //
],
SkipCount: 0,
MaxResultCount: 15,
billNum: "",
},
listOutPutQuery: {
version: "",
guids: "",
billNum: "",
accountDate: "",
},
listDeleteQuery: {
billNum: "",
},
page: 1,
JobversionValue: "",
PurchaseDateValue: "",
JobversionValueVerson: "",
dialogFormVisible: false,
multipleSelection: [],
outPutQtylist: {
outputQty: "",
taskId: "",
},
formTitle: "",
drawer: false,
showExcelImport: false,
tableHeight: document.documentElement.clientHeight - 230,
isEdit: false,
accountDatelist: {
accountDate: "",
},
};
},
mounted() {
var self = this;
window.onresize = function () {
var offsetHei = document.documentElement.clientHeight;
self.tableHeight = offsetHei - 190;
};
},
created() {
this.getList();
},
watch: {
customerInfos: {
handler(newVal) {
if (newVal == "" || newVal == "undefined") {
//TODO
} else {
newVal.forEach((element) => {
this.customerInfo.parentId = element.ParentId;
this.customerInfo.version = element.Version;
});
if (this.customerInfo.parentId != "") {
this.getList();
}
}
},
immediate: true,
},
},
computed: {
/** 列表字段 */
getDefaultField() {
var tempsTabs = [];
tempsTabs.push({
label: "版本",
prop: "version",
width: 110,
});
tempsTabs.push({ label: "SAP编码", prop: "materialCode", width: 150 });
tempsTabs.push({
label: "物料组",
prop: "materialGroup",
width: 220,
});
tempsTabs.push({
label: "物料组描述",
prop: "materialDesc",
width: 220,
});
tempsTabs.push({ label: "寄售库存", prop: "stockQty", width: 100 });
tempsTabs.push({ label: "结算数量", prop: "qty", width: 100 });
tempsTabs.push({ label: "状态", prop: "state", width: 100 });
return tempsTabs;
},
},
methods: {
//
handleEdit(index, row) {
console.log(index, row);
},
//
JobVersionValue(params) {
//
this.listQuery.Filters = [];
var column = "state";
let filter = {
logic: 0,
column: column,
action: 0,
value: params.value,
};
this.listQuery.Filters.push(filter);
this.getList();
},
handle(row) {
this.multipleSelection.forEach((element) => {
let outPutQty = element.outputQty;
});
if (row.materialCode === null) {
this.$message({
message: "SAP编码为空,不允许出库!",
type: "warning",
});
return;
}
if (row.outPutQty > row.stockQty) {
this.$message({
message: "出库数量大于寄售库存,不允许出库!",
type: "warning",
});
} else {
if (row.branchId != "") {
this.listOutPutQuery.branchId = row.id;
}
if (row.outPutQty != "") {
this.listOutPutQuery.outPutQty = row.outPutQty;
}
console.log(
"一汽轿车-数量按钮:" + JSON.stringify(this.listOutPutQuery)
);
//"taskId": "3fa85f64-5717-4562-b3fc-2c963f66afa6","outPutQty": 0
this.$axios
.posts(
"/api/settleaccount/WmsHQKBOutput/WmsSharePartOutPutModify",
this.listOutPutQuery
)
.then((response) => {
const index = this.list.indexOf(row);
this.$notify({
title: "成功",
message: "操作成功",
type: "success",
duration: 2000,
});
this.getList();
})
.catch(() => {
this.listLoading = false;
});
}
},
//
handleCancelBills(row) {
if (this.multipleSelection.length == 0) {
this.$message({
message: "至少选择一行!",
type: "warning",
});
return;
}
var params = [];
let myalert = ""; //使
if (row) {
//
params.push(row.id);
myalert = row.name;
} else {
//
this.multipleSelection.forEach((element) => {
let id = element.id;
params.push(id);
});
myalert = "选中项";
}
this.listOutPutQuery.version = this.customerInfo.version;
this.listOutPutQuery.guids = params;
this.listOutPutQuery.billNum = this.customerInfo.parentId;
console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery));
this.$confirm("是否确认取消出库" + myalert + "?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$axios
.posts(
"/api/settleaccount/WmsHQKBOutput/WmsKanbanOutPut-Cancel",
this.listOutPutQuery
)
.then((response) => {
const index = this.list.indexOf(row);
this.$notify({
title: "成功",
message: "操作成功",
type: "success",
duration: 2000,
});
this.getList();
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
print() {
this.dialogFormVisible = true;
if (this.$refs["accountDatelist"] !== undefined) {
this.$refs["accountDatelist"].resetFields();
}
},
//
handleCreateBills(row) {
this.dialogFormVisible = true;
this.formLoading = true;
this.listOutPutQuery.guids = [];
this.listOutPutQuery.version = this.customerInfo.version;
this.listOutPutQuery.billNum = this.customerInfo.parentId;
if (this.accountDatelist.accountDate == "") {
this.$message({
message: "请选择日期!",
type: "warning",
});
this.getList();
return;
//this.getList();
} else {
if (this.accountDatelist != "") {
this.listOutPutQuery.accountDate = this.accountDatelist.accountDate;
}
//this.listOutPutQuery.accountDate = this.accountDatelist;
console.log(
"红旗数据调整-全部确认出库条件:" + JSON.stringify(this.listOutPutQuery)
);
this.$axios
.posts(
"/api/settleaccount/WmsHQKBOutput/WmsKanbanOutPut-Pass",
this.listOutPutQuery
)
.then((response) => {
const index = this.list.indexOf(row);
this.$notify({
title: "成功",
message: "生成成功",
type: "success",
duration: 2000,
});
this.accountDatelist.accountDate = "";
this.dialogFormVisible = false;
this.getList();
this.formLoading = false;
})
.catch(() => {
this.formLoading = false;
});
}
},
//
handleDelete(row) {
var params = [];
let myalert = ""; //使
if (row) {
//
params.push(row.id);
myalert = row.name;
} else {
//
this.multipleSelection.forEach((element) => {
let id = element.id;
params.push(id);
});
myalert = "选中项";
}
this.listDeleteQuery.billNum = this.listQuery.billNum;
console.log("单据号:" + JSON.stringify(this.listDeleteQuery));
this.$confirm("是否删除" + myalert + "?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$axios
.posts(
"/api/settleaccount/WmsHQKBOutput/WmsOutPutDelete",
this.listDeleteQuery
)
.then((response) => {
const index = this.list.indexOf(row);
this.$notify({
title: "成功",
message: "删除成功",
type: "success",
duration: 2000,
});
this.getList();
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
/** 刷新列表 */
handleHandle(data) {
if (data.type !== "edit") {
this.getList();
}
},
/** 格式化字段 */
fieldFormatter(row, column) {
if (column.property == "state") {
return {
0: "未处理",
1: "申请出库",
2: "确认出库",
3: "不能出库",
4: "取消出库",
}[row[column.property]];
}
return row[column.property] || "--";
},
importExcelData() {
//
this.showExcelImport = false;
this.getList();
},
async handleDownload() {
//await this.getDownBoms();
this.listLoading = true;
this.$axios
.gets(
"/api/settleaccount/bt-kb-not-consign/export/" +
this.customerInfo.parentId
)
.then((res) => {
let fileNameOfProject = res;
this.$axios
.BolbGets(
"/api/settleaccount/getblobfile/download/" + fileNameOfProject
)
.then((response) => {
if (fileNameOfProject.indexOf("_") != -1) {
let downName =
fileNameOfProject.slice(
0,
fileNameOfProject.lastIndexOf("_")
) +
fileNameOfProject.slice(fileNameOfProject.lastIndexOf("."));
downloadFile(response, downName);
this.$notify({
title: "成功",
message: "数据-导出成功!",
type: "success",
duration: 2000,
});
} else {
downloadFile(response, fileNameOfProject);
this.$notify({
title: "成功",
message: "数据-导出成功!",
type: "success",
duration: 2000,
});
}
this.listLoading = false;
});
});
},
getList(data) {
this.listLoading = true;
if (data != undefined) {
this.listQuery.SkipCount = (this.page - 1) * data.limit;
} else {
this.listQuery.SkipCount = (this.page - 1) * 15;
}
this.listQuery.billNum = this.customerInfo.parentId;
console.log("查询条件:" + JSON.stringify(this.listQuery));
this.$axios
.posts(
"/api/settleaccount/WmsHQKBOutput/WmsKanbanDetailList",
this.listQuery
)
.then((response) => {
this.list = response.items;
//alert(JSON.stringify(response.Items))
this.totalCount = response.totalCount;
setTimeout(() => {
//
this.listLoading = false;
}, 500);
})
.catch(() => {
this.listLoading = false;
});
},
/** 筛选操作 */
handleFilter() {
this.page = 1;
this.getList();
this.listQuery.Filters = [];
if (this.searchContent != "") {
var column = "materialCode";
let filter = {
logic: 0,
column: column,
action: 6,
value: this.searchContent,
};
this.listQuery.Filters.push(filter);
}
this.getList();
},
/** 多项筛选操作 */
/** 筛选操作 */
handleFilters(data) {
if (data === null) {
this.listQuery.Filters = [];
this.getList(); //
} else {
this.filterObj = data;
console.log("筛选" + JSON.stringify(data));
var offsetHei = document.documentElement.clientHeight;
var removeHeight = Object.keys(this.filterObj).length > 0 ? 310 : 240;
this.tableHeight = offsetHei - removeHeight;
this.currentPage = 1;
let Filter = [];
data.forEach((item) => {
let filter = {};
if (item.formType === "datetime" || item.formType === "datetime") {
// (datetime >= a and datetime <=b)
filter["Column"] = item.fieldName;
filter["Logic"] = 0;
filter["Value"] = item.value[0];
filter["Action"] = item.action;
Filter.push(filter);
if (item.value[1] != null) {
filter["Value"] = item.value[1];
filter["Action"] = 5;
Filter.push(filter);
}
} else {
filter["Column"] = item.fieldName;
filter["Value"] = item.value;
filter["Logic"] = 0;
filter["Action"] = item.action;
Filter.push(filter);
}
});
console.log("筛选条件" + JSON.stringify(Filter));
this.listQuery.Filters = Filter;
this.getList();
}
},
resetQuery() {},
sortChange(data) {
const { prop, order } = data;
if (!prop || !order) {
this.handleFilter();
return;
}
this.listQuery.Sorting = prop + " " + order;
this.handleFilter();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
/** 通过回调控制style */
cellStyle({ row, column, rowIndex, columnIndex }) {
if (column.property === "qty" || column.property === "stockQty") {
return { textAlign: "right" };
} else {
return { textAlign: "left" };
}
},
/** 通过回调控制表头style */
headerRowStyle({ row, column, rowIndex, columnIndex }) {
if (
column.property === "fisQty" ||
column.property === "diffQty" ||
column.property === "stockQty"
) {
return { textAlign: "right", background: "#FAFAFA" };
} else {
return { textAlign: "left", background: "#FAFAFA" };
}
},
handleRowClick(row, column, event) {
this.$refs.multipleTable.clearSelection();
this.$refs.multipleTable.toggleRowSelection(row);
},
},
};
</script>
<style lang="scss" scoped>
@import "../../../styles/crmtable.scss";
</style>

340
vue/src/views/ux/vw/dataInput/hq_kb_output/index.vue

@ -0,0 +1,340 @@
<!--红旗数据调整出库单-->
<template>
<div class="cr-body-content">
<flexbox class="content-header">
<el-input
v-model="searchContent"
clearable
size="small"
placeholder="按照版本号搜索..."
style="width: 200px"
class="search-container"
@keyup.enter.native="handleFilter"
/>
<el-button
size="mini"
type="success"
icon="el-icon-search"
@click="handleFilter"
>搜索
</el-button>
<el-button
class="filter-item"
size="mini"
type="warning"
icon="el-icon-upload2"
@click="handleImportExcel()"
>导入文件Excel
</el-button>
</flexbox>
<!--表格渲染-->
<el-table
ref="multipleTable"
v-loading="listLoading"
element-loading-text="拼命加载中..."
element-loading-spinner="el-icon-loading"
class="cr-table"
:data="list"
:height="tableHeight"
:cell-style="cellStyle"
size="small"
stripe
border
highlight-current-row
style="width: 100%"
@sort-change="sortChange"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<el-table-column
label="单据号"
prop="billNum"
sortable="custom"
align="center"
width="250px"
>
<template slot-scope="scope">
<el-tooltip :content="scope.row.billNum" placement="bottom-end">
<span class="link-type" @click="handleDrawerOpen(scope.row)">{{
scope.row.billNum
}}</span>
</el-tooltip>
</template>
</el-table-column>
<!-- <el-table-column type="selection" width="44px"></el-table-column> -->
<el-table-column
v-for="(item, index) in getDefaultField"
:key="index"
:prop="item.prop"
:label="item.label"
:min-width="item.width"
:formatter="fieldFormatter"
sortable="custom"
show-overflow-tooltip
:gutter="0"
>
<template slot="header" slot-scope="scope">
{{ scope.column.label }}
</template>
</el-table-column>
</el-table>
<div class="table-footer">
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"-->
<pagination
v-show="totalCount > 0"
:total="totalCount"
:page.sync="page"
:limit.sync="listQuery.MaxResultCount"
@pagination="getList"
/>
<!-- 导入Excel组件 -->
<importExcel
ref="importexcel"
:show="showExcelImport"
:crmType="crmType"
@close="importExcelData"
/>
<!-- 抽屉控件 -->
<el-drawer
title="信息详细页"
size="75%"
direction="rtl"
:visible.sync="drawer"
:before-close="handleDrawerClose"
>
<div>
<Detail
v-bind:customerInfos="customerInfos"
style="margin-top: -35px"
></Detail>
</div>
</el-drawer>
</div>
</div>
</template>
<script>
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import permission from "@/directive/permission/index.js";
import Detail from "./detail";
import moment from "moment";
import importExcel from "@/components/ImportExcel-base";
import { formatTimeToTimestamp } from "@/utils/index";
export default {
name: "WmsHQKBOutput",
components: { Pagination, Detail,importExcel },
directives: { permission },
data() {
return {
crmType: "Wms_HqKB_Output",
rules: {
// version: [{ required: true, message: "", trigger: "change" }],
// beginTime: [{ required: true, message: "", trigger: "change" }],
// endTime: [{ required: true, message: "", trigger: "change" }],
},
customerInfos: [],
searchContent: "", //
drawer: false,
form: {
version: "",
customerCode: "",
customerName: "",
beginTime: "",
endTime: "",
},
versionValue: "",
versionList: [],
startTimeVale: "",
endTimeVale: "",
list: null,
totalCount: 0,
listLoading: true,
formLoading: false,
//
filterObj: {
type: Object,
default: () => {
return {};
},
},
listQuery: {
Filters: [
{
logic: 0,
column: "Enabled",
action: 0,
value: "true",
}, //
],
//OrgID:"",
SkipCount: 0,
MaxResultCount: 15,
},
page: 1,
dialogFormVisible: false,
multipleSelection: [],
formTitle: "",
drawer: false,
showExcelImport: false,
tableHeight: document.documentElement.clientHeight - 200,
isEdit: false,
};
},
mounted() {
var self = this;
window.onresize = function () {
var offsetHei = document.documentElement.clientHeight;
self.tableHeight = offsetHei - 200;
};
},
created() {
this.getList();
//this.getVersionInfo();
},
computed: {
/** 列表字段 */
getDefaultField() {
var tempsTabs = [];
tempsTabs.push({
label: "版本",
prop: "version",
width: 120,
});
//tempsTabs.push({ label: "", prop: "billNum", width: 150 });
tempsTabs.push({ label: "创建人", prop: "creator", width: 160 });
tempsTabs.push({ label: "创建时间", prop: "creationTime", width: 160 });
tempsTabs.push({ label: "备注", prop: "remark", width: 120 });
return tempsTabs;
},
},
methods: {
handleImportExcel() {
//
this.showExcelImport = true;
this.$refs.importexcel.handleImportExcelClick();
},
getVersionInfo() {
//
this.listLoading = true;
this.listQuery.SkipCount = (this.page - 1) * 1000;
this.$axios
.posts("/api/settleaccount/CentralizedControl/openlist")
.then((response) => {
this.versionList = [];
response.forEach((element) => {
let options = {};
options.value = element.version;
options.label = element.version;
this.versionList.push(options);
});
})
.catch(() => {
this.listLoading = false;
});
},
//
handleDrawerOpen(param) {
this.drawer = true;
var parentId = param.billNum; //
var version = param.version; //
this.customerInfos = [
{
ParentId: parentId,
Version: version,
},
];
},
handleDrawerClose(done) {
done();
},
/** 格式化字段 */
fieldFormatter(row, column) {
if (column.property == "creationTime") {
var date = row[column.property];
if (date == undefined) {
return "";
}
return moment(date).format("YYYY-MM-DD HH:mm:ss");
}
if (column.property == "state") {
return { 0: "已提交", 1: "已出库", 2: "不能出库" }[
row[column.property]
];
}
return row[column.property] || "--";
},
importExcelData() {
//
this.showExcelImport = false;
this.getList();
},
getList(data) {
this.listLoading = true;
if (data != undefined) {
this.listQuery.SkipCount = (this.page - 1) * data.limit;
} else {
this.listQuery.SkipCount = (this.page - 1) * 15;
}
this.$axios
.posts("/api/settleaccount/WmsHQKBOutput/WmsKanbanList", this.listQuery)
.then((response) => {
this.list = response.items;
//alert(JSON.stringify(response.Items))
this.totalCount = response.totalCount;
setTimeout(() => {
//
this.listLoading = false;
}, 500);
})
.catch(() => {
this.listLoading = false;
});
},
/** 筛选操作 */
handleFilter() {
this.page = 1;
this.getList();
this.listQuery.Filters = [];
if (this.searchContent != "") {
var column = "version";
let filter = {
logic: 0,
column: column,
action: 0,
value: this.searchContent,
};
this.listQuery.Filters.push(filter);
}
this.getList();
},
resetQuery() {},
sortChange(data) {
const { prop, order } = data;
if (!prop || !order) {
this.handleFilter();
return;
}
this.listQuery.Sorting = prop + " " + order;
this.handleFilter();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
/** 通过回调控制style */
cellStyle({ row, column, rowIndex, columnIndex }) {
return { textAlign: "left" };
},
handleRowClick(row, column, event) {
this.$refs.multipleTable.clearSelection();
this.$refs.multipleTable.toggleRowSelection(row);
},
},
};
</script>
<style lang="scss" scoped>
@import "../../../styles/crmtable.scss";
</style>

138
vue/src/views/ux/vw/dataInput/hq_y_outorder/detail.vue

@ -1,4 +1,4 @@
<!--红旗H平台出库单-明细数据--> <!---明细数据-->
<template> <template>
<div class="cr-body-content"> <div class="cr-body-content">
<flexbox class="content-header"> <flexbox class="content-header">
@ -16,12 +16,13 @@
class="search-container" class="search-container"
@value-change="JobVersionValue" @value-change="JobVersionValue"
></JobSelectVerson> ></JobSelectVerson>
<el-button <el-button
class="filter-item" class="filter-item"
type="success" type="success"
icon="el-icon-check" icon="el-icon-check"
size="mini" size="mini"
@click="print()" @click="handleCreateBills()"
>确认出库单</el-button >确认出库单</el-button
> >
<el-button <el-button
@ -29,7 +30,7 @@
size="mini" size="mini"
type="warning" type="warning"
icon="el-icon-download" icon="el-icon-download"
@click="handleCancelBills()" @click="print()"
>取消出库(支持批量) >取消出库(支持批量)
</el-button> </el-button>
<el-button <el-button
@ -44,7 +45,7 @@
v-model="searchContent" v-model="searchContent"
clearable clearable
size="small" size="small"
placeholder="按照看板号搜索..." placeholder="按照零件号搜索..."
style="width: 230px" style="width: 230px"
class="search-container" class="search-container"
@keyup.enter.native="handleFilter" @keyup.enter.native="handleFilter"
@ -101,6 +102,30 @@
{{ scope.column.label }} {{ scope.column.label }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
prop="outputQty"
label="出库数量"
v-model="outPutQtylist.outputQty"
width="100"
>
<template slot-scope="list">
<el-input
size="small"
v-model="list.row.outPutQty"
@change="handleEdit(list.$index, list.row)"
></el-input>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="list">
<el-button
type="primary"
v-if="(list.$index = 1)"
@click="handle(list.row)"
>确定</el-button
>
</template>
</el-table-column>
</el-table> </el-table>
<div class="table-footer"> <div class="table-footer">
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> <!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"-->
@ -161,6 +186,7 @@ import CRMTableHead from "../../../components/CRMTableHead";
import { downloadFile } from "@/utils/crmindex.js"; import { downloadFile } from "@/utils/crmindex.js";
import JobSelectVerson from "@/components/CreateCom/Job-Select.vue"; import JobSelectVerson from "@/components/CreateCom/Job-Select.vue";
export default { export default {
name: "sendUnsettledDiffReport", name: "sendUnsettledDiffReport",
components: { Pagination, CRMTableHead, CRMTableHead, JobSelectVerson }, components: { Pagination, CRMTableHead, CRMTableHead, JobSelectVerson },
@ -175,7 +201,7 @@ export default {
}, },
data() { data() {
return { return {
crmType: "hq-y-OutOrder", crmType: "sparepartOutOrder",
rules: { rules: {
// //
erpMaterialCode: [ erpMaterialCode: [
@ -206,6 +232,7 @@ export default {
{ value: "3", label: "不能出库" }, { value: "3", label: "不能出库" },
{ value: "4", label: "取消出库" }, { value: "4", label: "取消出库" },
], ],
PurchaseDateList: [],
// //
filterObj: { filterObj: {
type: Object, type: Object,
@ -237,9 +264,14 @@ export default {
}, },
page: 1, page: 1,
JobversionValue: "", JobversionValue: "",
PurchaseDateValue: "",
JobversionValueVerson: "", JobversionValueVerson: "",
dialogFormVisible: false, dialogFormVisible: false,
multipleSelection: [], multipleSelection: [],
outPutQtylist: {
outputQty: "",
taskId: "",
},
formTitle: "", formTitle: "",
drawer: false, drawer: false,
showExcelImport: false, showExcelImport: false,
@ -282,13 +314,13 @@ export default {
/** 列表字段 */ /** 列表字段 */
getDefaultField() { getDefaultField() {
var tempsTabs = []; var tempsTabs = [];
tempsTabs.push({ tempsTabs.push({
label: "版本", label: "版本",
prop: "version", prop: "version",
width: 110, width: 110,
}); });
tempsTabs.push({ label: "SAP编码", prop: "materialCode", width: 150 });
tempsTabs.push({ label: "SAP编码", prop: "materialCode", width: 150 });
tempsTabs.push({ tempsTabs.push({
label: "物料组", label: "物料组",
prop: "materialGroup", prop: "materialGroup",
@ -299,16 +331,17 @@ export default {
prop: "materialDesc", prop: "materialDesc",
width: 220, width: 220,
}); });
tempsTabs.push({ label: "收货仓库", prop: "extend2", width: 120 }); tempsTabs.push({ label: "寄售库存", prop: "stockQty", width: 100 });
tempsTabs.push({ label: "结算数量", prop: "qty", width: 100 }); tempsTabs.push({ label: "结算数量", prop: "qty", width: 100 });
tempsTabs.push({ label: "结算单价", prop: "price", width: 100 });
tempsTabs.push({ label: "结算金额", prop: "amt", width: 100 });
tempsTabs.push({ label: "状态", prop: "state", width: 100 }); tempsTabs.push({ label: "状态", prop: "state", width: 100 });
return tempsTabs; return tempsTabs;
}, },
}, },
methods: { methods: {
//
handleEdit(index, row) {
console.log(index, row);
},
// //
JobVersionValue(params) { JobVersionValue(params) {
// //
@ -323,6 +356,53 @@ export default {
this.listQuery.Filters.push(filter); this.listQuery.Filters.push(filter);
this.getList(); this.getList();
}, },
handle(row) {
this.multipleSelection.forEach((element) => {
let outPutQty = element.outputQty;
});
if (row.materialCode === null) {
this.$message({
message: "SAP编码为空,不允许出库!",
type: "warning",
});
return;
}
if (row.outPutQty > row.stockQty) {
this.$message({
message: "出库数量大于寄售库存,不允许出库!",
type: "warning",
});
} else {
if (row.branchId != "") {
this.listOutPutQuery.branchId = row.id;
}
if (row.outPutQty != "") {
this.listOutPutQuery.outPutQty = row.outPutQty;
}
console.log(
"一汽轿车-数量按钮:" + JSON.stringify(this.listOutPutQuery)
);
//"taskId": "3fa85f64-5717-4562-b3fc-2c963f66afa6","outPutQty": 0
this.$axios
.posts(
"/api/settleaccount/WmsHQCaroutput/WmsSharePartOutPutModify",
this.listOutPutQuery
)
.then((response) => {
const index = this.list.indexOf(row);
this.$notify({
title: "成功",
message: "操作成功",
type: "success",
duration: 2000,
});
this.getList();
})
.catch(() => {
this.listLoading = false;
});
}
},
// //
handleCancelBills(row) { handleCancelBills(row) {
if (this.multipleSelection.length == 0) { if (this.multipleSelection.length == 0) {
@ -385,31 +465,10 @@ export default {
if (this.$refs["accountDatelist"] !== undefined) { if (this.$refs["accountDatelist"] !== undefined) {
this.$refs["accountDatelist"].resetFields(); this.$refs["accountDatelist"].resetFields();
} }
// this.$axios
// .posts(
// "/api/settleaccount/WmsHQCaroutput/WmsHQCaroutput-Pass",
// this.listOutPutQuery
// )
// .then((response) => {
// const index = this.list.indexOf(row);
// this.$notify({
// title: "",
// message: "",
// type: "success",
// duration: 2000,
// });
// this.getList();
// this.listLoading = false;
// })
},
handleCreateBillsEnd(row) {
this.dialogFormVisible = false;
this.getList();
}, },
// //
handleCreateBills(row) { handleCreateBills(row) {
this.dialogFormVisible = true; this.dialogFormVisible = true;
this.listLoading = true;
this.listOutPutQuery.guids = []; this.listOutPutQuery.guids = [];
this.listOutPutQuery.version = this.customerInfo.version; this.listOutPutQuery.version = this.customerInfo.version;
this.listOutPutQuery.billNum = this.customerInfo.parentId; this.listOutPutQuery.billNum = this.customerInfo.parentId;
@ -427,7 +486,7 @@ export default {
} }
//this.listOutPutQuery.accountDate = this.accountDatelist; //this.listOutPutQuery.accountDate = this.accountDatelist;
console.log( console.log(
"未选择时全部确认出库条件:" + JSON.stringify(this.listOutPutQuery) "一汽轿车-全部确认出库条件:" + JSON.stringify(this.listOutPutQuery)
); );
this.$axios this.$axios
@ -446,11 +505,10 @@ export default {
this.accountDatelist.accountDate = ""; this.accountDatelist.accountDate = "";
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.getList(); this.getList();
this.listLoading = false; this.formLoading = false;
this.dialogFormVisible = false;
}) })
.catch(() => { .catch(() => {
this.listLoading = false; this.formLoading = false;
}); });
} }
}, },
@ -600,7 +658,7 @@ export default {
this.getList(); this.getList();
this.listQuery.Filters = []; this.listQuery.Filters = [];
if (this.searchContent != "") { if (this.searchContent != "") {
var column = "billNum"; var column = "materialCode";
let filter = { let filter = {
logic: 0, logic: 0,
column: column, column: column,
@ -669,11 +727,7 @@ export default {
}, },
/** 通过回调控制style */ /** 通过回调控制style */
cellStyle({ row, column, rowIndex, columnIndex }) { cellStyle({ row, column, rowIndex, columnIndex }) {
if ( if (column.property === "qty" || column.property === "stockQty") {
column.property === "fisQty" ||
column.property === "diffQty" ||
column.property === "stockQty"
) {
return { textAlign: "right" }; return { textAlign: "right" };
} else { } else {
return { textAlign: "left" }; return { textAlign: "left" };

706
vue/src/views/ux/vw/dataInput/hq_y_outorder/detail_old.vue

@ -0,0 +1,706 @@
<!--红旗H平台出库单-明细数据-->
<template>
<div class="cr-body-content">
<flexbox class="content-header">
<!-- <el-button
class="filter-item"
size="mini"
type="info"
icon="el-icon-download"
@click="handleDownload()"
>导出全部
</el-button> -->
<JobSelectVerson
:options="JobVersionList"
style="width: 150px; margin-left: -10px"
class="search-container"
@value-change="JobVersionValue"
></JobSelectVerson>
<el-button
class="filter-item"
type="success"
icon="el-icon-check"
size="mini"
@click="print()"
>确认出库单</el-button
>
<el-button
class="filter-item"
size="mini"
type="warning"
icon="el-icon-download"
@click="handleCancelBills()"
>取消出库(支持批量)
</el-button>
<el-button
class="filter-item"
size="mini"
type="danger"
icon="el-icon-download"
@click="handleDelete()"
>删除出库单(支持批量)
</el-button>
<el-input
v-model="searchContent"
clearable
size="small"
placeholder="按照看板号搜索..."
style="width: 230px"
class="search-container"
@keyup.enter.native="handleFilter"
/>
<el-button
size="mini"
type="success"
icon="el-icon-search"
@click="handleFilter"
>搜索
</el-button>
<!--表格头组件filter查询-->
<c-r-m-table-head
ref="crmTableHead"
:crm-type="crmType"
@handle="handleHandle"
@filter="handleFilters"
>
</c-r-m-table-head>
</flexbox>
<!--表格渲染-->
<el-table
ref="multipleTable"
v-loading="listLoading"
element-loading-text="拼命加载中..."
element-loading-spinner="el-icon-loading"
class="cr-table"
:data="list"
:height="tableHeight"
:cell-style="cellStyle"
:header-cell-style="headerRowStyle"
size="small"
stripe
border
highlight-current-row
style="width: 100%"
@sort-change="sortChange"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<el-table-column type="selection" width="44px"></el-table-column>
<el-table-column
v-for="(item, index) in getDefaultField"
:key="index"
:prop="item.prop"
:label="item.label"
:min-width="item.width"
:formatter="fieldFormatter"
sortable="custom"
show-overflow-tooltip
:gutter="0"
>
<template slot="header" slot-scope="scope">
{{ scope.column.label }}
</template>
</el-table-column>
</el-table>
<div class="table-footer">
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"-->
<pagination
v-show="totalCount > 0"
:total="totalCount"
:page.sync="page"
:limit.sync="listQuery.MaxResultCount"
@pagination="getList"
/>
</div>
<div>
<el-dialog
:append-to-body="true"
:visible.sync="dialogFormVisible"
:title="formTitle"
width="700px"
>
<el-form
ref="accountDatelist"
:inline="true"
:model="accountDatelist"
:rules="rules"
size="small"
label-width="120px"
>
<el-form-item label="日期" prop="accountDate">
<el-date-picker
v-model="accountDatelist.accountDate"
type="date"
clearable
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="dialogFormVisible = false"
>取消</el-button
>
<el-button
v-loading="formLoading"
type="primary"
@click="handleCreateBills()"
>确认</el-button
>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import permission from "@/directive/permission/index.js";
import CRMTableHead from "../../../components/CRMTableHead";
import { downloadFile } from "@/utils/crmindex.js";
import JobSelectVerson from "@/components/CreateCom/Job-Select.vue";
export default {
name: "sendUnsettledDiffReport",
components: { Pagination, CRMTableHead, CRMTableHead, JobSelectVerson },
directives: { permission },
props: {
customerInfos: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
crmType: "hq-y-OutOrder",
rules: {
//
erpMaterialCode: [
{ required: true, message: "必须输入!", trigger: "blur" },
],
accountDate: [
{ required: true, message: "日期必须输入!", trigger: "blur" },
],
},
searchContent: "", //
customerInfo: {
parentId: "",
version: "",
},
form: {
dicDetailID: "",
customerId: "",
projectId: "",
},
list: null,
totalCount: 0,
listLoading: true,
formLoading: false,
JobVersionList: [
{ value: "0", label: "未处理" },
{ value: "1", label: "申请出库" },
{ value: "2", label: "确认出库" },
{ value: "3", label: "不能出库" },
{ value: "4", label: "取消出库" },
],
//
filterObj: {
type: Object,
default: () => {
return {};
},
},
listQuery: {
Filters: [
{
logic: 0,
column: "state",
action: 0,
value: "0",
}, //
],
SkipCount: 0,
MaxResultCount: 15,
billNum: "",
},
listOutPutQuery: {
version: "",
guids: "",
billNum: "",
accountDate: "",
},
listDeleteQuery: {
billNum: "",
},
page: 1,
JobversionValue: "",
JobversionValueVerson: "",
dialogFormVisible: false,
multipleSelection: [],
formTitle: "",
drawer: false,
showExcelImport: false,
tableHeight: document.documentElement.clientHeight - 230,
isEdit: false,
accountDatelist: {
accountDate: "",
},
};
},
mounted() {
var self = this;
window.onresize = function () {
var offsetHei = document.documentElement.clientHeight;
self.tableHeight = offsetHei - 190;
};
},
created() {
this.getList();
},
watch: {
customerInfos: {
handler(newVal) {
if (newVal == "" || newVal == "undefined") {
//TODO
} else {
newVal.forEach((element) => {
this.customerInfo.parentId = element.ParentId;
this.customerInfo.version = element.Version;
});
if (this.customerInfo.parentId != "") {
this.getList();
}
}
},
immediate: true,
},
},
computed: {
/** 列表字段 */
getDefaultField() {
var tempsTabs = [];
tempsTabs.push({
label: "版本",
prop: "version",
width: 110,
});
tempsTabs.push({ label: "SAP编码", prop: "materialCode", width: 150 });
tempsTabs.push({
label: "物料组",
prop: "materialGroup",
width: 220,
});
tempsTabs.push({
label: "物料组描述",
prop: "materialDesc",
width: 220,
});
tempsTabs.push({ label: "收货仓库", prop: "extend2", width: 120 });
tempsTabs.push({ label: "结算数量", prop: "qty", width: 100 });
tempsTabs.push({ label: "结算单价", prop: "price", width: 100 });
tempsTabs.push({ label: "结算金额", prop: "amt", width: 100 });
tempsTabs.push({ label: "状态", prop: "state", width: 100 });
return tempsTabs;
},
},
methods: {
//
JobVersionValue(params) {
//
this.listQuery.Filters = [];
var column = "state";
let filter = {
logic: 0,
column: column,
action: 0,
value: params.value,
};
this.listQuery.Filters.push(filter);
this.getList();
},
//
handleCancelBills(row) {
if (this.multipleSelection.length == 0) {
this.$message({
message: "至少选择一行!",
type: "warning",
});
return;
}
var params = [];
let myalert = ""; //使
if (row) {
//
params.push(row.id);
myalert = row.name;
} else {
//
this.multipleSelection.forEach((element) => {
let id = element.id;
params.push(id);
});
myalert = "选中项";
}
this.listOutPutQuery.version = this.customerInfo.version;
this.listOutPutQuery.guids = params;
this.listOutPutQuery.billNum = this.customerInfo.parentId;
console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery));
this.$confirm("是否确认取消出库" + myalert + "?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$axios
.posts(
"/api/settleaccount/WmsHQCaroutput/WmsSharePartOutPut-Cancel",
this.listOutPutQuery
)
.then((response) => {
const index = this.list.indexOf(row);
this.$notify({
title: "成功",
message: "操作成功",
type: "success",
duration: 2000,
});
this.getList();
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
print() {
this.dialogFormVisible = true;
if (this.$refs["accountDatelist"] !== undefined) {
this.$refs["accountDatelist"].resetFields();
}
// this.$axios
// .posts(
// "/api/settleaccount/WmsHQCaroutput/WmsHQCaroutput-Pass",
// this.listOutPutQuery
// )
// .then((response) => {
// const index = this.list.indexOf(row);
// this.$notify({
// title: "",
// message: "",
// type: "success",
// duration: 2000,
// });
// this.getList();
// this.listLoading = false;
// })
},
handleCreateBillsEnd(row) {
this.dialogFormVisible = false;
this.getList();
},
//
handleCreateBills(row) {
this.dialogFormVisible = true;
this.listLoading = true;
this.listOutPutQuery.guids = [];
this.listOutPutQuery.version = this.customerInfo.version;
this.listOutPutQuery.billNum = this.customerInfo.parentId;
if (this.accountDatelist.accountDate == "") {
this.$message({
message: "请选择日期!",
type: "warning",
});
this.getList();
return;
//this.getList();
} else {
if (this.accountDatelist != "") {
this.listOutPutQuery.accountDate = this.accountDatelist.accountDate;
}
//this.listOutPutQuery.accountDate = this.accountDatelist;
console.log(
"未选择时全部确认出库条件:" + JSON.stringify(this.listOutPutQuery)
);
this.$axios
.posts(
"/api/settleaccount/WmsHQCaroutput/WmsSharePartOutPut-Pass",
this.listOutPutQuery
)
.then((response) => {
const index = this.list.indexOf(row);
this.$notify({
title: "成功",
message: "生成成功",
type: "success",
duration: 2000,
});
this.accountDatelist.accountDate = "";
this.dialogFormVisible = false;
this.getList();
this.listLoading = false;
this.dialogFormVisible = false;
})
.catch(() => {
this.listLoading = false;
});
}
},
//
handleDelete(row) {
var params = [];
let myalert = ""; //使
if (row) {
//
params.push(row.id);
myalert = row.name;
} else {
//
this.multipleSelection.forEach((element) => {
let id = element.id;
params.push(id);
});
myalert = "选中项";
}
this.listDeleteQuery.billNum = this.listQuery.billNum;
console.log("单据号:" + JSON.stringify(this.listDeleteQuery));
this.$confirm("是否删除" + myalert + "?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$axios
.posts(
"/api/settleaccount/WmsHQCaroutput/WmsOutPutDelete",
this.listDeleteQuery
)
.then((response) => {
const index = this.list.indexOf(row);
this.$notify({
title: "成功",
message: "删除成功",
type: "success",
duration: 2000,
});
this.getList();
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
},
/** 刷新列表 */
handleHandle(data) {
if (data.type !== "edit") {
this.getList();
}
},
/** 格式化字段 */
fieldFormatter(row, column) {
if (column.property == "state") {
return {
0: "未处理",
1: "申请出库",
2: "确认出库",
3: "不能出库",
4: "取消出库",
}[row[column.property]];
}
return row[column.property] || "--";
},
importExcelData() {
//
this.showExcelImport = false;
this.getList();
},
async handleDownload() {
//await this.getDownBoms();
this.listLoading = true;
this.$axios
.gets(
"/api/settleaccount/bt-kb-not-consign/export/" +
this.customerInfo.parentId
)
.then((res) => {
let fileNameOfProject = res;
this.$axios
.BolbGets(
"/api/settleaccount/getblobfile/download/" + fileNameOfProject
)
.then((response) => {
if (fileNameOfProject.indexOf("_") != -1) {
let downName =
fileNameOfProject.slice(
0,
fileNameOfProject.lastIndexOf("_")
) +
fileNameOfProject.slice(fileNameOfProject.lastIndexOf("."));
downloadFile(response, downName);
this.$notify({
title: "成功",
message: "数据-导出成功!",
type: "success",
duration: 2000,
});
} else {
downloadFile(response, fileNameOfProject);
this.$notify({
title: "成功",
message: "数据-导出成功!",
type: "success",
duration: 2000,
});
}
this.listLoading = false;
});
});
},
getList(data) {
this.listLoading = true;
if (data != undefined) {
this.listQuery.SkipCount = (this.page - 1) * data.limit;
} else {
this.listQuery.SkipCount = (this.page - 1) * 15;
}
this.listQuery.billNum = this.customerInfo.parentId;
console.log("查询条件:" + JSON.stringify(this.listQuery));
this.$axios
.posts(
"/api/settleaccount/WmsHQCaroutput/WmsSharePartDetailList",
this.listQuery
)
.then((response) => {
this.list = response.items;
//alert(JSON.stringify(response.Items))
this.totalCount = response.totalCount;
setTimeout(() => {
//
this.listLoading = false;
}, 500);
})
.catch(() => {
this.listLoading = false;
});
},
/** 筛选操作 */
handleFilter() {
this.page = 1;
this.getList();
this.listQuery.Filters = [];
if (this.searchContent != "") {
var column = "billNum";
let filter = {
logic: 0,
column: column,
action: 6,
value: this.searchContent,
};
this.listQuery.Filters.push(filter);
}
this.getList();
},
/** 多项筛选操作 */
/** 筛选操作 */
handleFilters(data) {
if (data === null) {
this.listQuery.Filters = [];
this.getList(); //
} else {
this.filterObj = data;
console.log("筛选" + JSON.stringify(data));
var offsetHei = document.documentElement.clientHeight;
var removeHeight = Object.keys(this.filterObj).length > 0 ? 310 : 240;
this.tableHeight = offsetHei - removeHeight;
this.currentPage = 1;
let Filter = [];
data.forEach((item) => {
let filter = {};
if (item.formType === "datetime" || item.formType === "datetime") {
// (datetime >= a and datetime <=b)
filter["Column"] = item.fieldName;
filter["Logic"] = 0;
filter["Value"] = item.value[0];
filter["Action"] = item.action;
Filter.push(filter);
if (item.value[1] != null) {
filter["Value"] = item.value[1];
filter["Action"] = 5;
Filter.push(filter);
}
} else {
filter["Column"] = item.fieldName;
filter["Value"] = item.value;
filter["Logic"] = 0;
filter["Action"] = item.action;
Filter.push(filter);
}
});
console.log("筛选条件" + JSON.stringify(Filter));
this.listQuery.Filters = Filter;
this.getList();
}
},
resetQuery() {},
sortChange(data) {
const { prop, order } = data;
if (!prop || !order) {
this.handleFilter();
return;
}
this.listQuery.Sorting = prop + " " + order;
this.handleFilter();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
/** 通过回调控制style */
cellStyle({ row, column, rowIndex, columnIndex }) {
if (
column.property === "fisQty" ||
column.property === "diffQty" ||
column.property === "stockQty"
) {
return { textAlign: "right" };
} else {
return { textAlign: "left" };
}
},
/** 通过回调控制表头style */
headerRowStyle({ row, column, rowIndex, columnIndex }) {
if (
column.property === "fisQty" ||
column.property === "diffQty" ||
column.property === "stockQty"
) {
return { textAlign: "right", background: "#FAFAFA" };
} else {
return { textAlign: "left", background: "#FAFAFA" };
}
},
handleRowClick(row, column, event) {
this.$refs.multipleTable.clearSelection();
this.$refs.multipleTable.toggleRowSelection(row);
},
},
};
</script>
<style lang="scss" scoped>
@import "../../../styles/crmtable.scss";
</style>
Loading…
Cancel
Save