| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708 |
- <template>
- <div id="assetInformation" class="baseinfo-container">
- <el-form label-width="120px" :model="{ ...zcInfo }" ref="form">
- <div class="content">
- <div class="basic-details-title border-none">
- <span class="border-span">资产信息</span>
- </div>
- <el-descriptions
- title=""
- :column="4"
- size="medium"
- border
- style="edit"
- :label-style="labelStyle"
- class="descriptions"
- >
- <el-descriptions-item>
- <template slot="label"> 固资编码 </template>
- <el-form-item label-width="0">
- <el-input class="input" v-model="zcInfo.fixCode"></el-input>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 编号 </template>
- <el-form-item label-width="0">
- <el-input class="input" v-model="zcInfo.codeNumber"></el-input>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 颜色 </template>
- <el-form-item label-width="0">
- <el-input class="input" v-model="zcInfo.color"></el-input>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 级别 </template>
- <el-form-item label-width="0">
- <el-select
- style="width: 100%"
- v-model="zcInfo.level"
- placeholder="请选择"
- >
- <el-option
- v-for="item in options.assetLevel"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 有效期开始 </template>
- <el-form-item label-width="0">
- <el-date-picker
- style="width: 100%"
- v-model="zcInfo.startTime"
- type="month"
- value-format="yyyy-MM"
- placeholder="选择有效期开始"
- >
- </el-date-picker>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 有效期结束 </template>
- <el-form-item label-width="0">
- <el-date-picker
- style="width: 100%"
- v-model="zcInfo.endTime"
- @change="endTimeRules"
- value-format="yyyy-MM"
- type="month"
- placeholder="选择有效期结束"
- >
- </el-date-picker>
- </el-form-item>
- </el-descriptions-item>
- <!-- <el-descriptions-item>
- <template slot="label"> 状态 </template>
- <el-form-item label-width="0">
- <el-input
- v-model="zcInfo.status"
- placeholder="请输入状态"
- ></el-input>
- </el-form-item>
- </el-descriptions-item> -->
- <el-descriptions-item>
- <template slot="label"> 入账日期 </template>
- <el-form-item label-width="0">
- <el-date-picker
- style="width: 100%"
- v-model="zcInfo.entryDate"
- type="date"
- placeholder="选择入账日期"
- value-format="yyyy-MM-dd"
- >
- </el-date-picker>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 周期 </template>
- <el-form-item label-width="0">
- <el-select
- style="width: 100%"
- v-model="zcInfo.cycle"
- placeholder="请选择"
- >
- <el-option
- v-for="item in options.deliveryCycle"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- </el-descriptions>
- <el-descriptions
- title=""
- :column="3"
- size="medium"
- border
- style="edit"
- :label-style="labelStyle"
- class="descriptions"
- >
- <el-descriptions-item>
- <template slot="label"> 权属部门 </template>
- <el-form-item label-width="0">
- <div class="input">
- <!-- <el-input
- v-model="zcInfo.workstation.groupName"
- disabled
- placeholder="请输入内容"
- ></el-input> -->
- <DeptSelect
- v-model="zcInfo.ownershipGroupId"
- @input="getqsbm"
- />
- </div>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 权属人 </template>
- <el-form-item label-width="0">
- <!-- <el-input
- v-model="zcInfo.workstation.leaderName"
- disabled
- placeholder="请输入内容"
- ></el-input> -->
- <el-select
- style="width: 100%"
- v-model="zcInfo.ownershipUserId"
- placeholder="请选择"
- >
- <el-option
- v-for="item in options.ownershipUserId"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item :span="3">
- <template slot="label"> 所属厂房 </template>
- <el-form-item label-width="0">
- <el-input
- style="margin-right: 10px; width: 20%"
- v-model="zcInfo.workstation.workshopPlanName"
- disabled
- placeholder="请输入内容"
- ></el-input>
- <el-input
- style="margin-right: 10px; width: 20%"
- v-model="zcInfo.workstation.workshopName"
- disabled
- placeholder="请输入内容"
- ></el-input>
- <el-input
- style="margin-right: 10px; width: 20%"
- v-model="zcInfo.workstation.productionLineName"
- disabled
- placeholder="请输入内容"
- ></el-input>
- <el-input
- style="margin-right: 10px; width: 20%"
- v-model="zcInfo.workstation.name"
- disabled
- placeholder="请输入内容"
- ></el-input>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 所属工序 </template>
- <el-form-item label-width="0">
- <el-input
- v-model="zcInfo.workstation.taskNames"
- disabled
- placeholder="请输入内容"
- ></el-input>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 设备位置 </template>
- <el-form-item label-width="0" prop="location">
- <div style="display: flex">
- <el-cascader
- clearable
- v-model="zcInfo.location"
- :options="options.cityDataLabel"
- ></el-cascader>
- <el-input
- style="width: 60%; margin-left: 10px"
- placeholder="详细地址"
- v-model="zcInfo.detailPosition"
- ></el-input>
- </div>
- </el-form-item>
- </el-descriptions-item>
- </el-descriptions>
- <el-descriptions
- title=""
- :column="5"
- size="medium"
- border
- style="edit"
- :label-style="labelStyle"
- class="descriptions"
- >
- <el-descriptions-item>
- <template slot="label"> 维护部门 </template>
- <el-form-item label-width="0">
- <div class="input">
- <DeptSelect v-model="zcInfo.repairGroupId" @input="getwhbm" />
- </div>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 维护人 </template>
- <el-form-item label-width="0">
- <el-select
- style="width: 100%"
- v-model="zcInfo.repairUserId"
- placeholder="请选择"
- >
- <el-option
- v-for="item in options.repairUserId"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- </el-descriptions>
- <el-descriptions
- title=""
- :column="5"
- size="medium"
- border
- style="edit"
- :label-style="labelStyle"
- class="descriptions"
- >
- <el-descriptions-item>
- <template slot="label"> 类型 </template>
- <el-form-item label-width="0">
- <el-select
- style="width: 100%"
- v-model="zcInfo.isPublic"
- filterable
- placeholder="请选择类型"
- >
- <el-option
- v-for="item in typeOptions"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 使用岗位 </template>
- <el-form-item label-width="0">
- <DeptSelect v-model="zcInfo.postId" @input="auditorDeptClick" />
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 使用人 </template>
- <el-form-item label-width="0">
- <el-select
- style="width: 100%"
- v-model="zcInfo.usePersonId"
- filterable
- placeholder="请选择使用人"
- >
- <el-option
- v-for="item in userList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 负责人 </template>
- <el-form-item label-width="0">
- <el-select
- style="width: 100%"
- v-model="zcInfo.chargePersonId"
- filterable
- placeholder="请选择负责人"
- >
- <el-option
- v-for="item in userList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- </el-descriptions>
- <el-descriptions
- title=""
- :column="3"
- size="medium"
- border
- style="edit"
- :label-style="labelStyle"
- >
- <el-descriptions-item>
- <template slot="label"> 供应商 </template>
- <el-form-item label-width="0">
- <el-select
- v-model="zcInfo.supplierId"
- style="width: 100%"
- placeholder="请选择"
- >
- <el-option
- v-for="item in options.suppList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 品牌 </template>
- <el-form-item label-width="0">
- <el-input v-model="zcInfo.brand" class="input"></el-input>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 设备用途 </template>
- <el-form-item label-width="0">
- <el-input v-model="zcInfo.purpose" class="input"></el-input>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label"> 备注 </template>
- <el-form-item label-width="0">
- <el-input
- type="textarea"
- :rows="2"
- placeholder="请输入内容"
- v-model="zcInfo.remark"
- ></el-input>
- </el-form-item>
- </el-descriptions-item>
- </el-descriptions>
- </div>
- </el-form>
- </div>
- </template>
- <script>
- import DeptSelect from '@/components/CommomSelect/dept-select.vue';
- import WorkshopSelect from '@/components/CommomSelect/workshop-select.vue';
- import FactoryAreaSelect from '@/components/CommomSelect/factory-area-select.vue';
- import WorkingProcedureSelect from '@/components/CommomSelect/working-procedure-select.vue';
- import factorySelect from '@/components/CommomSelect/factory-select.vue';
- import fileUpload from '@/components/upload/fileUpload';
- import WithView from '@/components/upload/WithView';
- import imgUpload from '@/components/upload/imgUpload';
- import { cityDataLabel } from 'ele-admin/packages/utils/regions';
- import personSelect from '@/components/CommomSelect/person-select.vue';
- import { saveOrEdit, getAssetInfo } from '@/api/ledgerAssets';
- import { getUserPage } from '@/api/system/organization';
- import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
- import { getByCode } from '@/api/system/dictionary-data';
- export default {
- components: {
- WithView,
- WorkshopSelect,
- FactoryAreaSelect,
- WorkingProcedureSelect,
- fileUpload,
- imgUpload,
- factorySelect,
- DeptSelect,
- personSelect
- },
- props: {
- isEdit: {
- type: Boolean,
- default: true
- }
- },
- data() {
- return {
- userList: [], // 人员列表
- labelStyle: {
- 'min-width': '100px'
- },
- pageType: 'add',
- id: '', // 设备主键id
- rules: {
- name: [
- { required: true, message: '请输入设备名称', trigger: 'blur' }
- ],
- code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }]
- },
- typeOptions: [
- {
- id: 0,
- name: '专用'
- },
- {
- id: 1,
- name: '公用'
- }
- ],
- // 资产信息
- // zcInfo: {
- // // 固定资产编码
- // fixCode: '',
- // // 颜色
- // color: '',
- // // 重量
- // weight: '',
- // // 维护部门
- // repairGroupId: '',
- // repairUserId: '',
- // // 设备用途
- // purpose: '',
- // // 设备位置
- // location: '',
- // //品牌
- // brand: '',
- // // 供应商code
- // supplierId: '',
- // // 编号
- // codeNumber: '',
- // // 使用人
- // usePersonId: '',
- // // 有效期开始
- // startTime: '',
- // // 有效结束
- // endTime: '',
- // // 级别
- // level: '',
- // // 状态
- // status: '',
- // // 负责人
- // chargePersonId: '',
- // // 入账日期
- // entryDate: '',
- // // 周期
- // cycle: '',
- // // 备注
- // remark: '',
- // // 使用岗位
- // postId: ''
- // },
- options: {
- ownershipUserId: [], // 权属人
- repairUserId: [], // 维护人
- supplierId: [], // 供应商
- cityDataLabel, // 设备位置
- assetLevel: [], // 资产级别
- deliveryCycle: [], // 送检周期
- suppList: [] // 供应商
- },
- zcInfo: {
- workstation: {}
- }
- };
- },
- props: {
- form: {
- type: Object,
- default: {
- workstation: {}
- }
- }
- },
- watch: {
- form: {
- //监听的对象
- deep: true, //深度监听设置为 true
- handler: function (newValue) {
- console.log(newValue.isPublic);
- this.zcInfo = newValue;
- }
- }
- },
- async mounted() {
- // 获取资产级别下拉框
- await this.getAssetLevelOptions();
- // 获取送检周期下拉
- await this.getDeliveryCycleOptions();
- // 获取供应商下拉列表
- await this.getSuppliersList();
- // 初始化数据
- setTimeout(() => {
- this.initData();
- }, 500);
- },
- methods: {
- // 限制结束时间
- endTimeRules() {
- if (this.zcInfo.startTime) {
- console.log(this.zcInfo.startTime);
- console.log(new Date(this.zcInfo.startTime).getTime());
- let differenceTime =
- new Date(this.zcInfo.endTime).getTime() -
- new Date(this.zcInfo.startTime).getTime();
- if (differenceTime <= 0) {
- this.$message.error('请选择正确的有效结束时间');
- this.zcInfo.endTime = '';
- }
- } else {
- this.$message.error('请选择有效开始时间');
- this.zcInfo.endTime = '';
- }
- },
- // 获取资产级别下拉
- async getAssetLevelOptions() {
- let { data } = await getByCode('asset_level');
- this.options.assetLevel =
- data.length > 0
- ? data.map((item) => {
- return {
- name: Object.keys(item)[0],
- id: item[Object.keys(item)[0]]
- };
- })
- : [];
- },
- // 获取送检周期下拉
- async getDeliveryCycleOptions() {
- let { data } = await getByCode('delivery_cycle');
- console.log(data);
- this.options.deliveryCycle =
- data.length > 0
- ? data.map((item) => {
- return {
- name: item[Object.keys(item)[0]],
- id: +Object.keys(item)[0]
- };
- })
- : [];
- },
- // 获取维护人下拉列表
- async geMaintainersList() {
- if (!this.zcInfo.repairGroupId) return;
- let data = await getUserPage({
- pageNum: 1,
- size: 9999,
- groupId: this.zcInfo.repairGroupId
- });
- this.options.repairUserId = data.list;
- },
- // 使用岗位点击事件
- async auditorDeptClick(data) {
- this.zcInfo.chargePersonId = '';
- this.zcInfo.usePersonId = '';
- this.userList = [];
- if (data) {
- this.getStaffList(data);
- }
- },
- // 获取供应商下拉列表
- async getSuppliersList() {
- const rep = await warehouseDefinition.eomContact({
- type: 2,
- status: 1,
- size: -1,
- pageNum: 1
- });
- this.options.suppList = rep.list;
- },
- // 通过部门岗位获取人员列表
- async getStaffList(id) {
- let res = await warehouseDefinition.getUserPage({
- groupId: id,
- size: 9999,
- page: 1
- });
- this.userList = res.list;
- },
- // 权属部门
- async getqsbm() {
- if (!this.zcInfo.ownershipGroupId) return;
- let data = await getUserPage({
- pageNum: 1,
- size: 9999,
- groupId: this.zcInfo.ownershipGroupId
- });
- this.options.ownershipUserId = data.list;
- },
- // 维护部门
- async getwhbm() {
- if (!this.zcInfo.repairGroupId) return;
- let data = await getUserPage({
- pageNum: 1,
- size: 9999,
- groupId: this.zcInfo.repairGroupId
- });
- this.options.repairUserId = data.list;
- },
- // 初始化
- async initData() {
- console.log('this.zcInfo---------------------', this.zcInfo);
- // 填充使用岗位
- this.zcInfo.postId && this.auditorDeptClick(this.zcInfo.postId);
- this.geMaintainersList();
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .descriptions {
- margin-bottom: 10px;
- }
- .baseinfo-container .basic-details-title {
- font-size: 16px;
- margin: 15px 0;
- }
- .upload-container {
- display: flex;
- justify-content: flex-start;
- .file-list {
- margin-left: 50px;
- flex: 1;
- }
- }
- .equipment-container {
- // .content {
- // padding: 0 20px;
- // }
- .label-none {
- .el-form-item__content {
- margin-left: 0 !important;
- }
- }
- }
- .sbwz {
- .item {
- width: 120px !important;
- }
- .item + .item {
- margin-left: 10px;
- }
- .item-input {
- width: 350px !important;
- }
- }
- .input {
- width: 100%;
- }
- .kzzd {
- width: 500px;
- .add-col {
- display: flex;
- .col-input {
- & + .col-input {
- margin-left: 10px;
- }
- }
- .del {
- margin-left: 10px;
- }
- }
- }
- ::v-deep .el-descriptions {
- .el-form-item {
- margin-bottom: 0px;
- }
- }
- </style>
|