Compare commits

...

3 Commits

  1. 1
      src/api/firstOrder/inbound.js
  2. 11
      src/api/materials/expend.js
  3. 11
      src/api/materials/index.js
  4. 2
      src/views/firstOrder/inbound.vue
  5. 69
      src/views/materials/components/returnDialog.vue
  6. 54
      src/views/materials/components/scrapDialog.vue
  7. 14
      src/views/materials/expend.vue
  8. 8
      src/views/materials/index.vue
  9. 12
      src/views/secondOrder/outbound.vue

@ -72,7 +72,6 @@ export const submitData = (sizeForm) => {
})
}
export const editList = (onePutStorageId) => {
console.log('api中的数据',onePutStorageId)
return request({
url: '/smartpark/onePutStorage/detail',
method: 'get',

@ -13,3 +13,14 @@ export const getList = (current, size, params) => {
cryptoData: false
})
}
//归还和报废
export const returnMaterial = (LdDurableFormDto) => {
console.log(LdDurableFormDto,'api传的參')
return request({
url: '/smartpark/durableForm/restoreAndScrap ',
method: 'post',
data: LdDurableFormDto,
cryptoToken: false,
cryptoData: false
})
}

@ -0,0 +1,11 @@
import request from '@/router/axios';
export const upload = (file) => {
return request({
url: '/smartpark/material/upload ',
method: 'post',
data: file,
cryptoToken: false,
cryptoData: false
})
}

@ -135,7 +135,7 @@ export default {
width: 180,
headerAlign: "center",
align: "center",
slot: "purchaseEndInfo"
slot: "purchaseEndInfo",
width: 150,
align: "center",
formatter: (row, column) => {

@ -6,7 +6,7 @@
width="30%"
@close="closeDialog"
>
<avue-form ref="form" :option="option"></avue-form>
<avue-form ref="form" :option="option" v-model="formData"></avue-form>
<template #footer>
<span class="dialog-footer">
@ -17,38 +17,50 @@
</el-dialog>
</template>
<script>
import {returnMaterial} from '@/api/materials/expend'
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
// durableFormId
durableFormId: {
type: Number,
default: 0,
}
},
data() {
const today = new Date();
const defaultDate = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, '0')}-${today.getDate().toString().padStart(2, '0')}`;
return {
purchaseTitle:'归还',
openShow: false,
formData: {
returnReason: '',
returnTime: defaultDate,
},
option: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: "归还数量",
prop: "name",
span: 24,
type: "number",
rules: [
{
required: true,
message: "请输入",
trigger: "blur",
},
],
},
// {
// label: "",
// prop: "name",
// span: 24,
// type: "number",
// hide: true,
// rules: [
// {
// required: true,
// message: "",
// trigger: "blur",
// },
// ],
// },
{
label: "归还理由",
prop: "sex",
prop: "returnReason",
span: 24,
type:'textarea',
rows:5,
@ -62,9 +74,9 @@ export default {
},
{
label: "归还时间",
prop: "sex",
prop: "returnTime",
span: 24,
type:'textarea',
type:'date',
rows:5,
rules: [
{
@ -86,10 +98,25 @@ export default {
this.openShow = false;
this.$emit("closeDialog");
},
submit() {
this.$refs.form.validate((valid) => {
async submit() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.$emit("submit", this.formData);
try {
const params = {
durableFormId: this.durableFormId,
num: 1,
returnTime: this.formData.returnTime,
returnReason: this.formData.returnReason,
type: 1
}
await returnMaterial(params)
this.$message.success('归还成功')
this.closeDialog()
this.$emit('submitSuccess')
this.$refs.form.resetFields()
} catch (error) {
this.$message.error(error.message || '归还失败,请重试')
}
}
});
},

@ -6,7 +6,7 @@
width="30%"
@close="closeDialog"
>
<avue-form ref="form" :option="option"></avue-form>
<avue-form ref="form" :option="option" v-model="formData"></avue-form>
<template #footer>
<span class="dialog-footer">
@ -17,17 +17,26 @@
</el-dialog>
</template>
<script>
import {returnMaterial} from '@/api/materials/expend'
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
durableFormId: {
type: Number,
default: 0,
}
},
data() {
const today = new Date();
const defaultDate = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, '0')}-${today.getDate().toString().padStart(2, '0')}`;
return {
formData: {
returnReason: '',
returnTime: defaultDate,
},
purchaseTitle:'报废',
openShow: false,
option: {
@ -36,20 +45,14 @@ export default {
column: [
{
label: "报废数量",
prop: "name",
prop: "num",
span: 24,
type: "number",
rules: [
{
required: true,
message: "请输入",
trigger: "blur",
},
],
value: 1,
disabled: true,
},
{
label: "报废理由",
prop: "sex",
prop: "returnReason",
span: 24,
type:'textarea',
rows:5,
@ -63,9 +66,9 @@ export default {
},
{
label: "报废时间",
prop: "sex",
prop: "returnTime",
span: 24,
type:'textarea',
type:'date',
rows:5,
rules: [
{
@ -87,10 +90,25 @@ export default {
this.openShow = false;
this.$emit("closeDialog");
},
submit() {
this.$refs.form.validate((valid) => {
async submit() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.$emit("submit", this.formData);
try {
const params = {
durableFormId: this.durableFormId,
num: 1,
returnTime: this.formData.returnTime,
returnReason: this.formData.returnReason,
type: 2
}
await returnMaterial(params)
this.$message.success('报废成功')
this.closeDialog()
this.$emit('submitSuccess')
this.$refs.form.resetFields()
} catch (error) {
this.$message.error(error.message || '报废失败,请重试')
}
}
});
},

@ -43,6 +43,8 @@
:showDialog="returnShow"
:rowDta="returnInfo"
@closeDialog="closeDialog"
:durableFormId="returnInfo.id"
@submitSuccess="handleRefresh"
></returnDialog>
<!-- 报废 -->
<scrapDialog
@ -50,6 +52,8 @@
:showDialog="scrapShow"
:rowDta="scrapInfo"
@closeDialog="closeDialog"
:durableFormId="scrapInfo.id"
@submitSuccess="handleRefresh"
></scrapDialog>
</div>
</template>
@ -280,10 +284,9 @@ export default {
page.pageSize,
Object.assign(params, this.query)
).then((res) => {
this.data = res.data.result.list;
this.loading = false;
this.page.total = res.data.result.total;
});
this.data = res.data.result.list
this.page.total = res.data.result.total
})
this.loading = false;
},
//
@ -297,6 +300,9 @@ export default {
this.scrapShow = true;
this.scrapInfo = JSON.parse(JSON.stringify(row));
},
handleRefresh() {
this.onLoad(this.page, this.query);
},
},
};
</script>

@ -10,10 +10,10 @@
</template>
<script>
import { getList, add, remove, update, getCode } from "@/api/materials/list";
import { upload } from "@/api/materials/index";
export default {
data() {
return {
form: { imageUrl: "" },
selectionList: [],
query: {},
loading: true,
@ -95,6 +95,7 @@ export default {
return value;
}
},
{
label: '图片',
prop: 'picture',
@ -103,6 +104,7 @@ export default {
align: "center",
loadText: "图片上传中,请稍等",
span: 12,
action: process.env.VUE_APP_BASE_API + '/materials/upload', //
// propsHttp: { //
// url: 'picture', //
// name: 'name', //
@ -120,6 +122,10 @@ export default {
return "无"
}
return value;
},
onSuccess: (res, file, fileList) => {
//
this.form.picture = res.data;
}
},
],

@ -165,16 +165,16 @@ export default {
align: "center",
dicData: [
{
label: "未出库",
value: 0,
label: "待审批",
value: 2,
},
{
label: "已出库",
value: 1,
label: "已审批",
value: 3,
},
{
label: "已驳回",
value: 2,
label: "审批失败",
value: 4,
},
],
},

Loading…
Cancel
Save