|
@@ -13,7 +13,10 @@
|
|
|
<el-form-item label="盘点公司" prop="wsm_supplier">
|
|
|
<search-supplier
|
|
|
:value="ruleForm.wsm_supplier"
|
|
|
+ :disabled="status !== '0'"
|
|
|
+ :isDetail="id !== 'add'"
|
|
|
:placeholder="'请选择盘点公司'"
|
|
|
+ :names="companyName"
|
|
|
@searchChange="supplierChange"
|
|
|
/>
|
|
|
</el-form-item>
|
|
@@ -23,6 +26,7 @@
|
|
|
<search-stock
|
|
|
:value="ruleForm.wsm_code"
|
|
|
:isDetail="true"
|
|
|
+ :disabled="status !== '0'"
|
|
|
:placeholder="'请选择盘点仓库'"
|
|
|
:isRelation="true"
|
|
|
:companyCode="companyCode"
|
|
@@ -36,6 +40,7 @@
|
|
|
<el-select
|
|
|
v-model="ruleForm.type"
|
|
|
placeholder="请选择盘点类型"
|
|
|
+ :disabled="status !== '0'"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<el-option
|
|
@@ -49,9 +54,26 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24" style="text-align: right">
|
|
|
- <el-button type="primary" @click="submitForm" v-if="!isDetail"
|
|
|
+ <el-button
|
|
|
+ @click="deleteById()"
|
|
|
+ plain
|
|
|
+ v-if="status !== '4'"
|
|
|
+ type="danger"
|
|
|
+ >作废盘点申请
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="status === '1'"
|
|
|
+ plain
|
|
|
+ @click="submitForm"
|
|
|
+ >取消流程
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" @click="submitForm" v-if="status === '0'"
|
|
|
>保 存
|
|
|
</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm" v-if="status === '0'"
|
|
|
+ >保存并发起流程
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
@@ -63,7 +85,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import asyncRequest from "@/apis/service/stock/check";
|
|
|
+import asyncRequest from "@/apis/service/stock/check/detail";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
import columns from "./columns";
|
|
|
export default {
|
|
@@ -72,7 +94,9 @@ export default {
|
|
|
mixins: [resToken],
|
|
|
data() {
|
|
|
return {
|
|
|
+ status: "0",
|
|
|
companyCode: "",
|
|
|
+ companyName: "",
|
|
|
loading: false,
|
|
|
showGoodsModel: false,
|
|
|
typeList: [
|
|
@@ -125,7 +149,7 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
id: function (val) {
|
|
|
- console.log(val);
|
|
|
+ // console.log(val);
|
|
|
if (val) {
|
|
|
this.initForm();
|
|
|
}
|
|
@@ -157,13 +181,36 @@ export default {
|
|
|
}
|
|
|
this.$refs.ruleForm.validateField("wsm_code");
|
|
|
},
|
|
|
- deleteById(index) {
|
|
|
- this.ruleForm.good_type_code.splice(index, 1);
|
|
|
- this.$refs.ruleForm.validateField("good_type_code");
|
|
|
+ async deleteById() {
|
|
|
+ await this.$confirm("确定要作废?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ const model = {
|
|
|
+ id: this.id,
|
|
|
+ };
|
|
|
+ const res = await asyncRequest.delete(model);
|
|
|
+ if (res && res.code === 0) {
|
|
|
+ this.$notify.success({
|
|
|
+ title: "作废成功!",
|
|
|
+ message: "",
|
|
|
+ });
|
|
|
+ } 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;
|
|
|
if (this.id === "add") {
|
|
|
+ this.status = "";
|
|
|
this.rulesThis = this.rules;
|
|
|
await this.resetForm();
|
|
|
} else {
|
|
@@ -176,8 +223,15 @@ export default {
|
|
|
async initData() {
|
|
|
const res = await asyncRequest.detail({ id: this.id });
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
- this.ruleForm = res.data;
|
|
|
- this.ruleForm.role_id = this.ruleForm.role;
|
|
|
+ const { status, type, wsm_code } = res.data;
|
|
|
+ this.status = status;
|
|
|
+ this.companyCode = "GYS-20210517-0009";
|
|
|
+ this.companyName = "北京长跃科技发展有限公司";
|
|
|
+ this.ruleForm = {
|
|
|
+ wsm_code: [wsm_code],
|
|
|
+ type: type,
|
|
|
+ wsm_supplier: [this.companyCode],
|
|
|
+ };
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
await this.logout();
|
|
|
} else {
|