|
@@ -4,74 +4,143 @@
|
|
|
<div
|
|
|
v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
|
|
|
>
|
|
|
- <el-divider content-position="center">备货申请详情</el-divider>
|
|
|
+ <!-- <el-divider content-position="center">备货申请详情</el-divider> -->
|
|
|
+ <!-- disabled="true" -->
|
|
|
<el-form
|
|
|
:model="ruleForm"
|
|
|
:rules="rules"
|
|
|
ref="ruleForm"
|
|
|
label-width="120px"
|
|
|
- disabled="true"
|
|
|
>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="商品名称" prop="goods_name">
|
|
|
+ <el-form-item label="商品名称" prop="good_name">
|
|
|
<el-input
|
|
|
style="width: 100%"
|
|
|
- v-model="ruleForm.goods_name"
|
|
|
+ v-model="ruleForm.good_name"
|
|
|
placeholder="请输入内容"
|
|
|
- :size="searchSize"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="采购数量" prop="goods_num">
|
|
|
+ <el-form-item label="采购数量" prop="good_num">
|
|
|
<el-input
|
|
|
style="width: 100%"
|
|
|
- v-model="ruleForm.goods_num"
|
|
|
+ v-model="ruleForm.good_num"
|
|
|
placeholder="请输入内容"
|
|
|
- :size="searchSize"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="最晚入库时间" prop="last_go_time">
|
|
|
- <el-date-picker
|
|
|
+ <el-form-item label="申请人" prop="apply_name">
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.apply_name"
|
|
|
style="width: 100%"
|
|
|
- :size="searchSize"
|
|
|
- v-model="ruleForm.last_go_time"
|
|
|
- type="date"
|
|
|
- value-format="timestamp"
|
|
|
- placeholder="选择日期"
|
|
|
- @change="selectTime"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
+ placeholder="请输入内容"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="入库仓库" prop="stock_in_rule">
|
|
|
+ <el-form-item label="入库仓库" prop="wsm_name">
|
|
|
<el-cascader
|
|
|
placeholder="请选择入库仓库"
|
|
|
filterable
|
|
|
clearable
|
|
|
- :size="searchSize"
|
|
|
- v-model="ruleForm.stock_in_rule"
|
|
|
+ v-model="ruleForm.wsm_name"
|
|
|
:options="options"
|
|
|
style="width: 100%"
|
|
|
@change="
|
|
|
pageInfo.curr = 1;
|
|
|
parmValue.page = 1;
|
|
|
- stockName();
|
|
|
"
|
|
|
></el-cascader>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="商品code">
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.good_code"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="商品属性code">
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.good_type_code"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="仓库code">
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.wsm_code"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="备库code">
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.bk_code"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="当前状态">
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.status"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="最晚入库时间" prop="lasttime">
|
|
|
+ <el-date-picker
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="ruleForm.lasttime"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd HH-mm-ss"
|
|
|
+ placeholder="选择日期"
|
|
|
+ @change="selectTime"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-col :span="24" style="text-align: right; margin-top: 10px">
|
|
|
+ <el-button type="primary" @click="save('ruleForm')"
|
|
|
+ >保 存
|
|
|
+ </el-button>
|
|
|
+ <el-button type="warning" @click="searchList('1')"
|
|
|
+ >保 存 并 发 起 流 程
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12"></el-col>
|
|
|
+ </el-row>
|
|
|
</el-form>
|
|
|
<el-divider content-position="center">采购反馈</el-divider>
|
|
|
<el-form
|
|
|
+ v-if="ruleForm && ruleForm.status === '1'"
|
|
|
:model="ruleForm"
|
|
|
:rules="ruless"
|
|
|
ref="ruleForm"
|
|
@@ -79,21 +148,37 @@
|
|
|
>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="出库仓库" prop="stock_go_rule">
|
|
|
- <el-cascader
|
|
|
- placeholder="请选择出库仓库"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- :size="searchSize"
|
|
|
- v-model="ruleForm.stock_go_rule"
|
|
|
- :options="options"
|
|
|
+ <el-form-item label="供应商名称" prop="supplier_code">
|
|
|
+ <search-supplier
|
|
|
+ :value="ruleForm.supplier_code"
|
|
|
+ :placeholder="'请选择供应商'"
|
|
|
+ @searchChange="selectSupplier"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="仓库名称" prop="stock_code">
|
|
|
+ <search-stock
|
|
|
+ :value="ruleForm.stock_code"
|
|
|
+ :isDetail="true"
|
|
|
+ :placeholder="'请选择盘点仓库'"
|
|
|
+ :isRelation="true"
|
|
|
+ :companyCode="companyCode"
|
|
|
+ :names="''"
|
|
|
+ @searchChange="selectStock"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12"
|
|
|
+ ><el-form-item label="采购数量上限" prop="goods_num_limit">
|
|
|
+ <el-input
|
|
|
style="width: 100%"
|
|
|
- @change="
|
|
|
- pageInfo.curr = 1;
|
|
|
- parmValue.page = 1;
|
|
|
- stockName();
|
|
|
- "
|
|
|
- ></el-cascader> </el-form-item
|
|
|
+ v-model="ruleForm.goods_num_limit"
|
|
|
+ placeholder="请输入数量上限"
|
|
|
+ :size="searchSize"
|
|
|
+ ></el-input> </el-form-item
|
|
|
></el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="预计入库时间" prop="expect_go_stock">
|
|
@@ -106,19 +191,9 @@
|
|
|
placeholder="选择日期"
|
|
|
@change="selectTime"
|
|
|
>
|
|
|
- </el-date-picker> </el-form-item
|
|
|
- ></el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12"
|
|
|
- ><el-form-item label="采购数量上限" prop="goods_num_limit">
|
|
|
- <el-input
|
|
|
- style="width: 100%"
|
|
|
- v-model="ruleForm.goods_num_limit"
|
|
|
- placeholder="请输入数量上限"
|
|
|
- :size="searchSize"
|
|
|
- ></el-input> </el-form-item
|
|
|
- ></el-col>
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12"
|
|
@@ -131,16 +206,6 @@
|
|
|
/> </el-form-item
|
|
|
></el-col>
|
|
|
</el-row>
|
|
|
- <el-form-item>
|
|
|
- <el-col :span="24" style="text-align: right; margin-top: 10px">
|
|
|
- <el-button type="primary" @click="save('ruleForm')"
|
|
|
- >保 存
|
|
|
- </el-button>
|
|
|
- <el-button type="warning" @click="submitForm('ruleForm')"
|
|
|
- >保 存 并 发 起 流 程
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- </el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div v-else>
|
|
@@ -174,61 +239,70 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
data() {
|
|
|
- const validatemobile = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("手机号不能为空!"));
|
|
|
- } else {
|
|
|
- if (!isMobile(value)) {
|
|
|
- callback(new Error("手机号格式不正确!"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- const validateExpressNumber = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("物流单号不能为空!"));
|
|
|
- } else {
|
|
|
- if (!isAlphanumeric(value)) {
|
|
|
- callback(new Error("物流单号为6-16位数字字母组合!"));
|
|
|
- } else if (value.length < 6 || value.length > 16) {
|
|
|
- callback(new Error("物流单号为6-16位数字字母组合!"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
+ // const validatemobile = (rule, value, callback) => {
|
|
|
+ // if (value === "") {
|
|
|
+ // callback(new Error("手机号不能为空!"));
|
|
|
+ // } else {
|
|
|
+ // if (!isMobile(value)) {
|
|
|
+ // callback(new Error("手机号格式不正确!"));
|
|
|
+ // } else {
|
|
|
+ // callback();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ // const validateExpressNumber = (rule, value, callback) => {
|
|
|
+ // if (value === "") {
|
|
|
+ // callback(new Error("物流单号不能为空!"));
|
|
|
+ // } else {
|
|
|
+ // if (!isAlphanumeric(value)) {
|
|
|
+ // callback(new Error("物流单号为6-16位数字字母组合!"));
|
|
|
+ // } else if (value.length < 6 || value.length > 16) {
|
|
|
+ // callback(new Error("物流单号为6-16位数字字母组合!"));
|
|
|
+ // } else {
|
|
|
+ // callback();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // };
|
|
|
return {
|
|
|
+ companyCode: "", //公司code
|
|
|
id: "", //路由传过来的id
|
|
|
inTime: "",
|
|
|
goTime: "",
|
|
|
ruleForm: {
|
|
|
- goods_name: "", //商品名称
|
|
|
- goods_num: "", //商品数量
|
|
|
- last_go_time: "", //最晚入库时间
|
|
|
+ supplier_code: [], //供应商名称
|
|
|
+ good_name: "", //商品名称
|
|
|
+ good_num: "", //商品数量
|
|
|
+ lasttime: "", //最晚入库时间
|
|
|
stock_in_rule: "", //入库仓库
|
|
|
goods_num_limit: "", //采购数量上限
|
|
|
expect_go_time: "", //预计入库时间
|
|
|
stock_go_rule: "", //出库仓库
|
|
|
remark: "", //备注
|
|
|
+ bk_code: "", //备库code
|
|
|
+ apply_name: "", //申请人
|
|
|
+ good_code: "", //商品code
|
|
|
+ good_type_code: "", //商品属性code
|
|
|
+ wsm_code: "", //仓库code
|
|
|
+ wsm_name: "", //仓库名
|
|
|
+ status: "", //当前状态
|
|
|
},
|
|
|
rules: {
|
|
|
//出入库规则
|
|
|
- goods_name: [
|
|
|
+ good_name: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "商品名称不能为空",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- goods_num: [
|
|
|
+ good_num: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请选择入库仓库",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- last_go_time: [
|
|
|
+ lasttime: [
|
|
|
{
|
|
|
// type: "date",
|
|
|
required: true,
|
|
@@ -237,63 +311,20 @@ export default {
|
|
|
trigger: ["blur", "change"],
|
|
|
},
|
|
|
],
|
|
|
- stock_in_rule: [
|
|
|
+ wsm_name: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请选择入库仓库",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- consignee: [
|
|
|
- {
|
|
|
- type: "array",
|
|
|
- required: true,
|
|
|
- message: "收货人不能为空",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- mobile: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "电话号不能为空",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
- {
|
|
|
- validator: validatemobile,
|
|
|
- },
|
|
|
],
|
|
|
- receivedArea: [
|
|
|
+ apply_name: [
|
|
|
{
|
|
|
- type: "array",
|
|
|
required: true,
|
|
|
- message: "收货地址不能为空",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- detailArea: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请输入详细地址",
|
|
|
+ message: "申请人名称",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- express_number: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请输入快递单号",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- {
|
|
|
- validator: validateExpressNumber,
|
|
|
- },
|
|
|
- ],
|
|
|
- send_out_time: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请输发货时间",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
},
|
|
|
ruless: {
|
|
|
stock_go_rule: [
|
|
@@ -326,6 +357,14 @@ export default {
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
+ supplier_code: [
|
|
|
+ {
|
|
|
+ type: "array",
|
|
|
+ required: true,
|
|
|
+ message: "请选择供应商",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
loading: true,
|
|
|
showModel: false,
|
|
@@ -369,46 +408,20 @@ export default {
|
|
|
_slot_: "operation",
|
|
|
},
|
|
|
],
|
|
|
- parmValue: {},
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.id = this.$route.query.id;
|
|
|
+ this.id = this.$route.query.id; //详情接口的入参
|
|
|
this.searchList();
|
|
|
},
|
|
|
methods: {
|
|
|
- // 选择省市区
|
|
|
- selectArea(e) {
|
|
|
- // console.log(e);
|
|
|
- if (e && e.length == 3) {
|
|
|
- this.ruleForm.receivedArea = e;
|
|
|
- } else {
|
|
|
- this.ruleForm.consignee = [];
|
|
|
- }
|
|
|
- // console.log(this.ruleForm);
|
|
|
- this.$refs.ruleForm.validateField("receivedArea");
|
|
|
- },
|
|
|
- // 选择收获人
|
|
|
- handleResignName(e) {
|
|
|
- if (e && e.id) {
|
|
|
- this.ruleForm.consignee = [e.id];
|
|
|
- } else {
|
|
|
- this.ruleForm.consignee = [];
|
|
|
- }
|
|
|
- this.$refs.ruleForm.validateField("consignee");
|
|
|
- },
|
|
|
// 最晚入库时间选择
|
|
|
selectTime(e) {
|
|
|
console.log(e);
|
|
|
this.ruleForm.goTime = e;
|
|
|
},
|
|
|
- // 发货时间选择
|
|
|
- selectOutTime(e) {
|
|
|
- console.log(e);
|
|
|
- },
|
|
|
// 保存按钮
|
|
|
save(formName) {
|
|
|
- console.log("save");
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
alert("submit!");
|
|
@@ -447,57 +460,40 @@ export default {
|
|
|
|
|
|
restSearch() {
|
|
|
//重置入参
|
|
|
- this.parmValue = {};
|
|
|
+ this.ruleForm = {};
|
|
|
// this.searchList();
|
|
|
},
|
|
|
|
|
|
- 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 searchList() {
|
|
|
+ async searchList(newStatus) {
|
|
|
this.loading = true;
|
|
|
const res = await asyncRequest.detail({ id: this.id });
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
console.log(res);
|
|
|
let {
|
|
|
- bk_code,
|
|
|
- apply_id,
|
|
|
- apply_name,
|
|
|
- good_code,
|
|
|
- good_name,
|
|
|
- good_num,
|
|
|
- good_type_code,
|
|
|
- wsm_code,
|
|
|
- lasttime,
|
|
|
- wsm_name,
|
|
|
- status,
|
|
|
- is_del,
|
|
|
+ bk_code, //备库code
|
|
|
+ apply_name, //申请人
|
|
|
+ good_code, //商品code
|
|
|
+ good_name, //商品名
|
|
|
+ good_num, //备库数量
|
|
|
+ good_type_code, //商品属性code
|
|
|
+ wsm_code, //仓库code
|
|
|
+ lasttime, //最晚入库时间
|
|
|
+ wsm_name, //仓库名
|
|
|
+ status, //当前状态
|
|
|
} = res.data;
|
|
|
+ this.ruleForm = {
|
|
|
+ bk_code, //备库code
|
|
|
+ apply_name, //申请人
|
|
|
+ good_code, //商品code
|
|
|
+ good_name, //商品名
|
|
|
+ good_num, //备库数量
|
|
|
+ good_type_code, //商品属性code
|
|
|
+ wsm_code, //仓库code
|
|
|
+ lasttime, //最晚入库时间
|
|
|
+ wsm_name, //仓库名
|
|
|
+ status: newStatus || status, //当前状态
|
|
|
+ };
|
|
|
+ console.log(this.ruleForm);
|
|
|
// this.tableData = res.data.list;
|
|
|
// this.pageInfo.total = Number(res.data.count);
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
@@ -508,109 +504,29 @@ export default {
|
|
|
}
|
|
|
this.loading = false;
|
|
|
},
|
|
|
-
|
|
|
- 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("取消");
|
|
|
- // });
|
|
|
- },
|
|
|
- async stockName(isShowModal = false) {
|
|
|
- //获取多级仓库名称的方法
|
|
|
- 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", isShowModal);
|
|
|
+ // 选择供应商
|
|
|
+ selectSupplier(e) {
|
|
|
+ console.log(e);
|
|
|
+ console.log(this.ruleForm);
|
|
|
+ if (e && e.id) {
|
|
|
+ this.ruleForm.supplier_code = [e.code];
|
|
|
+ this.companyCode = e.code;
|
|
|
+ } else {
|
|
|
+ this.ruleForm.supplier_code = [];
|
|
|
+ this.companyCode = "";
|
|
|
}
|
|
|
- console.log(this.stock_go);
|
|
|
- console.log(this.stock_in);
|
|
|
- // if(){
|
|
|
-
|
|
|
- // }
|
|
|
- // console.log(this.pageInfo.total);
|
|
|
+ console.log(this.$refs.ruleForm.validateField);
|
|
|
|
|
|
- this.compareStock(); //比较出库仓库和入库仓库是否相同
|
|
|
+ this.$refs.ruleForm.validateField("supplier_code");
|
|
|
},
|
|
|
-
|
|
|
- compareStock() {
|
|
|
- //比较出库仓库和入库仓库是否相同
|
|
|
- if (
|
|
|
- this.stock_go === this.stock_in &&
|
|
|
- this.stock_go !== "" &&
|
|
|
- this.stock_go != ""
|
|
|
- ) {
|
|
|
- console.log("出库仓库和入库仓库相同");
|
|
|
- this.$message({
|
|
|
- message: "出库仓库不能和入库仓库相同",
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
+ // 执行点击商品名称的抛出事件
|
|
|
+ addGoodsRes(e) {
|
|
|
+ console.log(e);
|
|
|
+ let { good_code, good_name, type_code } = e[0];
|
|
|
+ this.ruleForm.goods_name = good_name;
|
|
|
+ this.ruleForm.good_type_code = type_code;
|
|
|
+ this.ruleForm.good_code = good_code;
|
|
|
+ this.$refs.ruleForm.validateField("goods_name");
|
|
|
},
|
|
|
},
|
|
|
};
|