|
|
@@ -7,36 +7,30 @@
|
|
|
@close="handleCancel"
|
|
|
:maxable="true"
|
|
|
>
|
|
|
- <el-form
|
|
|
- ref="form"
|
|
|
- :model="form"
|
|
|
- :rules="rules"
|
|
|
- label-width="100px"
|
|
|
- class="create-form"
|
|
|
- >
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="90px" class="create-form">
|
|
|
<headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
|
|
|
<el-row :gutter="24">
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
|
|
|
+ <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="编码:" prop="code">
|
|
|
<el-input v-model="form.code" disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
|
|
|
+ <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="工单名称:" prop="name">
|
|
|
<el-input v-model="form.name" disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
|
|
|
+ <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="领用部门:" prop="receivingDeptName">
|
|
|
<el-input v-model="form.receivingDeptName" disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
|
|
|
+ <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="领用人:" prop="recipientName">
|
|
|
<el-input v-model="form.recipientName" disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
|
|
|
+ <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="使用时间:" prop="usageTime">
|
|
|
<el-date-picker
|
|
|
style="width: 100%"
|
|
|
@@ -44,29 +38,28 @@
|
|
|
type="date"
|
|
|
placeholder="选择"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
+ ></el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ <el-col :span="6">
|
|
|
<el-form-item label="使用部门" prop="useDeptName">
|
|
|
<el-input v-model="form.useDeptName" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ <el-col :span="6">
|
|
|
<el-form-item label="使用人" prop="userName">
|
|
|
<el-input v-model="form.userName" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 24, md: 24 } : { span: 16 }">
|
|
|
+ <el-col v-bind="styleResponsive ? { lg: 6, md: 24 } : { span: 6 }">
|
|
|
<el-form-item label="用途:" prop="purpose">
|
|
|
<el-input v-model="form.purpose" type="textarea" :rows="2" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <headerTitle title="备品备件信息" style="margin-top: 15px"></headerTitle>
|
|
|
+ <headerTitle title="配件信息" style="margin-top: 15px"></headerTitle>
|
|
|
|
|
|
<ele-pro-table
|
|
|
ref="table"
|
|
|
@@ -103,15 +96,9 @@
|
|
|
/>
|
|
|
</template>
|
|
|
<template v-slot:action="{ row }">
|
|
|
- <el-popconfirm
|
|
|
- class="ele-action"
|
|
|
- title="确定要删除吗?"
|
|
|
- @confirm="del(row.id)"
|
|
|
- >
|
|
|
+ <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="del(row.id)">
|
|
|
<template v-slot:reference>
|
|
|
- <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
- 删除
|
|
|
- </el-link>
|
|
|
+ <el-link type="danger" :underline="false" icon="el-icon-delete">删除</el-link>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
</template>
|
|
|
@@ -120,247 +107,239 @@
|
|
|
|
|
|
<template v-slot:footer v-if="this.inlet != 1">
|
|
|
<el-button @click="handleCancel">取消</el-button>
|
|
|
- <el-button type="primary" @click="save" :loading="loading">
|
|
|
- 提交
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" @click="save" :loading="loading">提交</el-button>
|
|
|
</template>
|
|
|
- <AssetsDialog
|
|
|
- ref="selectStockLedgerDialogRef"
|
|
|
- :assetType="6"
|
|
|
- @choose="confirmChoose"
|
|
|
- >
|
|
|
- </AssetsDialog>
|
|
|
+ <AssetsDialog ref="selectStockLedgerDialogRef" :assetType="6" @choose="confirmChoose"></AssetsDialog>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {
|
|
|
- saveOrUpdateSalesWorkOrder,
|
|
|
- saveOrUpdateSalesPlan,
|
|
|
- getSalesWorkOrderById
|
|
|
- } from '@/api/salesServiceManagement/index';
|
|
|
- import AssetsDialog from './AssetsDialog.vue';
|
|
|
+import {
|
|
|
+ saveOrUpdateSalesWorkOrder,
|
|
|
+ saveOrUpdateSalesPlan,
|
|
|
+ getSalesWorkOrderById
|
|
|
+} from '@/api/salesServiceManagement/index';
|
|
|
+import AssetsDialog from './AssetsDialog.vue';
|
|
|
|
|
|
- export default {
|
|
|
- components: {
|
|
|
- AssetsDialog
|
|
|
- },
|
|
|
- props: {
|
|
|
- inlet: {
|
|
|
- type: Number,
|
|
|
- default: null
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- visible: false,
|
|
|
- loading: false,
|
|
|
- title: '备品备件申请单',
|
|
|
- type: '',
|
|
|
- executorList: [],
|
|
|
- form: {
|
|
|
- code: '',
|
|
|
- name: '',
|
|
|
- receivingDeptName: '',
|
|
|
- recipientName: '',
|
|
|
- usageTime: '',
|
|
|
- useDeptName: '',
|
|
|
- userName: '',
|
|
|
- purpose: ''
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ AssetsDialog
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ inlet: {
|
|
|
+ type: Number,
|
|
|
+ default: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ loading: false,
|
|
|
+ title: '配件申请单',
|
|
|
+ type: '',
|
|
|
+ executorList: [],
|
|
|
+ form: {
|
|
|
+ code: '',
|
|
|
+ name: '',
|
|
|
+ receivingDeptName: '',
|
|
|
+ recipientName: '',
|
|
|
+ usageTime: '',
|
|
|
+ useDeptName: '',
|
|
|
+ userName: '',
|
|
|
+ purpose: ''
|
|
|
+ },
|
|
|
+ rules: {},
|
|
|
+ tableList: [],
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
},
|
|
|
- rules: {},
|
|
|
- tableList: [],
|
|
|
- columns: [
|
|
|
- {
|
|
|
- columnKey: 'index',
|
|
|
- label: '序号',
|
|
|
- type: 'index',
|
|
|
- width: 55,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'left'
|
|
|
- },
|
|
|
|
|
|
- {
|
|
|
- prop: 'categoryCode',
|
|
|
- label: '物品编码',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'categoryName',
|
|
|
- label: '物品名称',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
+ {
|
|
|
+ prop: 'categoryCode',
|
|
|
+ label: '物品编码',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'categoryName',
|
|
|
+ label: '物品名称',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
|
|
|
- {
|
|
|
- prop: 'categoryModel',
|
|
|
- label: '型号',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'specification',
|
|
|
- label: '规格',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'level',
|
|
|
- label: '级别',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'totalCount',
|
|
|
- label: '数量',
|
|
|
- align: 'center',
|
|
|
- width: 100,
|
|
|
- slot: 'totalCount'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'singlePrice',
|
|
|
- label: '单价',
|
|
|
- align: 'center',
|
|
|
- width: 100,
|
|
|
- slot: 'singlePrice'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'totalPrice',
|
|
|
- label: '总价',
|
|
|
- align: 'center',
|
|
|
- width: 100
|
|
|
- },
|
|
|
+ {
|
|
|
+ prop: 'categoryModel',
|
|
|
+ label: '型号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'specification',
|
|
|
+ label: '规格',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'level',
|
|
|
+ label: '级别',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'totalCount',
|
|
|
+ label: '数量',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ slot: 'totalCount'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'singlePrice',
|
|
|
+ label: '单价',
|
|
|
+ align: 'center',
|
|
|
+ width: 100,
|
|
|
+ slot: 'singlePrice'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'totalPrice',
|
|
|
+ label: '总价',
|
|
|
+ align: 'center',
|
|
|
+ width: 100
|
|
|
+ },
|
|
|
// {
|
|
|
// prop: 'measureQuantity',
|
|
|
// label: '库存',
|
|
|
// align: 'center'
|
|
|
// },
|
|
|
- {
|
|
|
- prop: 'measureUnit',
|
|
|
- label: '计量单位',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'warehouseName',
|
|
|
- label: '仓库',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 140,
|
|
|
- align: 'center',
|
|
|
- resizable: false,
|
|
|
- fixed: 'right',
|
|
|
- slot: 'action',
|
|
|
- showOverflowTooltip: true,
|
|
|
- show: this.inlet != 1
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
- },
|
|
|
+ {
|
|
|
+ prop: 'measureUnit',
|
|
|
+ label: '计量单位',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'warehouseName',
|
|
|
+ label: '仓库',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 140,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ fixed: 'right',
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ show: this.inlet != 1
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
|
|
|
- computed: {
|
|
|
- // 是否开启响应式布局
|
|
|
- styleResponsive() {
|
|
|
- return this.$store.state.theme.styleResponsive;
|
|
|
+ computed: {
|
|
|
+ // 是否开启响应式布局
|
|
|
+ styleResponsive() {
|
|
|
+ return this.$store.state.theme.styleResponsive;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ // 出库数量限制
|
|
|
+ handleInput(row, index) {
|
|
|
+ // if (row.totalCount > row.measureQuantity) {
|
|
|
+ // this.$set(this.tableList[index], 'totalCount', row.measureQuantity);
|
|
|
+ // }
|
|
|
+ if (row.singlePrice == 0) {
|
|
|
+ this.$set(this.tableList[index], 'totalPrice', 0);
|
|
|
+ } else {
|
|
|
+ this.$set(
|
|
|
+ this.tableList[index],
|
|
|
+ 'totalPrice',
|
|
|
+ Number(row.singlePrice) * Number(row.totalCount)
|
|
|
+ );
|
|
|
}
|
|
|
},
|
|
|
- created() {},
|
|
|
- methods: {
|
|
|
- // 出库数量限制
|
|
|
- handleInput(row, index) {
|
|
|
- // if (row.totalCount > row.measureQuantity) {
|
|
|
- // this.$set(this.tableList[index], 'totalCount', row.measureQuantity);
|
|
|
- // }
|
|
|
- if (row.singlePrice == 0) {
|
|
|
- this.$set(this.tableList[index], 'totalPrice', 0);
|
|
|
- } else {
|
|
|
- this.$set(
|
|
|
- this.tableList[index],
|
|
|
- 'totalPrice',
|
|
|
- Number(row.singlePrice) * Number(row.totalCount)
|
|
|
- );
|
|
|
- }
|
|
|
- console.log(row, 'row,', index);
|
|
|
- },
|
|
|
|
|
|
- async open(row, type) {
|
|
|
- console.log(type);
|
|
|
- this.visible = true;
|
|
|
- this.type = type;
|
|
|
+ async open(row, type) {
|
|
|
+ console.log(type);
|
|
|
+ this.visible = true;
|
|
|
+ this.type = type;
|
|
|
|
|
|
- this.getSalesWorkOrderDetail(row);
|
|
|
- },
|
|
|
- async getSalesWorkOrderDetail(row) {
|
|
|
- console.log(row, '申请备品备件列表详情');
|
|
|
- this.form = row || {};
|
|
|
+ this.getSalesWorkOrderDetail(row);
|
|
|
+ },
|
|
|
+ async getSalesWorkOrderDetail(row) {
|
|
|
+ console.log(row, '申请备品备件列表详情');
|
|
|
+ this.form = row || {};
|
|
|
|
|
|
- this.tableList = row.details || [];
|
|
|
- },
|
|
|
- del(id) {
|
|
|
- this.tableList = this.tableList.filter((item) => item.id != id);
|
|
|
- },
|
|
|
- handleCancel() {
|
|
|
- this.tableList = [];
|
|
|
- this.form = {};
|
|
|
- this.visible = false;
|
|
|
- },
|
|
|
- addEquipment() {
|
|
|
- this.$refs.selectStockLedgerDialogRef.open(this.tableList);
|
|
|
- },
|
|
|
- /* 保存编辑 */
|
|
|
- async save() {
|
|
|
- this.loading = true;
|
|
|
+ this.tableList = row.details || [];
|
|
|
+ },
|
|
|
+ del(id) {
|
|
|
+ this.tableList = this.tableList.filter((item) => item.id != id);
|
|
|
+ },
|
|
|
+ handleCancel() {
|
|
|
+ this.tableList = [];
|
|
|
+ this.form = {};
|
|
|
+ this.visible = false;
|
|
|
+ },
|
|
|
+ addEquipment() {
|
|
|
+ this.$refs.selectStockLedgerDialogRef.open(this.tableList);
|
|
|
+ },
|
|
|
+ /* 保存编辑 */
|
|
|
+ async save() {
|
|
|
+ this.loading = true;
|
|
|
|
|
|
- let requestName =
|
|
|
- this.type == 'work'
|
|
|
- ? saveOrUpdateSalesWorkOrder
|
|
|
- : saveOrUpdateSalesPlan;
|
|
|
- const res = await requestName({
|
|
|
- ...this.form,
|
|
|
- details: this.tableList
|
|
|
- });
|
|
|
- console.log(res, 'res');
|
|
|
- this.loading = false;
|
|
|
- if (!res) return;
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '提交成功'
|
|
|
- });
|
|
|
- this.$emit('reload');
|
|
|
- this.handleCancel();
|
|
|
- this.loading = false;
|
|
|
- },
|
|
|
- confirmChoose(data) {
|
|
|
- console.log(data, '选中');
|
|
|
- data.map((item) => {
|
|
|
- item.singlePrice = item.unitPrice;
|
|
|
- delete item.id;
|
|
|
- return {
|
|
|
- ...item
|
|
|
- };
|
|
|
- });
|
|
|
- this.tableList = JSON.parse(JSON.stringify(data));
|
|
|
- }
|
|
|
+ let requestName =
|
|
|
+ this.type == 'work'
|
|
|
+ ? saveOrUpdateSalesWorkOrder
|
|
|
+ : saveOrUpdateSalesPlan;
|
|
|
+ const res = await requestName({
|
|
|
+ ...this.form,
|
|
|
+ details: this.tableList
|
|
|
+ });
|
|
|
+ console.log(res, 'res');
|
|
|
+ this.loading = false;
|
|
|
+ if (!res) return;
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '提交成功'
|
|
|
+ });
|
|
|
+ this.$emit('reload');
|
|
|
+ this.handleCancel();
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
+ confirmChoose(data) {
|
|
|
+ console.log(data, '选中');
|
|
|
+ data.map((item) => {
|
|
|
+ item.singlePrice = item.unitPrice;
|
|
|
+ delete item.id;
|
|
|
+ return {
|
|
|
+ ...item
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.tableList = JSON.parse(JSON.stringify(data));
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
- .basic-details-title {
|
|
|
- margin: 10px 0;
|
|
|
- }
|
|
|
+.basic-details-title {
|
|
|
+ margin: 10px 0;
|
|
|
+}
|
|
|
|
|
|
- .title {
|
|
|
- font-size: 16px;
|
|
|
- line-height: 45px;
|
|
|
- }
|
|
|
+.title {
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 45px;
|
|
|
+}
|
|
|
|
|
|
- .add-product {
|
|
|
- width: 100%;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- // justify-content: flex-end;
|
|
|
- font-size: 30px;
|
|
|
- color: #1890ff;
|
|
|
- margin: 10px 0;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
+.add-product {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ // justify-content: flex-end;
|
|
|
+ font-size: 30px;
|
|
|
+ color: #1890ff;
|
|
|
+ margin: 10px 0;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
</style>
|