|
@@ -0,0 +1,405 @@
|
|
|
+<template>
|
|
|
+ <div class="borderless" v-loading="pageLoading">
|
|
|
+ <div class="customer-head">
|
|
|
+ <div class="customer-back">
|
|
|
+ <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
|
|
|
+ @click="backToList">返回列表
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div class="add-customer-btn">
|
|
|
+ <el-button type="primary" @click="editCustomer" :loading="subLoading" v-if="detailData.status != 3"
|
|
|
+ size="small">保存数据
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="customer-main" v-loading="subLoading">
|
|
|
+ <trade-card title="基础信息">
|
|
|
+ <avue-form ref="form" class="trading-form" v-model="form" :option="option">
|
|
|
+ <template slot="goodsTypeId">
|
|
|
+ <div style="display:flex;">
|
|
|
+ <avue-cascader :emit-path="false" check-strictly :show-all-levels="false" v-model="form.goodsTypeId"
|
|
|
+ placeholder="请选择产品分类" :dic="goodsTypeList" :props="props"></avue-cascader>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template slot="storageId">
|
|
|
+ <el-cascader v-model="form.storageId" :options="storagetreeList" :show-all-levels="false"
|
|
|
+ :disabled="detailData.status == 1" :props="{ checkStrictly: true, emitPath: false, label: 'title' }"
|
|
|
+ clearable @change="storagetreeChange">
|
|
|
+ </el-cascader>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
+ </trade-card>
|
|
|
+ <trade-card title="入库明细">
|
|
|
+ <avue-crud ref="crud" :data="tableList" :option="tableOption" :cell-style="cellStyle"
|
|
|
+ @search-change="searchChange(1)">
|
|
|
+ </avue-crud>
|
|
|
+ </trade-card>
|
|
|
+ <trade-card title="订单信息">
|
|
|
+ <avue-crud ref="crudTwo" :data="tableListTwo" :option="tableOptionTwo" :cell-style="cellStyle"
|
|
|
+ @search-change="searchChange(2)">
|
|
|
+ </avue-crud>
|
|
|
+ </trade-card>
|
|
|
+ <trade-card title="历史记录">
|
|
|
+ <avue-crud ref="crudThree" :data="tableListThree" :option="tableOptionThree" :cell-style="cellStyle"
|
|
|
+ @search-change="searchChange(3)">
|
|
|
+ </avue-crud>
|
|
|
+ </trade-card>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ import {
|
|
|
+ getStoragetree,
|
|
|
+ getStorage,
|
|
|
+ scanningCodeAddPc,
|
|
|
+ } from "@/api/purchasingManagement/inStock";
|
|
|
+ import { customerList} from "@/api/tirePartsMall/basicData/commodityInformation"
|
|
|
+ import {
|
|
|
+ typeSave,
|
|
|
+ detail,
|
|
|
+ } from "@/api/tirePartsMall/basicData/warehouseEntryOrder";
|
|
|
+ import tableOption from "./config/customerContact.json";
|
|
|
+ import tableOptionTwo from "./config/customerContactTwo.json";
|
|
|
+ import { getToken } from "@/util/auth";
|
|
|
+ import { dateFormat, getCurrentDate } from "@/util/date";
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: "detailsOrderEdit",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ activeName: 'searchList',
|
|
|
+ props: {
|
|
|
+ label: 'cname',
|
|
|
+ value: 'id'
|
|
|
+ },
|
|
|
+ page: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ pageTwo: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ pageThree: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ loading: false,
|
|
|
+ form: {},
|
|
|
+ tableOption: {},
|
|
|
+ tableOptionTwo: {},
|
|
|
+ tableOptionThree: {
|
|
|
+ align: "center",
|
|
|
+ addBtn: false,
|
|
|
+ refreshBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ border: true,
|
|
|
+ menuWidth: 120,
|
|
|
+ stripe: true,
|
|
|
+ menu: false,
|
|
|
+ columnBtn: false,
|
|
|
+ column: [{
|
|
|
+ prop: "mainBillNo",
|
|
|
+ label: "操作人",
|
|
|
+ overHidden: true,
|
|
|
+ showColumn: false,
|
|
|
+ width: 120,
|
|
|
+ }, {
|
|
|
+ prop: "statusName",
|
|
|
+ label: "状态",
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ prop: "containerNo",
|
|
|
+ label: "时间",
|
|
|
+ overHidden: true,
|
|
|
+ searchDefaultTime: ["00:00:00", "23:59:59"],
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ },]
|
|
|
+ },
|
|
|
+ option: {
|
|
|
+ disabled: false,
|
|
|
+ menuBtn: false,
|
|
|
+ labelWidth: 100,
|
|
|
+ columnBtn: false,
|
|
|
+ span: 6,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "入库单号",
|
|
|
+ prop: "ordNo",
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "来源单号",
|
|
|
+ prop: "srcOrdNo",
|
|
|
+ blur: (data) => {
|
|
|
+ for (let item of this.itemsVOList) {
|
|
|
+ item.containerNo = data.value
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ label: "业务对象",
|
|
|
+ prop: "customerName",
|
|
|
+ search: true,
|
|
|
+ overHidden: true,
|
|
|
+ // width: 120,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }, {
|
|
|
+ label: "仓库",
|
|
|
+ prop: "storageName",
|
|
|
+ search: true,
|
|
|
+ overHidden: true,
|
|
|
+ // width: 120,
|
|
|
+ overHidden: true,
|
|
|
+ // width: 120,
|
|
|
+ type: 'select',
|
|
|
+ dicUrl: "/api/blade-sales-part/storageDesc/listAll",
|
|
|
+ props: {
|
|
|
+ label: 'cname',
|
|
|
+ value: 'id'
|
|
|
+ },
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }, {
|
|
|
+ label: "商品种类",
|
|
|
+ prop: "goodsTypeId",
|
|
|
+ dicData: [],
|
|
|
+ search: false,
|
|
|
+ type: 'select',
|
|
|
+ overHidden: true,
|
|
|
+ // width: 120,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }, {
|
|
|
+ label: "商品数量",
|
|
|
+ prop: "goodsTotalNum",
|
|
|
+ search: false,
|
|
|
+ overHidden: true,
|
|
|
+ // width: 120,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }, {
|
|
|
+ label: "状态",
|
|
|
+ prop: "statusName",
|
|
|
+ search: true,
|
|
|
+ overHidden: true,
|
|
|
+ // width: 120,
|
|
|
+ }, {
|
|
|
+ label: "业务日期",
|
|
|
+ prop: "createTime",
|
|
|
+ type: "datetime",
|
|
|
+ value: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'),
|
|
|
+ format: "yyyy-MM-dd HH:mm",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ span: 6
|
|
|
+ }, {
|
|
|
+ label: "库管",
|
|
|
+ prop: "remarks",
|
|
|
+ search: true,
|
|
|
+ overHidden: true,
|
|
|
+ // width: 200
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ itemsVOList: [],
|
|
|
+ subLoading: false,
|
|
|
+ pageLoading: false,
|
|
|
+ storagetreeList: [],
|
|
|
+ tableList: [],
|
|
|
+ tableListTwo: [],
|
|
|
+ tableListThree: [],
|
|
|
+ goodsTypeList: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ detailData: {
|
|
|
+ type: Object
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ async created() {
|
|
|
+ if (this.detailData.status == 3) {
|
|
|
+ this.option.disabled = true;
|
|
|
+ }
|
|
|
+ if (this.detailData.status == 1) {
|
|
|
+ this.option.disabled = true;
|
|
|
+ }
|
|
|
+ console.log(this.detailData)
|
|
|
+ if (this.detailData.id) {
|
|
|
+ this.getDetail(this.detailData.id);
|
|
|
+ }
|
|
|
+ this.tableOption = await this.getColumnData(this.getColumnName(274.1), tableOption);
|
|
|
+ this.tableOptionTwo = await this.getColumnData(this.getColumnName(274.2), tableOptionTwo);
|
|
|
+ getStoragetree().then(res => {
|
|
|
+ this.storagetreeList = res.data.data;
|
|
|
+ })
|
|
|
+ this.getAllWorkDicts()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getAllWorkDicts() {
|
|
|
+ customerList({ corpType: "SP" }).then(res => {
|
|
|
+ this.goodsTypeList = res.data.data.records;
|
|
|
+ console.log(111, this.goodsTypeList)
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ cellStyle() {
|
|
|
+ return "padding:0;height:40px;";
|
|
|
+ },
|
|
|
+ getStorage() {
|
|
|
+ getStorage({ storageTypeId: this.form.storageId }).then(res => {
|
|
|
+ this.findObject(this.tableOption.column, "storageId").dicData = res.data;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ storagetreeChange(row) {
|
|
|
+ for (let item of this.storagetreeList) {
|
|
|
+ if (item.id === row) {
|
|
|
+ this.form.isScanning = item.isScanningCode
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getDetail(id) {
|
|
|
+ this.pageLoading = true;
|
|
|
+ detail(id)
|
|
|
+ .then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.oldform = this.deepClone(res.data.data);
|
|
|
+ this.getStorage()
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.pageLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ searchChange(params, type, done) {
|
|
|
+ done();
|
|
|
+ page = type == 1 ? this.page : type == 2 ? pageTwo : pageThree
|
|
|
+ this.onLoad(page, params, type)
|
|
|
+ },
|
|
|
+ onLoad(page, params = {}, type) {
|
|
|
+ params = {
|
|
|
+ ...params,
|
|
|
+ current: page.currentPage,
|
|
|
+ size: page.pageSize,
|
|
|
+ corpType: "GYS",
|
|
|
+ ...Object.assign(params, this.search)
|
|
|
+ }
|
|
|
+ this.loading = true
|
|
|
+ getList(params).then(res => {
|
|
|
+ if (type == 1) {
|
|
|
+ this.tableList = res.data.data.records
|
|
|
+ this.page.total = res.data.data.total
|
|
|
+ } else if (type == 2) {
|
|
|
+ this.tableListTwo = res.data.data.records
|
|
|
+ this.pageTwo.total = res.data.data.total
|
|
|
+ } else {
|
|
|
+ this.tableListThree = res.data.data.records
|
|
|
+ this.pageThree.total = res.data.data.total
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //修改提交触发
|
|
|
+ editCustomer(status) {
|
|
|
+ this.$refs["form"].validate((valid, done) => {
|
|
|
+ done();
|
|
|
+ if (valid) {
|
|
|
+ this.subLoading = true;
|
|
|
+ let data = {
|
|
|
+ ...this.form,
|
|
|
+
|
|
|
+ };
|
|
|
+ typeSave(data).then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "保存成功!"
|
|
|
+ });
|
|
|
+ if (status == "goBack") {
|
|
|
+ this.$emit("goBack");
|
|
|
+ }
|
|
|
+ if (!this.detailData.id) {
|
|
|
+ this.detailData.id = res.data.data.id
|
|
|
+ }
|
|
|
+ this.getDetail(res.data.data.id)
|
|
|
+ }).finally(() => {
|
|
|
+ this.subLoading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //返回列表
|
|
|
+ backToList() {
|
|
|
+ this.$emit("goBack");
|
|
|
+
|
|
|
+ },
|
|
|
+ }
|
|
|
+ };
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <style lang="scss" scoped>
|
|
|
+ .trading-form ::v-deep .el-form-item {
|
|
|
+ margin-bottom: 8px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .el-form-item__error {
|
|
|
+ display: none !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .select-component {
|
|
|
+ display: flex !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .el-table .cell {
|
|
|
+ padding: 0 2px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .avue-crud .el-table .el-form-item__label {
|
|
|
+ left: -1px;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+
|