| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602 |
- <template>
- <div>
- <el-form ref="form" :model="form" label-width="120px">
- <div v-if="form.outputDetailList?.length > 0">
- <div class="title" style="margin-bottom: 10px;"> 采购来源清单</div>
- <ele-pro-table
- ref="preTable"
- :needPage="false"
- :columns="preColumns"
- :toolkit="[]"
- :datasource="form.outputDetailList"
- row-key="id"
- maxHeight="500px"
- style="margin-bottom: 20px"
- >
- <template v-slot:technicalDrawings="{ row }">
- <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
- </template>
- <template v-slot:files="{ row }">
- <fileMain v-model="row.files" type="view"></fileMain>
- </template>
- </ele-pro-table>
- </div>
- <div class="title"> 采购计划信息</div>
- <el-row>
- <el-col :span="8">
- <el-form-item label="需求单名称:" prop="requirementName">
- <!-- <el-link
- type="primary"
- :underline="false"
- @click="openDetail(form)"
- > -->
- {{ form.requirementName }}
- <!-- </el-link> -->
- <!-- {{ form.requirementCode }} -->
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="计划单名称:" prop="planName">
- {{ form.planName }}
- <!-- {{ form.requirementCode }} -->
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="负责人:" prop="responsibleName">
- {{ form.responsibleName }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="需求类型:" prop="sourceTypeName">
- {{ form.sourceTypeName }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="需求部门:" prop="requireDeptName">
- {{ form.requireDeptName }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="需求人:" prop="requireUserName">
- {{ form.requireUserName }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item prop="remark" label="是否接受拆单:">
- {{ form.acceptUnpack === 1 ? '接受' : '不接受' }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item prop="remark" label="是否需要核价:">
- {{ form.acceptUnpack === 1 ? '是' : '否' }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label-width="144px" prop="isGenerateOrder" label="是否自动生成订单:">
- {{ form.isGenerateOrder == 1 ? '是' : '否' }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label-width="144px" prop="isGenerateContract" label="是否自动生成合同:">
- {{ form.isGenerateContract == 1 ? '是' : '否' }}
- </el-form-item>
- </el-col>
- <!-- <el-col :span="12">
- <el-form-item
- label="用途"
- prop="requireUserName"
- style="margin-bottom: 22px"
- >
- {{ form.requireUserName }}
- </el-form-item>
- </el-col> -->
- <el-col :span="8">
- <el-form-item label="完结日期:" prop="receiveDate">
- {{ form.receiveDate }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item prop="remark" label="备注:">
- {{ form.remark }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item prop="files" label="附件:">
- <fileMain v-model="form.files" type="view"></fileMain>
- </el-form-item>
- </el-col>
- </el-row>
- <headerTitle title="计划清单" style="margin-top: 15px"></headerTitle>
- <el-tabs v-model="activeName" style="margin-top: 15px" type="border-card">
- <el-tab-pane label="物品清单" name="1">
- <ele-pro-table
- ref="table"
- :needPage="false"
- :columns="columns"
- :toolkit="[]"
- :datasource="form.detailList"
- row-key="id"
- maxHeight="500px"
- >
- <template v-slot:totalCount="scope">
- <el-input-number
- :controls="false"
- :min="1"
- style="width: 100%"
- v-model="scope.row.totalCount"
- ></el-input-number>
- </template>
- <template v-slot:expectReceiveDate="scope">
- <div v-if="scope.row.arrivalWay == 1">
- {{ scope.row.expectReceiveDate }}
- </div>
- <div v-if="scope.row.arrivalWay == 2">
- <el-link
- type="primary"
- :underline="false"
- @click.native="handleMethod(scope.row)"
- >
- 查看分批时间
- </el-link>
- </div>
- </template>
- <template v-slot:technicalDrawings="{ row }">
- <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
- </template>
- <template v-slot:files="{ row }">
- <fileMain v-model="row.files" type="view"></fileMain>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane
- label="带料清单"
- name="2"
- v-if="['3', '4', '5', '6', '7'].includes(form.sourceType)"
- >
- <ele-pro-table
- ref="table"
- :needPage="false"
- :columns="columns"
- :toolkit="[]"
- :datasource="form.rawDetailList"
- row-key="id"
- >
- <template v-slot:totalCount="scope">
- <el-input-number
- :controls="false"
- :min="1"
- style="width: 100%"
- v-model="scope.row.totalCount"
- ></el-input-number>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane
- label="产出品清单"
- name="3"
- v-if="['3', '4', '5', '6', '7'].includes(form.sourceType)"
- >
- <ele-pro-table
- ref="table"
- :needPage="false"
- :columns="columns"
- :toolkit="[]"
- :datasource="form.outputDetailList"
- row-key="id"
- >
- <template v-slot:totalCount="scope">
- <el-input-number
- :controls="false"
- :min="1"
- style="width: 100%"
- v-model="scope.row.totalCount"
- ></el-input-number>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- </el-tabs>
- </el-form>
- <timeDialog ref="timeDialogRef" :view="true"></timeDialog>
- <div class="title" v-if="['3', '4', '5'].includes(form.sourceType)">
- 入库单信息</div
- >
- <div v-if="taskDefinitionKey == 'storeManagerApprove'">
- <add
- ref="inoutBoundRef"
- v-if="form.detailList"
- :form="form"
- :sourceBizNo="form.planCode"
- :saleProductList="form.detailList"
- :bizType="10"
- ></add>
- </div>
- <div v-if="isView && ['3', '4', '5'].includes(form.sourceType)">
- <detailDialog
- ref="inoutBoundViewRef"
- :bizType="10"
- :businessId="form.planCode"
- >
- </detailDialog>
- </div>
- </div>
- </template>
- <script>
- import { getplanDetail } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
- import { getFile } from '@/api/system/file';
- import dictMixins from '@/mixins/dictMixins';
- import { getInventoryTotalAPI } from '@/api/bpm/components/wms';
- import timeDialog from '@/components/timeDialog/index.vue';
- import add from '@/views/bpm/stockManagement/storage.vue';
- import detailDialog from '@/views/bpm/stockManagement/details.vue';
- import { levelList } from '@/enum/dict.js';
- export default {
- mixins: [dictMixins],
- components: {
- // fileMain,
- timeDialog,
- add,
- detailDialog
- },
- props: {
- taskDefinitionKey: {
- type: String,
- default: 'starter'
- },
- businessId: {
- default: ''
- },
- isView: {
- default: ''
- }
- },
- data() {
- return {
- activeName: '1',
- visible: false,
- detailId: '',
- title: '详情',
- row: {},
- form: {
- files: []
- },
- columns: [
- {
- width: 45,
- type: 'index',
- columnKey: 'index',
- align: 'center',
- fixed: 'left'
- },
- {
- width: 150,
- prop: 'productCategoryName',
- label: '分类',
- align: 'center'
- },
- {
- width: 140,
- prop: 'productCode',
- label: '编码',
- align: 'center'
- },
- {
- width: 240,
- prop: 'productName',
- label: '名称',
- align: 'center'
- },
- {
- width: 110,
- prop: 'batchNo',
- label: '批次号',
- align: 'center'
- },
- {
- prop: 'provenance',
- label: '产地',
- slot: 'provenance',
- align: 'center',
- minWidth: 200,
- showOverflowTooltip: true,
- formatter: (row, column) => {
- return row.provenance && row.provenance.length
- ? row.provenance
- .map((item) => this.getDictValue('产地', item))
- .join(',')
- : '';
- }
- },
- {
- width: 150,
- prop: 'taskName',
- label: '工序',
- align: 'center'
- },
- {
- width: 150,
- prop: 'productBrand',
- label: '牌号',
- align: 'center'
- },
- {
- width: 150,
- prop: 'purchaseCount',
- label: '数量',
- align: 'center',
- formatter: (row, column) => {
- if (row.purchaseCount) {
- return row.purchaseCount + ' ' + (row.purchaseUnit || '');
- }
- }
- },
- // {
- // width: 150,
- // prop: 'purchaseUnit',
- // label: '单位',
- // align: 'center'
- // },
- {
- minWidth: 180,
- prop: 'packingSpecification',
- align: 'center',
- label: '包装规格',
- showOverflowTooltip: true
- },
- {
- width: 100,
- prop: 'totalCount',
- label: '计量数量',
- align: 'center',
- formatter: (row, column) => {
- if (row.totalCount) {
- return row.totalCount + ' ' + (row.measuringUnit || '');
- }
- }
- // slot: 'totalCount'
- },
- // {
- // width: 100,
- // prop: 'measuringUnit',
- // label: '计量单位',
- // align: 'center',
- // slot: 'measuringUnit'
- // },
- {
- minWidth: 120,
- prop: 'goodsLevel',
- label: '物品级别',
- formatter: (_row, _column, cellValue) => {
- return levelList.find((item) => item.value == _row.goodsLevel)
- ?.label;
- },
- align: 'center'
- },
- {
- width: 200,
- prop: 'warehouseName',
- label: '入库仓库',
- align: 'center'
- },
- {
- width: 120,
- prop: 'totalWeight',
- label: '重量',
- formatter: (row, column) => {
- if (row.totalWeight) {
- return row.totalWeight + ' ' + (row.weightUnit || '');
- }
- },
- align: 'center'
- },
- {
- width: 130,
- prop: 'modelType',
- label: '型号',
- align: 'center',
- slot: 'modelType'
- },
- {
- width: 120,
- prop: 'specification',
- label: '规格',
- align: 'center',
- slot: 'specification'
- },
- {
- minWidth: 120,
- prop: 'modelKey',
- label: '机型',
- showOverflowTooltip: true,
- align: 'center'
- },
- {
- minWidth: 120,
- prop: 'colorKey',
- showOverflowTooltip: true,
- label: '颜色',
- align: 'center'
- },
- {
- width: 150,
- prop: 'arrivalWay',
- label: '到货方式',
- formatter: (row, column, cellValue) => {
- return cellValue == 1 ? '一次性到货' : '分批到货';
- },
- align: 'center'
- },
- {
- width: 170,
- prop: 'receiveDate',
- label: '到货日期',
- slot: 'expectReceiveDate',
- align: 'center'
- },
- {
- width: 130,
- prop: 'supplierName',
- label: '供应商',
- slot: 'supplierName',
- headerSlot: 'headerSupplierName',
- align: 'center'
- },
- {
- width: 120,
- prop: 'packingSpecification',
- align: 'center',
- label: '包装规格',
- showOverflowTooltip: true
- },
- {
- width: 160,
- prop: 'technicalDrawings',
- label: '图纸附件',
- slot: 'technicalDrawings',
- align: 'center'
- },
- {
- width: 140,
- prop: 'files',
- label: '附件',
- slot: 'files',
- align: 'center'
- },
- {
- minWidth: 220,
- prop: 'remark',
- label: '备注',
- align: 'center',
- slot: 'remark'
- }
- ],
- preColumns: [
- {
- width: 45,
- type: 'index',
- columnKey: 'index',
- align: 'center',
- fixed: 'left'
- },
- {
- // width: 240,
- prop: 'orderNo',
- label: '来源单号',
- align: 'center'
- },
- {
- // width: 150,
- prop: 'productCategoryName',
- label: '分类',
- align: 'center'
- },
- {
- // width: 140,
- prop: 'productCode',
- label: '编码',
- align: 'center'
- },
- {
- // width: 240,
- prop: 'productName',
- label: '名称',
- align: 'center'
- },
- {
- // width: 100,
- prop: 'totalCount',
- label: '数量',
- align: 'center',
- formatter: (row, column) => {
- if (row.totalCount) {
- return row.totalCount + ' ' + (row.measuringUnit || '');
- }
- }
- // slot: 'totalCount'
- },
- ],
- };
- },
- created() {
- this.requestDict('产地');
- this.getPlanData(this.businessId);
- },
- methods: {
- downloadFile(file) {
- getFile({ objectName: file.storePath }, file.name);
- },
- async getPlanData(id) {
- this.loading = true;
- const data = await getplanDetail(id);
- this.loading = false;
- if (data) {
- data.purchaseDate = data.createTime;
- let codeList = data.detailList?.map((item) => item.productCode) || [];
- let inventoryTotalList = await getInventoryTotalAPI(codeList);
- data.detailList?.forEach((item) => {
- let find =
- inventoryTotalList.find((key) => key.code == item.productCode) ||
- {};
- item.availableCountBase = find.availableCountBase;
- });
- this.form = data;
- // if (data.files && data.files.length > 0) {
- // this.form.files = data.files[0];
- // } else {
- // this.form.files = null;
- // }
- }
- },
- handleMethod(row) {
- this.$refs.timeDialogRef.open(row);
- },
- //查看详情
- openDetail(row) {
- this.$refs.contactDetailDialogRef.open(row);
- },
- async getTableValue() {
- return {
- returnStorageData:
- this.$refs.inoutBoundRef &&
- (await this.$refs.inoutBoundRef.getReturnStorage())
- };
- }
- }
- };
- </script>
- <style scoped lang="scss">
- .ele-dialog-form {
- .el-form-item {
- margin-bottom: 10px;
- }
- }
- .title {
- font-size: 22px;
- font-weight: 800;
- margin-top: 15px;
- }
- .headbox {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .amount {
- font-size: 14px;
- font-weight: bold;
- }
- }
- </style>
|