|
@@ -1,574 +1,377 @@
|
|
|
<template>
|
|
|
- <div class="newApply pagePadding">
|
|
|
- <div
|
|
|
- v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
|
|
|
- >
|
|
|
+ <el-row class="addForm">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form
|
|
|
- :disabled="myType !== 2"
|
|
|
- :model="ruleForm"
|
|
|
- :rules="rules"
|
|
|
- ref="ruleForm"
|
|
|
- label-width="110px"
|
|
|
+ :model="tableForm"
|
|
|
+ :rules="tableFormThis"
|
|
|
+ ref="tableForm"
|
|
|
+ :size="'mini'"
|
|
|
+ class="demo-tableForm product_go"
|
|
|
>
|
|
|
- <el-form-item label="验货审核" prop="check_audit">
|
|
|
- <ex-table
|
|
|
- v-loading="false"
|
|
|
- :table="table"
|
|
|
- :data="tableData"
|
|
|
- :columns="columns"
|
|
|
- :page="pageInfo"
|
|
|
- :size="size"
|
|
|
- @page-curr-change="handlePageChange"
|
|
|
- @page-size-change="handleSizeChange"
|
|
|
- @screen-reset="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- @screen-submit="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- >
|
|
|
- <template #table-header="{}">
|
|
|
- <div style="width: 100%; height: 40px"></div>
|
|
|
- </template>
|
|
|
- <template #operation="{ scope }">
|
|
|
- <el-tooltip
|
|
|
- v-if="powers.some((item) => item == '002')"
|
|
|
- effect="dark"
|
|
|
- content="重置密码"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-refresh-left tb-icon"
|
|
|
- @click="openPasswordModal(scope.row.id, false)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
+ <el-table
|
|
|
+ :data="tableForm.product_go"
|
|
|
+ border
|
|
|
+ :size="'mini'"
|
|
|
+ row-key="key"
|
|
|
+ max-height="300px"
|
|
|
+ >
|
|
|
+ <template v-for="(item, index) in columns">
|
|
|
+ <el-table-column
|
|
|
+ :prop="item.prop"
|
|
|
+ show-overflow-tooltip
|
|
|
+ :label="item.label"
|
|
|
+ v-if="item.prop !== 'stock_num'"
|
|
|
+ :width="item.width"
|
|
|
+ :min-width="item.minWidth"
|
|
|
+ :key="item.prop + index"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ :prop="item.prop"
|
|
|
+ :label="item.label"
|
|
|
+ v-else
|
|
|
+ :width="item.width"
|
|
|
+ :min-width="item.minWidth"
|
|
|
+ :key="item.prop + index"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item
|
|
|
+ :prop="'product_go.' + scope.$index + '.' + item.prop"
|
|
|
+ :rules="scope.row.edit ? tableFormThis[item.prop] : {}"
|
|
|
+ :size="'mini'"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-if="scope.row.edit === true"
|
|
|
+ :size="'mini'"
|
|
|
+ maxlength="250"
|
|
|
+ clearable
|
|
|
+ v-model="scope.row[item.prop]"
|
|
|
+ />
|
|
|
+ <span v-else class="spscope">{{ scope.row[item.prop] }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
|
|
|
+ <el-table-column fixed="right" label="操作" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
<el-tooltip
|
|
|
- v-if="powers.some((item) => item == '007')"
|
|
|
effect="dark"
|
|
|
- content="详情"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-view tb-icon"
|
|
|
- @click="openModal(scope.row.id, true, scope.row)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="powers.some((item) => item == '005')"
|
|
|
- effect="dark"
|
|
|
- content="修改"
|
|
|
+ content="编辑"
|
|
|
+ v-if="!scope.row.edit"
|
|
|
placement="top"
|
|
|
>
|
|
|
<i
|
|
|
class="el-icon-edit tb-icon"
|
|
|
- @click="openModal(scope.row.id, false, scope.row)"
|
|
|
+ @click="editRow(scope.$index)"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="
|
|
|
- powers.some((item) => item == '004') &&
|
|
|
- scope.row.status === '1'
|
|
|
- "
|
|
|
- effect="dark"
|
|
|
- content="禁用"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-video-pause tb-icon"
|
|
|
- @click="statusConfirm(scope.row.id, scope.row.status)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="
|
|
|
- powers.some((item) => item == '004') &&
|
|
|
- scope.row.status === '0'
|
|
|
- "
|
|
|
- effect="dark"
|
|
|
- content="启用"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-video-play tb-icon"
|
|
|
- @click="statusConfirm(scope.row.id, scope.row.status)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- </template>
|
|
|
- </ex-table>
|
|
|
- </el-form-item>
|
|
|
- <!-- <el-form-item label="发货物流编号" prop="expressage_sn">
|
|
|
- <el-input
|
|
|
- type="number"
|
|
|
- :rows="2"
|
|
|
- style="width: 30%"
|
|
|
- placeholder="请输入物流单号"
|
|
|
- :size="searchSize"
|
|
|
- v-model="expressage"
|
|
|
- clearable
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="发货物流费用" prop="expressage_cost">
|
|
|
- <el-input
|
|
|
- type="number"
|
|
|
- style="width: 20%"
|
|
|
- placeholder="请输入物流费用"
|
|
|
- :size="searchSize"
|
|
|
- v-model="expressage"
|
|
|
- clearable
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item> -->
|
|
|
- <el-form-item>
|
|
|
- <el-col :span="24" style="text-align: right; margin-top: 10px">
|
|
|
- <el-button type="primary" @click="save">保 存 </el-button>
|
|
|
- <!-- <el-button type="warning" @click="submitForm"
|
|
|
- >保 存 并 发 起 流 程
|
|
|
- </el-button> -->
|
|
|
- </el-col>
|
|
|
- </el-form-item>
|
|
|
- <!-- 入库方审核备注 -->
|
|
|
|
|
|
- <!-- 物流费用 -->
|
|
|
- <!-- <el-form-item label="入库仓库" prop="stock_in_rule">
|
|
|
- <el-cascader
|
|
|
- placeholder="请选择入库仓库"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- :size="searchSize"
|
|
|
- v-model="selectStock_in"
|
|
|
- :options="options"
|
|
|
- style="width: 30%"
|
|
|
- @change="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- stockName();
|
|
|
- "
|
|
|
- ></el-cascader>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="出库商品" prop="stock_go_product">
|
|
|
- <ex-table
|
|
|
- v-loading="false"
|
|
|
- :table="table"
|
|
|
- :data="tableData"
|
|
|
- :columns="columns"
|
|
|
- :page="pageInfo"
|
|
|
- :size="size"
|
|
|
- @page-curr-change="handlePageChange"
|
|
|
- @page-size-change="handleSizeChange"
|
|
|
- @screen-reset="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- @screen-submit="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- searchList();
|
|
|
- "
|
|
|
- >
|
|
|
- <template #table-header="{}">
|
|
|
- <div style="width: 100%; height: 40px"></div>
|
|
|
- </template>
|
|
|
- <template #operation="{ scope }">
|
|
|
<el-tooltip
|
|
|
- v-if="powers.some((item) => item == '002')"
|
|
|
effect="dark"
|
|
|
- content="重置密码"
|
|
|
+ content="保存"
|
|
|
+ v-if="scope.row.edit"
|
|
|
placement="top"
|
|
|
>
|
|
|
<i
|
|
|
- class="el-icon-refresh-left tb-icon"
|
|
|
- @click="openPasswordModal(scope.row.id, false)"
|
|
|
+ class="el-icon-circle-check tb-icon"
|
|
|
+ @click="checkRow(scope.$index)"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
|
|
|
- <el-tooltip
|
|
|
- v-if="powers.some((item) => item == '007')"
|
|
|
- effect="dark"
|
|
|
- content="详情"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-view tb-icon"
|
|
|
- @click="openModal(scope.row.id, true, scope.row)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="powers.some((item) => item == '005')"
|
|
|
- effect="dark"
|
|
|
- content="修改"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
+ <el-tooltip effect="dark" content="重置" placement="top">
|
|
|
<i
|
|
|
- class="el-icon-edit tb-icon"
|
|
|
- @click="openModal(scope.row.id, false, scope.row)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="
|
|
|
- powers.some((item) => item == '004') &&
|
|
|
- scope.row.status === '1'
|
|
|
- "
|
|
|
- effect="dark"
|
|
|
- content="禁用"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-video-pause tb-icon"
|
|
|
- @click="statusConfirm(scope.row.id, scope.row.status)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="
|
|
|
- powers.some((item) => item == '004') &&
|
|
|
- scope.row.status === '0'
|
|
|
- "
|
|
|
- effect="dark"
|
|
|
- content="启用"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-video-play tb-icon"
|
|
|
- @click="statusConfirm(scope.row.id, scope.row.status)"
|
|
|
+ class="el-icon-refresh-left tb-icon"
|
|
|
+ @click="resetRow(scope.$index)"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
- </ex-table>
|
|
|
- </el-form-item> -->
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</el-form>
|
|
|
-
|
|
|
- <add-edit
|
|
|
- :id="modelId"
|
|
|
- :sitem="sitem"
|
|
|
- :show-model="showModel"
|
|
|
- :is-detail="isDetail"
|
|
|
- @refresh="searchList"
|
|
|
- @cancel="showModel = false"
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" style="text-align: right; padding: 10px 0 0 0">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :size="'mini'"
|
|
|
+ @click="submitForm"
|
|
|
+ v-if="!isDetail"
|
|
|
+ >保 存
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <search-stock-good-modal
|
|
|
+ :show-model="showGoodsModel"
|
|
|
+ :code="stockCode"
|
|
|
+ @cancel="showGoodsModel = false"
|
|
|
+ @searchChange="addGoodsRes"
|
|
|
/>
|
|
|
- </div>
|
|
|
- <div v-else>
|
|
|
- <no-auth></no-auth>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import mixinPage from "@/mixins/elPaginationHandle";
|
|
|
+import asyncRequest from "@/apis/service/stock/allot/detail";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
-import statusList from "@/assets/js/statusList";
|
|
|
-// import asyncRequest from "@/apis/service/stock/newApply";
|
|
|
-import asyncRequest from "@/mock/service/stock/newApply";
|
|
|
-import addEdit from "./addEdit-newApply";
|
|
|
-import { mapGetters } from "vuex";
|
|
|
-
|
|
|
+import { isnumber } from "@/utils/validate";
|
|
|
+import config from "./columns"; //表格列参数
|
|
|
export default {
|
|
|
- name: "allotFlow",
|
|
|
- mixins: [mixinPage, resToken],
|
|
|
- components: {
|
|
|
- addEdit,
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapGetters(["tablebtnSize", "searchSize", "size"]),
|
|
|
- powers() {
|
|
|
- let tran =
|
|
|
- this.$store.getters.btnList.find(
|
|
|
- (item) => item.menu_route == "allotFlow"
|
|
|
- ) || {};
|
|
|
- if (tran && tran.action && tran.action.length > 0) {
|
|
|
- return tran.action;
|
|
|
- } else {
|
|
|
- return [];
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
+ name: "allot",
|
|
|
+ props: ["showModel", "id", "sitem", "newTime"],
|
|
|
+ mixins: [resToken],
|
|
|
data() {
|
|
|
return {
|
|
|
- options: [
|
|
|
- {
|
|
|
- value: "选项1",
|
|
|
- label: "顺丰",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "选项2",
|
|
|
- label: "韵达",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "选项3",
|
|
|
- label: "中通",
|
|
|
- },
|
|
|
- ],
|
|
|
- value: "",
|
|
|
- // selectStock_in: "", //选择的入库仓库名称
|
|
|
- // selectStock_go: "", //选择的出库仓库名称
|
|
|
- // stock_go: "", //出库仓库name
|
|
|
- // stock_in: "", //入库仓库name
|
|
|
- // options: [], //用于渲染二级仓库名
|
|
|
- ruleForm: {},
|
|
|
- rules: {
|
|
|
- //出入库规则
|
|
|
- check_audit: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- },
|
|
|
- ],
|
|
|
+ options: [],
|
|
|
+ showGoodsModel: false,
|
|
|
+ status: "",
|
|
|
+ isDisabled: true,
|
|
|
+ isDisabledIn: true,
|
|
|
+ loading: false,
|
|
|
+ tableForm: {
|
|
|
+ product_go: [], //出库商品
|
|
|
},
|
|
|
- expressage: "",
|
|
|
- expressage_cost: 0,
|
|
|
- loading: true,
|
|
|
- showModel: false,
|
|
|
- isDetail: false,
|
|
|
- modelId: 0,
|
|
|
- tableData: [], //渲染表格
|
|
|
- //
|
|
|
- // 表格 - 数据
|
|
|
+ tableFormThis: config.tableFormThis,
|
|
|
+ columns: [],
|
|
|
tableData: [],
|
|
|
- // 表格 - 参数
|
|
|
- table: {
|
|
|
- stripe: true,
|
|
|
- border: true,
|
|
|
- // _defaultHeader_: ["setcol"],
|
|
|
- },
|
|
|
- // 表格 - 分页
|
|
|
- pageInfo: {
|
|
|
- size: 15,
|
|
|
- curr: 1,
|
|
|
- total: 0,
|
|
|
- },
|
|
|
- // 表格 - 列参数
|
|
|
- columns: [
|
|
|
- {
|
|
|
- prop: "nickname",
|
|
|
- label: "商品编号",
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "role_name",
|
|
|
- label: "商品名称",
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "mobile",
|
|
|
- label: "总数量",
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "mobile",
|
|
|
- label: "异常数量",
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "mobile",
|
|
|
- label: "异常备注",
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "mobile",
|
|
|
- label: "入库数量",
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "",
|
|
|
- label: "操作",
|
|
|
- fixed: "right",
|
|
|
- _noset_: true,
|
|
|
- _slot_: "operation",
|
|
|
- },
|
|
|
- ],
|
|
|
- // sitem: null,
|
|
|
- // // 状态
|
|
|
- // statusOptions: [
|
|
|
- // { id: "0", label: "禁用" },
|
|
|
- // { id: "1", label: "启用" },
|
|
|
- // ],
|
|
|
- parmValue: {
|
|
|
- //入参
|
|
|
- // name: "", // 业务员名字
|
|
|
- // username: "", // 账号
|
|
|
- // status: "", //
|
|
|
- // page: 1, // 页码
|
|
|
- // size: 15, // 每页显示条数
|
|
|
- },
|
|
|
- // passwordModel: false,
|
|
|
- // passwordModelId: 0,
|
|
|
- // isPasswordDetail: false,
|
|
|
- // statusList: statusList,
|
|
|
};
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ showModel: function (val) {
|
|
|
+ this.showModelThis = val;
|
|
|
+ if (val) {
|
|
|
+ this.initForm();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ showModelThis(val) {
|
|
|
+ if (!val) {
|
|
|
+ this.$emit("cancel");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ newTime: function (val) {
|
|
|
+ if (val) {
|
|
|
+ this.initForm();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
mounted() {
|
|
|
- this.searchList();
|
|
|
- // this.stockName(); //假数据,获取二级仓库名
|
|
|
+ console.log("asd");
|
|
|
+ // this.id = this.$route.query.id;
|
|
|
+ this.initForm();
|
|
|
},
|
|
|
-
|
|
|
methods: {
|
|
|
- restSearch() {
|
|
|
- //重置入参
|
|
|
- this.parmValue = {
|
|
|
- // name: "", // 业务员名字
|
|
|
- // username: "", // 账号
|
|
|
- // status: "", //
|
|
|
- // page: 1, // 页码
|
|
|
- // size: 10, // 每页显示条数
|
|
|
- };
|
|
|
- this.searchList();
|
|
|
+ closeModel() {
|
|
|
+ this.$emit("closeModel");
|
|
|
},
|
|
|
+ openGoodsModel() {
|
|
|
+ let index = this.tableForm.product_go.findIndex((v) => v.edit);
|
|
|
+ if (index !== -1) {
|
|
|
+ this.$message.warning("当前已有商品正在编辑!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- openModal(id, isDetail, sitem) {
|
|
|
- this.showModel = true;
|
|
|
- this.modelId = id;
|
|
|
- this.isDetail = isDetail;
|
|
|
- this.sitem = sitem;
|
|
|
+ this.showGoodsModel = true;
|
|
|
},
|
|
|
- async deleteById(id, status) {
|
|
|
- // await this.$confirm("确定要删除?", {
|
|
|
- // confirmButtonText: "确定",
|
|
|
- // cancelButtonText: "取消",
|
|
|
- // type: "warning",
|
|
|
- // })
|
|
|
- // .then(async () => {
|
|
|
- // const model = {
|
|
|
- // id: id,
|
|
|
- // status: status === "1" ? "0" : "1",
|
|
|
- // };
|
|
|
- // const res = await asyncRequest.status(model);
|
|
|
- // if (res && res.code === 0) {
|
|
|
- // this.$notify.success({
|
|
|
- // title: "删除成功",
|
|
|
- // message: "",
|
|
|
- // });
|
|
|
- // this.searchList();
|
|
|
- // } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- // await this.logout();
|
|
|
- // } else {
|
|
|
- // this.$message.warning(res.message);
|
|
|
- // }
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // console.log("取消");
|
|
|
- // });
|
|
|
+
|
|
|
+ async initForm() {
|
|
|
+ this.loading = true;
|
|
|
+ this.columns = [];
|
|
|
+ let list = JSON.parse(JSON.stringify(config.columns));
|
|
|
+ list.forEach((v1) => {
|
|
|
+ if (v1.prop === "stock_num") {
|
|
|
+ v1.width = "160px";
|
|
|
+ }
|
|
|
+ this.columns.push(v1);
|
|
|
+ });
|
|
|
+ await this.getresultlist();
|
|
|
+ //
|
|
|
+ await this.resetForm();
|
|
|
+ this.loading = false;
|
|
|
},
|
|
|
- async searchList() {
|
|
|
- // this.loading = true;
|
|
|
- // const res = await asyncRequest.list(this.parmValue);
|
|
|
- // if (res && res.code === 0 && res.data) {
|
|
|
- // this.tableData = res.data.list;
|
|
|
- // this.pageInfo.total = Number(res.data.count);
|
|
|
- // } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- // await this.logout();
|
|
|
- // } else {
|
|
|
- // this.tableData = [];
|
|
|
- // this.pageInfo.total = 0;
|
|
|
- // }
|
|
|
- // this.loading = false;
|
|
|
+ async getresultlist() {
|
|
|
+ const res = await asyncRequest.resultlist({
|
|
|
+ page: 1,
|
|
|
+ size: 100,
|
|
|
+ status: "",
|
|
|
+ });
|
|
|
+ if (res && res.code === 0 && res.data) {
|
|
|
+ const { list } = res.data;
|
|
|
+ this.options = list;
|
|
|
+ console.log(this.options);
|
|
|
+ } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
},
|
|
|
+ async resetForm() {
|
|
|
+ // 重置
|
|
|
+ await this.$nextTick(() => {
|
|
|
+ if (this.$refs.tableForm) {
|
|
|
+ this.$refs.tableForm.resetFields();
|
|
|
+ this.$refs.tableForm.clearValidate();
|
|
|
+ const { item, status } = this.sitem;
|
|
|
+ this.status = status;
|
|
|
|
|
|
- async statusConfirm(id, status) {
|
|
|
- // let str = status === "1" ? "禁用" : "启用";
|
|
|
- // await this.$confirm("确定要改为" + str + "?", {
|
|
|
- // confirmButtonText: "确定",
|
|
|
- // cancelButtonText: "取消",
|
|
|
- // type: "warning",
|
|
|
- // })
|
|
|
- // .then(async () => {
|
|
|
- // this.loading = true;
|
|
|
- // const model = {
|
|
|
- // id: id,
|
|
|
- // status: status === "1" ? "0" : "1",
|
|
|
- // };
|
|
|
- // const res = await asyncRequest.status(model);
|
|
|
- // if (res && res.code === 0) {
|
|
|
- // this.loading = false;
|
|
|
- // this.$notify.success({
|
|
|
- // title: "状态修改成功!",
|
|
|
- // message: "",
|
|
|
- // });
|
|
|
- // await this.searchList();
|
|
|
- // } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- // await this.logout();
|
|
|
- // } else {
|
|
|
- // this.$message.warning(res.message);
|
|
|
- // }
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // console.log("取消");
|
|
|
- // });
|
|
|
+ this.tableForm.product_go = [];
|
|
|
+ let list = JSON.parse(JSON.stringify(item));
|
|
|
+ // item || []; //出库商品
|
|
|
+ list.forEach((v) => {
|
|
|
+ v.usable_stock = v.usable_num;
|
|
|
+ v.type_code = v.good_type_code;
|
|
|
+ v.error_num = "0";
|
|
|
+ v.error_code = "";
|
|
|
+ v.error_remark = "";
|
|
|
+ v.stock_num = "0";
|
|
|
+ v.edit = false;
|
|
|
+ this.tableForm.product_go.push(v);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
- // async stockName() {
|
|
|
- // //获取多级仓库名称的方法
|
|
|
- // const res = await asyncRequest.listAll(this.parmValue);
|
|
|
- // // console.log(res.data);
|
|
|
- // // this.openModal("005", true);
|
|
|
- // // console.log(this.selectStock_go);
|
|
|
- // // console.log(this.selectStock_in);
|
|
|
- // // this.options = res.data;
|
|
|
- // // console.log(this.options);
|
|
|
- // let arr = res.data;
|
|
|
- // // console.log(arr);
|
|
|
- // arr.forEach((ele) => {
|
|
|
- // //重新封装后台传递来的数据,转换格式
|
|
|
- // let item = {
|
|
|
- // value: ele.id,
|
|
|
- // label: ele.name,
|
|
|
- // children: [],
|
|
|
- // };
|
|
|
- // ele.child.forEach((elem) => {
|
|
|
- // let model = {
|
|
|
- // value: elem.id,
|
|
|
- // label: elem.name,
|
|
|
- // };
|
|
|
- // item.children.push(model);
|
|
|
- // });
|
|
|
- // this.options.push(item);
|
|
|
- // });
|
|
|
- // this.options.forEach((ele) => {
|
|
|
- // //从数据表中筛选出我们要用的数据
|
|
|
- // if (ele.value === this.selectStock_go[0]) {
|
|
|
- // ele.children.forEach((elem) => {
|
|
|
- // if (elem.value === this.selectStock_go[1]) {
|
|
|
- // this.stock_go = ele.label + "/" + elem.label;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
- // if (ele.value === this.selectStock_in[0]) {
|
|
|
- // ele.children.forEach((elem) => {
|
|
|
- // if (elem.value === this.selectStock_in[1]) {
|
|
|
- // this.stock_in = ele.label + "/" + elem.label;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
- // });
|
|
|
- // if (this.selectStock_in != "" || this.selectStock_go != "") {
|
|
|
- // console.log("选择了一个项目");
|
|
|
- // this.openModal("005", true);
|
|
|
- // }
|
|
|
- // // console.log(this.stock_go);
|
|
|
- // // console.log(this.stock_in);
|
|
|
- // // console.log(this.pageInfo.total);
|
|
|
- // this.compareStock(); //比较出库仓库和入库仓库是否相同
|
|
|
- // },
|
|
|
|
|
|
- compareStock() {
|
|
|
- //比较出库仓库和入库仓库是否相同
|
|
|
- if (
|
|
|
- this.stock_go === this.stock_in &&
|
|
|
- this.stock_go !== "" &&
|
|
|
- this.stock_go != ""
|
|
|
- ) {
|
|
|
- console.log("出库仓库和入库仓库相同");
|
|
|
- this.$message({
|
|
|
- message: "出库仓库不能和入库仓库相同",
|
|
|
- type: "error",
|
|
|
+ async submitForm() {
|
|
|
+ let index = -1,
|
|
|
+ good = [];
|
|
|
+ this.tableForm.product_go.forEach((v, i) => {
|
|
|
+ if (v.edit && index === -1) {
|
|
|
+ index = i;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (index !== -1) {
|
|
|
+ this.$message.warning("当前已有商品正在编辑!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.loading = true;
|
|
|
+ good = this.getGoodList();
|
|
|
+ const model = {
|
|
|
+ allot_code: this.sitem.allot_code,
|
|
|
+ good: good,
|
|
|
+ };
|
|
|
+ let res = await asyncRequest.allotvesio(model);
|
|
|
+ this.loading = false;
|
|
|
+ if (res && res.code === 0) {
|
|
|
+ this.$notify.success({
|
|
|
+ title: "入库方验货结果提交成功",
|
|
|
+ message: "",
|
|
|
});
|
|
|
+
|
|
|
+ this.showModelThis = false;
|
|
|
+ // 刷新
|
|
|
+ this.$emit("refresh");
|
|
|
+ } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //提交表单前 商品信息list 汇总
|
|
|
+ getGoodList() {
|
|
|
+ let oldList = JSON.parse(JSON.stringify(this.tableForm.product_go)),
|
|
|
+ resList = [];
|
|
|
+ oldList.forEach((v1) => {
|
|
|
+ let goodModel = {
|
|
|
+ good_code: v1.type_code,
|
|
|
+ usable_num: v1.usable_stock,
|
|
|
+ error_num: v1.error_num,
|
|
|
+ error_remark: v1.error_remark,
|
|
|
+ stock_num:v1.stock_num,
|
|
|
+ error_code: v1.error_code,
|
|
|
+ };
|
|
|
+ resList.push(goodModel);
|
|
|
+ });
|
|
|
+ return resList;
|
|
|
+ },
|
|
|
+ // 删除行操作
|
|
|
+ resetRow(index) {
|
|
|
+ this.tableForm.product_go[index].stock_num = "0";
|
|
|
+ },
|
|
|
+ //保存某一行
|
|
|
+ checkRow(rowIndex) {
|
|
|
+ const { allot_num, stock_num } = this.tableForm.product_go[rowIndex];
|
|
|
+ if (!isnumber(stock_num+"")) {
|
|
|
+ this.$message.warning("请输入数字!");
|
|
|
+ return;
|
|
|
}
|
|
|
+ if (parseInt(stock_num) > parseInt(allot_num)) {
|
|
|
+ this.$message.warning("入库数量不大于调拨总数量!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.tableForm.product_go[rowIndex].edit = false;
|
|
|
+ },
|
|
|
+ //编辑某一行
|
|
|
+ editRow(rowIndex) {
|
|
|
+ console.log(this.tableForm.product_go);
|
|
|
+ let index = this.tableForm.product_go.findIndex((v) => v.edit);
|
|
|
+ if (index !== -1) {
|
|
|
+ this.$message.warning("请完成其他行的编辑!");
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ this.tableForm.product_go[rowIndex].edit = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 执行点击商品名称的抛出事件
|
|
|
+ addGoodsRes(e) {
|
|
|
+ let oldList = JSON.parse(JSON.stringify(this.tableForm.product_go)),
|
|
|
+ addList = JSON.parse(JSON.stringify(e)),
|
|
|
+ newList = [].concat(...oldList),
|
|
|
+ dList = JSON.parse(JSON.stringify(this.delList));
|
|
|
+ addList.forEach((v1, index) => {
|
|
|
+ let oldindex = oldList.findIndex((v2) => v1.type_code === v2.type_code);
|
|
|
+ if (oldindex === -1) {
|
|
|
+ addList[index].allot_num = addList[index].usable_stock;
|
|
|
+ addList[index].edit = false;
|
|
|
+ newList.push(addList[index]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ newList.forEach((v3) => {
|
|
|
+ let otherindex = dList.findIndex((v4) => v3.type_code === v4.type_code);
|
|
|
+ if (otherindex !== -1) {
|
|
|
+ dList.splice(otherindex, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.tableForm.product_go = [].concat(...newList);
|
|
|
+ this.delList = [].concat(...dList);
|
|
|
+ this.$refs.tableForm.validateField("product_go");
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
- <style lang="scss" >
|
|
|
-.newApply {
|
|
|
-}
|
|
|
-.el-form-item__content {
|
|
|
- margin: 0 !important;
|
|
|
-}
|
|
|
-.setcol-table-lie {
|
|
|
- // margin: 0 !important;
|
|
|
+
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.allot,
|
|
|
+.allotDetail {
|
|
|
+ .label-title-model {
|
|
|
+ line-height: 30px;
|
|
|
+ width: 100%;
|
|
|
+ color: #909399;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 15px;
|
|
|
+ padding-bottom: 12px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .product_go {
|
|
|
+ .el-form-item--mini.el-form-item {
|
|
|
+ margin: 0 !important;
|
|
|
+ .spscope {
|
|
|
+ word-break: break-all !important;
|
|
|
+ line-height: 23px !important;
|
|
|
+ padding: 0 !important;
|
|
|
+ margin: 0 !important;
|
|
|
+ list-style: none !important;
|
|
|
+ font-style: normal !important;
|
|
|
+ text-decoration: none !important;
|
|
|
+ border: none !important;
|
|
|
+ display: inline-block !important;
|
|
|
+ font-weight: 500 !important;
|
|
|
+ font-family: "Microsoft Yahei", sans-serif !important;
|
|
|
+ -webkit-tap-highlight-color: transparent !important;
|
|
|
+ -webkit-font-smoothing: antialiased !important;
|
|
|
+ color: #606266 !important;
|
|
|
+ font-size: 12px !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|
|
|
+
|
|
|
|