|
@@ -34,15 +34,6 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="申请人" prop="apply_name">
|
|
|
- <el-input
|
|
|
- v-model="ruleForm.apply_name"
|
|
|
- style="width: 100%"
|
|
|
- placeholder="请输入内容"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="入库仓库" prop="wsm_name">
|
|
|
<el-cascader
|
|
@@ -59,48 +50,31 @@
|
|
|
></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"
|
|
|
+ <el-form-item label="最晚入库时间" prop="lasttime">
|
|
|
+ <el-date-picker
|
|
|
style="width: 100%"
|
|
|
- placeholder="请输入内容"
|
|
|
- />
|
|
|
+ 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-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-form-item label="申请人" prop="apply_name">
|
|
|
<el-input
|
|
|
- v-model="ruleForm.bk_code"
|
|
|
+ disabled="true"
|
|
|
+ v-model="ruleForm.apply_name"
|
|
|
style="width: 100%"
|
|
|
placeholder="请输入内容"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="当前状态">
|
|
|
<el-input
|
|
@@ -110,36 +84,45 @@
|
|
|
/>
|
|
|
</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>
|
|
|
+ <!-- v-if="
|
|
|
+ id === 'add' ||
|
|
|
+ (status === '0' && powers.some((item) => item == '005'))
|
|
|
+ " -->
|
|
|
+ <el-col :span="24" style="text-align: right">
|
|
|
+ <el-button type="primary" @click="submitForm">保 存</el-button>
|
|
|
+ <!-- v-if="status === '0' && powers.some((item) => item == '012')"-->
|
|
|
+ <el-button type="primary" @click="statusConfirm('1', '发起审核流程')"
|
|
|
+ >发起审核流程
|
|
|
+ </el-button>
|
|
|
+ <!-- -->
|
|
|
+ <el-button
|
|
|
+ @click="statusConfirm('0', '取消审核流程')"
|
|
|
+ plain
|
|
|
+ v-if="status === '1' && powers.some((item) => item == '014')"
|
|
|
+ >取消审核流程</el-button
|
|
|
+ >
|
|
|
+ <!-- v-if="
|
|
|
+ (status === '0' || status === '1') &&
|
|
|
+ powers.some((item) => item == '015')
|
|
|
+ " -->
|
|
|
+ <el-button
|
|
|
+ @click="statusConfirm('-1', '作废该条信息')"
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ >作废该条信息</el-button
|
|
|
+ >
|
|
|
+ <!-- -->
|
|
|
+ <el-button
|
|
|
+ @click="statusConfirm('2', '通过审核')"
|
|
|
+ type="primary"
|
|
|
+ v-if="status === '1' && powers.some((item) => item == '016')"
|
|
|
+ >通过审核</el-button
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
</el-form>
|
|
|
- <el-divider content-position="center">采购反馈</el-divider>
|
|
|
- <el-form
|
|
|
+ <!-- <el-divider content-position="center">采购反馈</el-divider> -->
|
|
|
+ <!-- <el-form
|
|
|
v-if="ruleForm && ruleForm.status === '1'"
|
|
|
:model="ruleForm"
|
|
|
:rules="ruless"
|
|
@@ -206,7 +189,7 @@
|
|
|
/> </el-form-item
|
|
|
></el-col>
|
|
|
</el-row>
|
|
|
- </el-form>
|
|
|
+ </el-form> -->
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
<no-auth></no-auth>
|
|
@@ -220,7 +203,7 @@ import resToken from "@/mixins/resToken";
|
|
|
// import asyncRequest from "@/apis/service/stock/newApply";
|
|
|
import asyncRequest from "@/apis/service/purchaseIn/storeManageFlow";
|
|
|
import { mapGetters } from "vuex";
|
|
|
-import { isMobile, isAlphanumeric } from "@/utils/validate";
|
|
|
+// import { isMobile, isAlphanumeric } from "@/utils/validate";
|
|
|
export default {
|
|
|
name: "allotFlow",
|
|
|
mixins: [mixinPage, resToken],
|
|
@@ -239,52 +222,32 @@ 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();
|
|
|
- // }
|
|
|
- // }
|
|
|
- // };
|
|
|
return {
|
|
|
companyCode: "", //公司code
|
|
|
id: "", //路由传过来的id
|
|
|
inTime: "",
|
|
|
goTime: "",
|
|
|
ruleForm: {
|
|
|
- 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
|
|
|
+ good_num: "", //商品数量
|
|
|
wsm_code: "", //仓库code
|
|
|
- wsm_name: "", //仓库名
|
|
|
+ lasttime: "", //最晚入库时间
|
|
|
status: "", //当前状态
|
|
|
+
|
|
|
+ // supplier_code: [], //供应商名称
|
|
|
+ // good_name: "", //商品名称
|
|
|
+
|
|
|
+ // stock_in_rule: "", //入库仓库
|
|
|
+ // goods_num_limit: "", //采购数量上限
|
|
|
+ // expect_go_time: "", //预计入库时间
|
|
|
+ // stock_go_rule: "", //出库仓库
|
|
|
+ // remark: "", //备注
|
|
|
+ // bk_code: "", //备库code
|
|
|
+ // apply_name: "", //申请人
|
|
|
+
|
|
|
+ // good_type_code: "", //商品属性code
|
|
|
+
|
|
|
+ // wsm_name: "", //仓库名
|
|
|
},
|
|
|
rules: {
|
|
|
//出入库规则
|
|
@@ -298,7 +261,7 @@ export default {
|
|
|
good_num: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "请选择入库仓库",
|
|
|
+ message: "请输入商品数量",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
@@ -418,48 +381,56 @@ export default {
|
|
|
// 最晚入库时间选择
|
|
|
selectTime(e) {
|
|
|
console.log(e);
|
|
|
- this.ruleForm.goTime = e;
|
|
|
+ // this.ruleForm.goTime = e;
|
|
|
},
|
|
|
- // 保存按钮
|
|
|
- save(formName) {
|
|
|
- this.$refs[formName].validate((valid) => {
|
|
|
+ //保存按钮
|
|
|
+ async submitForm(e) {
|
|
|
+ await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
- alert("submit!");
|
|
|
+ this.loading = true;
|
|
|
+ console.log(this.ruleForm);
|
|
|
+ const { good_code, good_num, wsm_code, lasttime } = this.ruleForm;
|
|
|
+ const model = {
|
|
|
+ good_code,
|
|
|
+ good_num,
|
|
|
+ wsm_code,
|
|
|
+ lastime: lasttime,
|
|
|
+ id: this.id,
|
|
|
+ };
|
|
|
+ console.log(model);
|
|
|
+ let res = {};
|
|
|
+ if (e === "save") {
|
|
|
+ res = await asyncRequest.status({
|
|
|
+ id: this.id,
|
|
|
+ status: "1",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ res = await asyncRequest.update(model);
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ if (res && res.code === 0) {
|
|
|
+ const title = this.id === "add" ? "添加成功" : "修改成功";
|
|
|
+ this.$notify.success({
|
|
|
+ title,
|
|
|
+ message: "",
|
|
|
+ });
|
|
|
+ this.showModel = true;
|
|
|
+ // 刷新
|
|
|
+ this.$emit("closeModel");
|
|
|
+ } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
} else {
|
|
|
console.log("error submit!!");
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
- if (this.ruleForm.goTime < this.ruleForm.send_out_time) {
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: "最晚入库时间不能小于发货时间",
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- submitForm(formName) {
|
|
|
- console.log("sds");
|
|
|
- console.log(formName);
|
|
|
- this.$refs[formName].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- alert("submit!");
|
|
|
- } else {
|
|
|
- console.log("error submit!!");
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- if (this.ruleForm.goTime < this.ruleForm.send_out_time) {
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: "最晚入库时间不能小于发货时间",
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
},
|
|
|
|
|
|
restSearch() {
|
|
|
- // 表格 - 分页
|
|
|
+ // 表格 - 分页
|
|
|
this.pageInfo = {
|
|
|
size: 15,
|
|
|
curr: 1,
|
|
@@ -534,6 +505,76 @@ export default {
|
|
|
this.ruleForm.good_code = good_code;
|
|
|
this.$refs.ruleForm.validateField("goods_name");
|
|
|
},
|
|
|
+
|
|
|
+ // 提交
|
|
|
+ async submitForm() {
|
|
|
+ await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ console.log(this.ruleForm);
|
|
|
+ const { good_code, good_num, wsm_code, lasttime } = this.ruleForm;
|
|
|
+ const model = {
|
|
|
+ good_code,
|
|
|
+ good_num,
|
|
|
+ wsm_code,
|
|
|
+ lastime: lasttime,
|
|
|
+ id: this.id,
|
|
|
+ };
|
|
|
+ // console.log(model);
|
|
|
+
|
|
|
+ this.loading = true;
|
|
|
+ let res = {};
|
|
|
+ // console.log(this.id);
|
|
|
+ if (this.id === "add") {
|
|
|
+ delete model["id"];
|
|
|
+ res = await asyncRequest.add(model);
|
|
|
+ } else {
|
|
|
+ res = await asyncRequest.update(model);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.loading = false;
|
|
|
+ if (res && res.code === 0) {
|
|
|
+ const title = this.id === "add" ? "添加成功!" : "修改成功!";
|
|
|
+ this.$notify.success({
|
|
|
+ title,
|
|
|
+ message: "",
|
|
|
+ });
|
|
|
+
|
|
|
+ if (this.id === "add") {
|
|
|
+ this.showModelThis = false;
|
|
|
+ this.$emit("refresh", false);
|
|
|
+ } else {
|
|
|
+ this.initForm();
|
|
|
+ }
|
|
|
+ } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log("error submit!!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 状态
|
|
|
+ async statusConfirm(status, message) {
|
|
|
+ console.log(status, message);
|
|
|
+ await this.$confirm(`确定要${message}?`, {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ if (status === "-1") {
|
|
|
+ await this.deleteById(message);
|
|
|
+ } else {
|
|
|
+ await this.setStatus(status, message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ console.log("取消");
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|