| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355 |
- <template>
- <div>
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="goBack(0)">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
- @click="submit">保 存
- </el-button>
- </div>
- </div>
- <div style="margin-top: 50px">
- <trade-card title="基础信息">
- <avue-form :option="optionForm" v-model="form" ref="form">
- <tempalte slot="corpName" slot-scope="{ row }">
- <dic-select v-model="form.corpName" placeholder="客户" key="id" label="cnName" res="records"
- url="/blade-los/bcorps/listByType" :filterable="true" :remote="true" dataName="cnName"
- @selectChange="dicChange('corpName', $event)"></dic-select>
- </tempalte>
- <tempalte slot="warehouseName" slot-scope="{ row }">
- <dic-select v-model="form.warehouseName" placeholder="仓库" key="id" label="cname" res="records"
- url="/blade-los/storage/list" :filterable="true" :remote="true" dataName="cname"
- @selectChange="dicChange('warehouseName', $event)"></dic-select>
- </tempalte>
- <tempalte slot="goodsType" slot-scope="{ row }">
- <dic-select v-model="form.goodsType" placeholder="商品类型" key="dictKey" label="dictValue"
- url="/blade-system/dict-biz/dictionary?code=goods-type" :filterable="true"></dic-select>
- </tempalte>
- </avue-form>
- </trade-card>
- <trade-card title="仓储明细">
- <avue-crud :option="option" :data="form.storageFeeItemsList" id="out-table" ref="crud"
- @selection-change="selectionChange" @resetColumn="resetColumn('crud', 'option', 'optionBack', 396)"
- @saveColumn="saveColumn('crud', 'option', 'optionBack', 396)">
- <template slot="menuLeft">
- <el-button type="primary" size="small" icon="el-icon-plus" @click="addRow">新 增
- </el-button>
- </template>
- <template slot="feeName" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.feeName" placeholder="费用信息" key="id" res="records"
- label="cnName" url="/blade-los/bfees/list" :filterable="true" :remote="true" fff
- dataName="cnName" @selectChange="rowDicChange('feeName', $event, row)"></dic-select>
- <span v-else>{{ row.feeName }}</span>
- </template>
- </avue-crud>
- </trade-card>
- <containerTitle title="上传附件"></containerTitle>
- <c-upload :data="form.filesCenterList" :enumerationValue="76"
- deleteUrl="/blade-purchase-sales/orderfiles/update" display :disabled="editDisabled"></c-upload>
- </div>
- </div>
- </template>
- <script>
- import { submit, getDetail,copyAgent } from "@/api/iosBasicData/storageFee";
- import dicSelect from "@/components/dicSelect/main";
- import { bfeesList } from "@/api/iosBasicData/bfees";
- import _ from "lodash";
- export default {
- name: "detailsPage",
- data() {
- return {
- form: {
- status:'0',
- storageFeeItemsList: []
- },
- optionForm: {
- menuBtn: false,
- span: 8,
- column: [
- {
- label: '客户',
- prop: "corpName",
- disabled: false,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- {
- label: "仓库名称",
- prop: "warehouseName",
- },
- {
- label: "商品类别",
- prop: "goodsType",
- },
- {
- label: "有效期起",
- prop: "beginDate",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd 00:00:00",
- },
- {
- label: "有效期至",
- prop: "endDate",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd 23:59:59"
- },
- {
- label: "状态",
- prop: "status",
- type: "select",
- dicData: [{
- label: '启用',
- value: '0'
- }, {
- label: '停用',
- value: '1'
- }],
- },
- {
- label: '备注',
- prop: "remarks",
- type: 'textarea',
- disabled: false,
- minRows: 2,
- },
- ]
- },
- option: {},
- optionBack: {
- height: 'auto',
- calcHeight: 30,
- menuWidth: 140,
- border: true,
- index: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- menu: false,
- refreshBtn: false,
- align: 'center',
- column: [
- {
- label: "费用名称",
- prop: "feeName",
- overHidden: true
- },
- {
- label: "计价单位",
- prop: "feeUnit",
- cell: true,
- type: 'select',
- filterable: true,
- remote: true,
- dicUrl: "/api/blade-los/bunits/list",
- props: {
- label: 'cnName',
- value: 'cnName',
- res: 'data.records'
- },
- overHidden: true
- },
- {
- label: "开始天数",
- prop: "fromDays",
- cell: true,
- type: 'number',
- controls: false,
- overHidden: true
- },
- {
- label: "结束天数",
- prop: "enDays",
- cell: true,
- type: 'number',
- controls: false,
- overHidden: true
- },
- {
- label: "单价",
- prop: "price",
- cell: true,
- type: 'number',
- controls: false,
- overHidden: true
- },
- {
- label: "备注",
- prop: "remarks",
- cell: true,
- overHidden: true
- }
- ]
- },
- }
- },
- components: {
- dicSelect,
- },
- props: {
- detailData: Object
- },
- async created() {
- this.option = await this.getColumnData(this.getColumnName(396), this.optionBack);
- if (this.detailData.id) {
- this.getDetails(this.detailData.id)
- }
- if (this.detailData.copyId) {
- this.getCopydate(this.detailData.copyId)
- }
- },
- methods: {
- dicChange(name, row) {
- if (name == 'corpName') {
- if (row) {
- this.form.corpId = row.id
- } else {
- this.form.corpId = null
- }
- }
- },
- rowDicChange(name, row, el) {
- if (name == 'feeName') {
- if (row) {
- el.feeId = row.id
- } else {
- el.feeId = null
- }
- }
- if (name == 'warehouseName') {
- if (row) {
- el.warehouseId = row.id
- } else {
- el.warehouseId = null
- }
- }
- },
- getDetails(id) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- getDetail({ id: id }).then(res => {
- this.form = res.data.data
- this.$refs.crud.dicInit();
- }).finally(() => {
- loading.close()
- })
- },
- getCopydate(id) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- copyAgent({ id: id }).then(res => {
- this.form = res.data.data
- }).finally(() => {
- loading.close()
- })
- },
- addRow() {
- if (!this.form.corpId) {
- return this.$message.error("请选择客户名称");
- }
- this.$refs.crud.dicInit();
- bfeesList(1, 10, { cnName: '仓储费' }).then(res => {
- res.data.data.records.forEach(e => {
- if (e.cnName == '仓储费')
- this.form.storageFeeItemsList.push({
- feeId: e.id,
- feeName: e.cnName,
- $cellEdit: true
- })
- })
- })
- },
- submit() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submit(this.form).then(res => {
- this.$message.success("保存成功");
- this.getDetails(res.data.data.id)
- }).finally(() => {
- loading.close();
- })
- } else {
- return false;
- }
- });
- },
- //自定义列保存
- async saveColumn(ref, option, optionBack, code) {
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumn(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- goBack(type) {
- this.$emit("goBack", type);
- this.$emit('updateKey')
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- ::v-deep .el-table .cell {
- padding: 0 2px !important;
- .el-form-item {
- margin-bottom: 0px !important;
- }
- }
- ::v-deep .avue-crud .el-table .el-form-item__label {
- left: -1px;
- }
- ::v-deep#out-table .back-one {
- background: #ecf5ff !important;
- }
- ::v-deep#out-table .back-two {
- background: #ecf5ff !important;
- }
- </style>
|