代码提交

master
taozi 4 months ago
commit 45df7a937c
  1. 2
      src/api/secondOrder/outbound.js
  2. 6
      src/views/materials/expend.vue
  3. 50
      src/views/secondOrder/components/approvalProcessDialog.vue
  4. 121
      src/views/secondOrder/components/outDialog.vue
  5. 2
      src/views/secondOrder/list.vue
  6. 99
      src/views/secondOrder/outbound.vue

@ -50,7 +50,7 @@ export const submit = data => {
// 获取详情 // 获取详情
export const getDetails = params => { export const getDetails = params => {
return request({ return request({
url: '/smartpark/user/getUserByDeptId', url: '/smartpark/twoOutStorage/detail',
method: 'get', method: 'get',
params: params, params: params,

@ -104,7 +104,7 @@ export default {
columnBtn: false, columnBtn: false,
menuAlign: "left", menuAlign: "left",
searchMenuPosition: "right", searchMenuPosition: "right",
menuWidth: 140, menuWidth: 100,
column: [ column: [
{ {
label: "编号", label: "编号",
@ -189,8 +189,8 @@ export default {
prop: "isBorrow", prop: "isBorrow",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
type: "select", type: "select",
dicDta: [ dicData: [
{ {
label: "已借出", label: "已借出",
value: "0", value: "0",

@ -11,49 +11,61 @@
<el-steps class="teps-con" direction="vertical" :active="1"> <el-steps class="teps-con" direction="vertical" :active="1">
<el-step <el-step
v-for="(item, index) in approvalList" v-for="(item, index) in approvalList"
:title="item.name" :title="item.userName"
:description="item.time || ''" :description="item.optTime || ''"
></el-step> ></el-step>
</el-steps> </el-steps>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getDetails } from "@/api/secondOrder/outbound";
export default { export default {
props: { props: {
showDialog: { showDialog: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
rowData: {
type: Object,
default: {},
},
}, },
data() { data() {
return { return {
inDialogVisible: false, inDialogVisible: false,
inDialogTiltle: "审批流程", inDialogTiltle: "审批流程",
approvalList: [ approvalList: [
{ // {
name: "张三", // name: "",
time: "2021-01-01 10:10:10", // time: "2021-01-01 10:10:10",
status: "通过", // status: "",
}, // },
{ // {
name: "张三1", // name: "1",
time: "", // time: "",
status: "待审核", // status: "",
}, // },
{ // {
name: "张三3", // name: "3",
time: "", // time: "",
status: "待审核", // status: "",
}, // },
], ],
}; };
}, },
mounted() { mounted() {
this.inDialogVisible = this.showDialog; this.inDialogVisible = this.showDialog;
this.inInit();
}, },
methods: { methods: {
inInit() {
getDetails({ twoOutStorageId: this.rowData.id }).then((res) => {
console.log(9999, res);
this.approvalList = res.data.result.approveList;
});
},
handleCloseDetail() { handleCloseDetail() {
this.inDialogVisible = false; this.inDialogVisible = false;
this.$emit("closeDialog"); this.$emit("closeDialog");
@ -67,8 +79,8 @@ export default {
font-weight: 600; font-weight: 600;
padding: 18px 0; padding: 18px 0;
} }
.teps-con{ .teps-con {
margin:0 auto 0 margin: 0 auto 0;
} }
// :deep(.el-dialog__body) { // :deep(.el-dialog__body) {
// height: 300px; // height: 300px;

@ -15,7 +15,7 @@
ref="dynamicValidateForm" ref="dynamicValidateForm"
label-width="100px" label-width="100px"
class="demo-dynamic" class="demo-dynamic"
:rules="rules" :rules="dynamicRules"
> >
<div class="form-title">基本信息</div> <div class="form-title">基本信息</div>
<el-row> <el-row>
@ -83,7 +83,9 @@
v-model="sizeForm.ldTwoOutStorage.proposerInfo" v-model="sizeForm.ldTwoOutStorage.proposerInfo"
placeholder="请选择" placeholder="请选择"
style="width: 100%" style="width: 100%"
:disabled="sizeForm.departmentId == ''" :disabled="
sizeForm.departmentId == '' || outDialogType == 'details'
"
clearable clearable
filterable filterable
value-key="userId" value-key="userId"
@ -102,7 +104,7 @@
<el-col :span="12" v-if="outDialogType == 'details'"> <el-col :span="12" v-if="outDialogType == 'details'">
<el-form-item label="填报人"> <el-form-item label="填报人">
<el-input <el-input
v-model="sizeForm.ldTwoOutStorage.submitName" v-model="sizeForm.ldTwoOutStorage.shipperName"
:disabled="outDialogType != 'add'" :disabled="outDialogType != 'add'"
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -114,6 +116,7 @@
size="mini" size="mini"
style="margin-bottom: 18px" style="margin-bottom: 18px"
@click="inTableAdd()" @click="inTableAdd()"
v-if="outDialogType != 'details'"
>新增</el-button >新增</el-button
> >
<el-table <el-table
@ -157,44 +160,35 @@
:min="1" :min="1"
style="width: 100%" style="width: 100%"
:disabled="outDialogType != 'add'" :disabled="outDialogType != 'add'"
@change="(newValue) => handleQuantityChange(newValue, scope.$index)"
></el-input-number> ></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="form-title">出库账目表格</div> <div class="form-title" v-if="outDialogType != 'details'">
出库账目表格
</div>
<el-table <el-table
:data="sizeForm.inAccountsTableData" :data="sizeForm.inAccountsTableData"
border border
style="width: 100%" style="width: 100%"
v-if="outDialogType != 'details'"
> >
<el-table-column prop="date" label="当前库存"> <el-table-column prop="date" label="当前库存">
<el-table-column prop="str1" label="编码"> </el-table-column> <el-table-column prop="materialCode" label="编码">
<el-table-column prop="str2" label="名称"> </el-table-column>
<template slot-scope="scope"> <el-table-column prop="materialName" label="名称">
<el-select
v-model="sizeForm.type"
placeholder="请选择"
style="width: 100%"
:disabled="outDialogType != 'add'"
>
<el-option label="办公室物资" value="1"></el-option>
<el-option label="其他物资" value="2"></el-option>
</el-select>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="str3" label="规格"> </el-table-column> <el-table-column prop="model" label="规格"> </el-table-column>
<el-table-column prop="str4" label="类别"> </el-table-column> <el-table-column prop="type" label="类别"> </el-table-column>
<el-table-column prop="str5" label="单位"> </el-table-column> <el-table-column prop="unit" label="单位"> </el-table-column>
<el-table-column prop="str6" label="数量"> </el-table-column> <el-table-column prop="oldNum" label="数量"> </el-table-column>
<el-table-column prop="num" label="单价"> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="date" label="出库信息"> <el-table-column prop="date" label="出库信息">
<el-table-column prop="str8" label="数量"> </el-table-column> <el-table-column prop="num" label="数量"> </el-table-column>
<el-table-column prop="str9" label="单价"> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="date" label="出库后库存"> <el-table-column prop="date" label="出库后库存">
<el-table-column prop="str10" label="数量"> </el-table-column> <el-table-column prop="newNum" label="数量"> </el-table-column>
<el-table-column prop="str11" label="单价"> </el-table-column>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form> </el-form>
@ -202,7 +196,12 @@
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="handleCloseDetail()"> </el-button> <el-button @click="handleCloseDetail()"> </el-button>
<el-button type="primary" @click="sumbit()"> </el-button> <el-button
v-if="outDialogType != 'details'"
type="primary"
@click="sumbit()"
> </el-button
>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -213,6 +212,7 @@ import {
getUserList, getUserList,
getMaterialList, getMaterialList,
submit, submit,
getDetails,
} from "@/api/secondOrder/outbound"; } from "@/api/secondOrder/outbound";
export default { export default {
props: { props: {
@ -232,6 +232,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
rowData: {
type: Object,
default: {},
},
}, },
computed: { computed: {
outDateInfo() { outDateInfo() {
@ -242,6 +246,18 @@ export default {
return `${year}${month}${day}`; return `${year}${month}${day}`;
}, },
}, },
watch: {
outDialogType: {
immediate: true,
handler(newVal) {
if (newVal === "details") {
this.dynamicRules = {}; //
} else {
this.dynamicRules = this.rules; //
}
},
},
},
data() { data() {
return { return {
outDialogVisible: false, outDialogVisible: false,
@ -305,6 +321,7 @@ export default {
materials: [], // materials: [], //
userOptions: [], // userOptions: [], //
departmentOptions: [], // departmentOptions: [], //
dynamicRules: {}, //
}; };
}, },
mounted() { mounted() {
@ -318,6 +335,24 @@ export default {
this.getDetailedItems(); this.getDetailedItems();
}, },
methods: { methods: {
// inAccountsTableData
summaryTableData() {
this.sizeForm.inAccountsTableData = JSON.parse(JSON.stringify(this.sizeForm.ldTwoOutStorageDetailList))
},
handleQuantityChange(newValue, index) {
const currentRow = this.sizeForm.ldTwoOutStorageDetailList[index];
if (currentRow.materialCode != '') {
currentRow.oldNum = currentRow.materialitem.num
currentRow.num = currentRow.num
currentRow.newNum = currentRow.materialitem.num - currentRow.num
}
this.$set(this.sizeForm.inAccountsTableData,index,currentRow)
this.sizeForm.inAccountsTableData[index] = currentRow
},
//
updateGlobalTotal() {
let totalAmount = 0;
},
// //
async getMaterialList(value) { async getMaterialList(value) {
getMaterialList({ departmentId: value }).then((res) => { getMaterialList({ departmentId: value }).then((res) => {
@ -326,6 +361,7 @@ export default {
}, },
// //
handleMaterialChange(row, index) { handleMaterialChange(row, index) {
console.log(99999,row)
this.sizeForm.ldTwoOutStorageDetailList[index].materialId = this.sizeForm.ldTwoOutStorageDetailList[index].materialId =
row.materialId; row.materialId;
this.sizeForm.ldTwoOutStorageDetailList[index].model = row.model; this.sizeForm.ldTwoOutStorageDetailList[index].model = row.model;
@ -335,11 +371,20 @@ export default {
row.materialName; row.materialName;
this.sizeForm.ldTwoOutStorageDetailList[index].type = row.type; this.sizeForm.ldTwoOutStorageDetailList[index].type = row.type;
this.sizeForm.ldTwoOutStorageDetailList[index].unit = row.unit; this.sizeForm.ldTwoOutStorageDetailList[index].unit = row.unit;
}, },
// //
getUserList(value) { getUserList(value) {
getUserList({ departmentId: value }).then((res) => { getUserList({ departmentId: value }).then((res) => {
this.userOptions = res.data.result; this.userOptions = res.data.result;
if (this.outDialogType != "add") {
let userArr = this.userOptions.filter(
(item) => item.userId == this.sizeForm.ldTwoOutStorage.proposerId
);
this.sizeForm.ldTwoOutStorage.proposerInfo =
userArr.length > 0 ? userArr[0] : {};
}
}); });
}, },
// //
@ -358,7 +403,7 @@ export default {
}, },
// //
proposerChange(value) { proposerChange(value) {
console.log('领用人',value); console.log("领用人", value);
this.sizeForm.ldTwoOutStorage.proposerId = value.userId; this.sizeForm.ldTwoOutStorage.proposerId = value.userId;
this.sizeForm.ldTwoOutStorage.proposerName = value.name; this.sizeForm.ldTwoOutStorage.proposerName = value.name;
}, },
@ -366,7 +411,24 @@ export default {
this.outDialogVisible = false; this.outDialogVisible = false;
this.$emit("handleCloseDetail"); this.$emit("handleCloseDetail");
}, },
inInit() {}, inInit() {
if (this.outDialogType != "add") {
getDetails({ twoOutStorageId: this.rowData.id }).then((res) => {
this.sizeForm = res.data.result;
this.getUserList(this.sizeForm.ldTwoOutStorage.departmentId);
let departmentArr = this.departmentOptions.filter(
(item) =>
item.departmentId == this.sizeForm.ldTwoOutStorage.departmentId
);
this.sizeForm.ldTwoOutStorage.departmentInfo =
departmentArr.length > 0 ? departmentArr[0] : {};
// this.sizeForm.ldTwoOutStorage.proposerInfo={}
});
}
},
addInit() { addInit() {
const now = new Date(); const now = new Date();
@ -382,6 +444,7 @@ export default {
// //
inTableAdd() { inTableAdd() {
this.sizeForm.ldTwoOutStorageDetailList.push({}); this.sizeForm.ldTwoOutStorageDetailList.push({});
this.summaryTableData()
}, },
// //
sumbit() { sumbit() {

@ -78,7 +78,7 @@ export default {
columnBtn: false, columnBtn: false,
menuAlign: "left", menuAlign: "left",
searchMenuPosition: "right", searchMenuPosition: "right",
menuWidth: 100, menuWidth: 80,
column: [ column: [
{ {
label: "部门", label: "部门",

@ -8,8 +8,12 @@
</el-button> </el-button>
</template> </template>
<template #menu="scope"> <template #menu="scope">
<el-button type="text" @click.stop="approvalProcessFn(scope.row)">审批流程</el-button> <el-button type="text" @click.stop="approvalProcessFn(scope.row)"
<el-button type="text" @click.stop="handleDetails(scope.row)">详情</el-button> >审批流程</el-button
>
<el-button type="text" @click.stop="handleDetails(scope.row)"
>详情</el-button
>
</template> </template>
<template slot-scope="scope" slot="xuqiudanmingcheng"> <template slot-scope="scope" slot="xuqiudanmingcheng">
<el-button type="text" @click.stop="purchaseFn(scope.row)" v-if="scope.row.xuqiudanmingcheng != ''">{{ <el-button type="text" @click.stop="purchaseFn(scope.row)" v-if="scope.row.xuqiudanmingcheng != ''">{{
@ -18,8 +22,15 @@
</template> </template>
</avue-crud> </avue-crud>
<outDialog v-if="outDialogVisible" :repairVisible="outDialogVisible" :outDialogTiltle="outDialogTiltle" <outDialog
:outDialogType="outDialogType" @handleCloseDetail="handleCloseDetail" type="二级库"> v-if="outDialogVisible"
:repairVisible="outDialogVisible"
:outDialogTiltle="outDialogTiltle"
:outDialogType="outDialogType"
:rowData="rowData"
@handleCloseDetail="handleCloseDetail"
type="二级库"
>
</outDialog> </outDialog>
<!-- 需求单明细 --> <!-- 需求单明细 -->
@ -28,8 +39,12 @@
</needDialog> </needDialog>
<!-- 审批流程 --> <!-- 审批流程 -->
<approvalProcessDialog :showDialog="approvalProcessShow" v-if="approvalProcessShow" @closeDialog="closeDialog"> <approvalProcessDialog
</approvalProcessDialog> :showDialog="approvalProcessShow"
v-if="approvalProcessShow"
:rowData="rowData"
@closeDialog="closeDialog"
></approvalProcessDialog>
</basic-container> </basic-container>
</template> </template>
@ -43,7 +58,7 @@ export default {
components: { components: {
outDialog, outDialog,
needDialog, needDialog,
approvalProcessDialog approvalProcessDialog,
}, },
data() { data() {
return { return {
@ -91,21 +106,6 @@ export default {
excelBtn: true, excelBtn: true,
menuWidth: 140, menuWidth: 140,
column: [ column: [
// {
// label: "",
// prop: "xuqiudanmingcheng",
// width:180,
// },
{
label: "部门",
prop: "bumen",
headerAlign: "center",
align: "center",
},
// {
// label: "",
// prop: "str1",
// },
{ {
label: "出库单号", label: "出库单号",
prop: "orderNo", prop: "orderNo",
@ -120,13 +120,41 @@ export default {
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
}, },
{
// { label: "事由",
// label: "", prop: "reason",
// prop: "approvers", headerAlign: "center",
// headerAlign: "center", align: "center",
// align: "center", },
// }, {
label: "物资类型",
prop: "materialType",
headerAlign: "center",
align: "center",
type: "select",
dicData: [
{
label: "办公物资",
value: "1",
},
{
label: "其他物资",
value: "2",
},
],
},
{
label: "部门",
prop: "department",
align: "center",
headerAlign: "center",
},
{
label: "出库人",
prop: "shipperName",
headerAlign: "center",
align: "center",
},
{ {
label: "状态", label: "状态",
@ -157,20 +185,22 @@ export default {
outDialogTiltle: "出库", outDialogTiltle: "出库",
outDialogType: "", outDialogType: "",
approvalProcessShow: false, approvalProcessShow: false,
rowData:{},
}; };
}, },
methods: { methods: {
approvalProcessFn(row) { approvalProcessFn(row) {
this.approvalProcessShow = true; this.approvalProcessShow = true;
this.rowData = row
}, },
// //
handleDetails(row) { handleDetails(row) {
this.outDialogVisible = true this.outDialogVisible = true;
this.outDialogType = 'details' this.outDialogType = "details";
this.outDialogTiltle = '详情' this.outDialogTiltle = "详情";
this.id = row.id this.rowData = row
console.log(this.id, 'id')
}, },
purchaseFn(row) { purchaseFn(row) {
this.purchaseOpen = true; this.purchaseOpen = true;
@ -178,6 +208,7 @@ export default {
}, },
closeDialog() { closeDialog() {
this.purchaseOpen = false; this.purchaseOpen = false;
this.approvalProcessShow = false
}, },
handleDesign() { handleDesign() {
this.outDialogVisible = true; this.outDialogVisible = true;

Loading…
Cancel
Save