chunk-62083030.858d2bed.js 44 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-62083030","chunk-4f634a89","chunk-65d5303f","chunk-40af8a95","chunk-2d21d8c0"],{"08ba":function(t,e,i){},"0ccd":function(t,e,i){},2531:function(t,e,i){},"3b9e":function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t._self._c;return e("div",[e("el-drawer",{attrs:{visible:t.showArea,size:"55vw","before-close":t.closeFn,"custom-class":"drawer-class",direction:t.direction},on:{"update:visible":function(e){t.showArea=e},close:t.closeTrigger}},[e("div",[e("div",{staticStyle:{"margin-left":"2px","font-weight":"bold"}},[e("el-date-picker",{staticStyle:{"margin-right":"10px"},attrs:{type:"daterange",align:"right","unlink-panels":"","range-separator":"至","start-placeholder":"开始日期","value-format":"yyyy-MM-dd","end-placeholder":"结束日期","picker-options":t.pickerOptions,size:"mini"},on:{change:t.getSearchDate},model:{value:t.currentDateList,callback:function(e){t.currentDateList=e},expression:"currentDateList"}}),t._v(" 【"+t._s(t.costData.name?t.costData.name:"")+"】成本变动 ")],1),e("x-crud",{on:{load:t.onLoad},scopedSlots:t._u([{key:"table-column-bigNumOrder",fn:function({scope:i}){return[t._v(" "+t._s(1==i.row.io?"+":"-")),e("span",[t._v(t._s(i.row.bigNumOrder))])]}}])})],1)])],1)},a=[],r={name:"stock-detail",props:{costData:{type:Object,default:()=>{}}},data(){return{options:[],currentDateList:[],showArea:!1,pickerOptions:{shortcuts:[{text:"最近一周",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-6048e5),t.$emit("pick",[i,e])}},{text:"最近一个月",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-2592e6),t.$emit("pick",[i,e])}},{text:"最近三个月",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-7776e6),t.$emit("pick",[i,e])}}]},startTime:"",endTime:"",searchTime:"",direction:"ltr"}},methods:{goRefresh(){this.app.refresh({id:this.costData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime})},closeTrigger(){this.$emit("searchFocus")},getSearchDate(){this.$util.isEmpty(this.currentDateList)?this.resetSearch():(this.searchTime="custom",this.startTime=this.currentDateList[0],this.endTime=this.currentDateList[1]),this.app.refresh({id:this.costData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime})},resetSearch(){this.searchTime="",this.startTime="",this.endTime=""},init(){this.showArea=!0,this.costData.direction&&!this.$util.isEmpty(this.costData.direction)&&(this.direction=this.costData.direction),this.resetSearch(),this.app&&this.goRefresh()},closeFn(){this.showArea=!1},onLoad({ctx:t,app:e}){this.app=e,t.service(this.$service.costChange).set("table",{columns:[{label:"日期",prop:"addTime",align:"center"},{label:"操作",prop:"staffName",align:"center"},{label:"事项",prop:"event",align:"center"},{label:"成本",prop:"cost",align:"center"}],op:{visible:!0,props:{width:160,align:"center",fixed:"right",label:"操作"},layout:[]}}).set("layout",[["data-table"],["flex1","pagination"]]).on("refresh",async(t,{next:e})=>{let i=await e(t);this.options=i.typeList}).done(),e.refresh({id:this.costData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime})}}},n=r,c=(i("e0fe"),i("1805")),o=Object(c["a"])(n,s,a,!1,null,"604dee50",null);e["default"]=o.exports},"3e71":function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t._self._c;return e("div",[e("el-drawer",{attrs:{visible:t.showArea,size:"55vw","before-close":t.closeFn,"custom-class":"drawer-class",direction:"ltr"},on:{"update:visible":function(e){t.showArea=e},close:t.closeTrigger}},[e("div",[e("div",{staticStyle:{"margin-left":"2px","font-weight":"bold"}},[e("el-date-picker",{staticStyle:{"margin-right":"10px"},attrs:{type:"daterange",align:"right","unlink-panels":"","range-separator":"至","start-placeholder":"开始日期","value-format":"yyyy-MM-dd","end-placeholder":"结束日期","picker-options":t.pickerOptions,size:"mini"},on:{change:t.getSearchDate},model:{value:t.currentDateList,callback:function(e){t.currentDateList=e},expression:"currentDateList"}}),e("el-select",{staticStyle:{width:"150px"},attrs:{placeholder:"请选事项",size:"mini",clearable:!0},on:{change:t.changeType,clear:t.clearType},model:{value:t.typeValue,callback:function(e){t.typeValue=e},expression:"typeValue"}},t._l(t.options,(function(t){return e("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),t._v(" 【"+t._s(t.itemData.name?t.itemData.name:"")+"】库存明细 ")],1),e("x-crud",{on:{load:t.onLoad},scopedSlots:t._u([{key:"table-column-bigNumOrder",fn:function({scope:i}){return[t._v(" "+t._s(1==i.row.io?"+":"-")),e("span",[t._v(t._s(i.row.bigNumOrder))])]}}])})],1)])],1)},a=[],r={name:"stock-detail",props:{itemData:{type:Object,default:()=>{}}},data(){return{options:[],typeValue:"",currentDateList:[],showArea:!1,pickerOptions:{shortcuts:[{text:"最近一周",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-6048e5),t.$emit("pick",[i,e])}},{text:"最近一个月",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-2592e6),t.$emit("pick",[i,e])}},{text:"最近三个月",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-7776e6),t.$emit("pick",[i,e])}}]},startTime:"",endTime:"",searchTime:""}},methods:{clearType(){this.typeValue="",this.goRefresh()},changeType(t){this.goRefresh()},goRefresh(){this.app.refresh({id:this.itemData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,recordType:this.typeValue})},closeTrigger(){this.$emit("searchFocus")},getSearchDate(){this.$util.isEmpty(this.currentDateList)?(this.searchTime="",this.startTime="",this.endTime=""):(this.searchTime="custom",this.startTime=this.currentDateList[0],this.endTime=this.currentDateList[1]),this.app.refresh({id:this.itemData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,recordType:this.typeValue})},init(){this.showArea=!0,this.app&&this.app.refresh({id:this.itemData.id})},closeFn(){this.showArea=!1},onLoad({ctx:t,app:e}){this.app=e,t.service(this.$service.stock).set("table",{columns:[{label:"日期",prop:"addTime",align:"center"},{label:"名称",prop:"relateName",align:"center"},{label:"事项",prop:"typeName",align:"center"},{label:"变动",prop:"bigNumOrder",align:"center"},{label:"剩余",prop:"bigNumStock",align:"center"}],op:{visible:!0,props:{width:160,align:"center",fixed:"right",label:"操作"},layout:[]}}).set("layout",[["data-table"],["flex1","pagination"]]).on("refresh",async(t,{next:e})=>{let i=await e(t);this.options=i.typeList}).done(),e.refresh({id:this.itemData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,recordType:this.typeValue})}}},n=r,c=(i("6649"),i("1805")),o=Object(c["a"])(n,s,a,!1,null,"20384345",null);e["default"]=o.exports},6649:function(t,e,i){"use strict";i("08ba")},"68a4":function(t,e,i){"use strict";i("0ccd")},8014:function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"app-list-content"},[e("x-crud",{ref:"xCrud",staticClass:"liu-crud-wrap",on:{load:t.onLoad},scopedSlots:t._u([{key:"slot-tabs",fn:function(){return[e("el-tabs",{staticClass:"liu-tabs",attrs:{type:"border-card"},on:{"tab-click":t.tabClick},model:{value:t.tabIndex,callback:function(e){t.tabIndex=e},expression:"tabIndex"}},t._l(t.tabsData,(function(t,i){return e("el-tab-pane",{key:i,attrs:{label:t.text,name:t.key}})})),1)]},proxy:!0},{key:"table-column-cover",fn:function({scope:t}){return[e("el-popover",{attrs:{placement:"right",width:"200",trigger:"hover"}},[e("div",{staticStyle:{width:"200px",height:"200px"}},[e("img",{staticStyle:{width:"100%",height:"100%","object-fit":"cover"},attrs:{src:t.row.bigCover}})]),e("div",{staticStyle:{width:"40px"},attrs:{slot:"reference"},slot:"reference"},[e("img",{staticStyle:{width:"100%",height:"100%","object-fit":"cover","border-radius":"5px"},attrs:{src:t.row.cover}})])])]}},{key:"table-column-cgStaffName",fn:function({scope:i}){return[""!=i.row.cgStaffName?e("span",{staticStyle:{cursor:"pointer"},on:{click:function(e){return t.changeCgStaff(i.row)}}},[t._v(t._s(i.row.cgStaffName))]):e("span",[e("i",{staticClass:"el-icon-edit",staticStyle:{color:"#409eff","font-size":"17px",cursor:"pointer"},attrs:{slot:"reference"},on:{click:function(e){return t.changeCgStaff(i.row)}},slot:"reference"})])]}},{key:"table-column-name",fn:function({scope:i}){return[0==i.row.delStatus?e("span",{staticClass:"item-name"},[t._v(t._s(i.row.name))]):e("span",{staticClass:"item-name",staticStyle:{color:"#CCCCCC"}},[t._v(t._s(i.row.name))])]}},{key:"table-column-stock",fn:function({scope:i}){return[e("div",{staticStyle:{cursor:"pointer"},on:{click:function(e){return t.changeStock(i.row)}}},[t._v(t._s(i.row.stock?parseFloat(i.row.stock):0))])]}},{key:"table-column-status",fn:function({scope:i}){return[1==i.row.status?e("span",[t._v("是")]):e("span",[t._v("-")])]}},{key:"table-column-delStatus",fn:function({scope:i}){return[1==i.row.delStatus?e("span",{staticStyle:{color:"#CCCCCC"}},[t._v("已删")]):e("span",[t._v("-")])]}},{key:"table-column-unit",fn:function({scope:i}){return[0==i.row.ratioType?e("span",[t._v(t._s(i.row.ratio)+t._s(i.row.smallUnit))]):e("span",[t._v("若干"+t._s(i.row.smallUnit))])]}},{key:"table-column-price",fn:function({scope:i}){return[t.priceInput?e("el-input",{ref:"sort-input",staticStyle:{width:"80%"},attrs:{focus:"",size:"mini",placeholder:""},on:{blur:function(e){return t.changeInputValue(i.row,"price")}},model:{value:i.row.price,callback:function(e){t.$set(i.row,"price",e)},expression:"scope.row.price"}}):e("span",[e("span",[t._v(t._s(i.row.price))])])]}},{key:"table-column-stockWarning",fn:function({scope:i}){return[t.stockWarningInput?e("el-input",{ref:"sort-input",staticStyle:{width:"80%"},attrs:{focus:"",size:"mini",placeholder:""},on:{blur:function(e){return t.changeInputValue(i.row,"stockWarning")}},model:{value:i.row.stockWarning,callback:function(e){t.$set(i.row,"stockWarning",e)},expression:"scope.row.stockWarning"}}):e("span",[e("span",[t._v(t._s(i.row.stockWarning))])])]}},{key:"table-header-stockWarning",fn:function(){return[e("div",{staticClass:"set-sort"},[e("span",[t._v("库存预警")])])]},proxy:!0},{key:"table-column-inTurn",fn:function({scope:i}){return[t.sort.status?e("el-input",{ref:"sort-input",staticStyle:{width:"80%"},attrs:{focus:"",size:"mini"},on:{blur:function(e){return t.changeInputValue(i.row,"inTurn")}},model:{value:i.row.inTurn,callback:function(e){t.$set(i.row,"inTurn",e)},expression:"scope.row.inTurn"}}):e("span",[t._v(t._s(i.row.inTurn))])]}},{key:"table-header-inTurn",fn:function(){return[e("div",{staticClass:"set-sort"},[e("span",[t._v("排序")])])]},proxy:!0},{key:"slot-modify",fn:function({scope:i}){return[e("el-button",{attrs:{type:"primary",size:"small"},nativeOn:{click:function(e){return e.stopPropagation(),t.getStockList(i.row)}}},[t._v("库存明细")]),e("el-button",{attrs:{type:"primary",size:"small"},nativeOn:{click:function(e){return e.stopPropagation(),t.replaceBtnFn(i.row.id)}}},[t._v("修改")]),e("el-popover",{ref:"popover-"+i.row.id,staticStyle:{"margin-left":"10px","margin-right":"10px"},attrs:{placement:"top",width:"160"}},[e("p",[t._v("确认复制生成花材?")]),e("div",{staticStyle:{"text-align":"right",margin:"0"}},[e("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.cancelCopyProduct(i.row.id)}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return e.stopPropagation(),t.copyProduct(i.row.id)}}},[t._v("确定")])],1),e("el-button",{attrs:{slot:"reference",size:"small",type:"primary"},on:{click:function(t){t.stopPropagation()}},slot:"reference"},[t._v("复制新建")])],1),0==i.row.delStatus?e("el-button",{attrs:{type:"primary",size:"small"},nativeOn:{click:function(e){return e.stopPropagation(),t.setDelStatusFun(i.row.id,1)}}},[t._v("删除")]):t._e(),1==i.row.delStatus?e("el-button",{attrs:{type:"primary",size:"small"},nativeOn:{click:function(e){return e.stopPropagation(),t.setDelStatusFun(i.row.id,0)}}},[t._v("恢复")]):t._e(),e("el-dropdown",{staticStyle:{"margin-left":"10px"},on:{command:function(e){return t.doMore(e,i.row)}}},[e("el-button",{attrs:{type:"primary",size:"small"}},[t._v("更多"),e("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e("el-dropdown-item",{attrs:{command:"costChange"}},[t._v("成本变动记录")]),e("el-dropdown-item",{attrs:{command:"downCode"}},[t._v("下载商品码")])],1)],1)]}},{key:"table-column-cost",fn:function({scope:i}){return[t.costPrice?e("el-input",{ref:"sort-input",staticStyle:{width:"80%"},attrs:{focus:"",size:"mini"},on:{blur:function(e){return t.changeInputValue(i.row,"cost")}},model:{value:i.row.cost,callback:function(e){t.$set(i.row,"cost",e)},expression:"scope.row.cost"}}):e("span",[t._v(t._s(i.row.cost))])]}},{key:"table-header-ratio",fn:function(){return[e("div",{staticClass:"set-sort"},[e("span",[t._v("单位比")])])]},proxy:!0},{key:"table-column-ratio",fn:function({scope:i}){return[t.canAddRatio?e("el-input",{ref:"add-price-input",staticStyle:{width:"80%"},attrs:{focus:"",size:"mini"},on:{blur:function(e){return t.changeInputValue(i.row,"ratio")}},model:{value:i.row.ratio,callback:function(e){t.$set(i.row,"ratio",e)},expression:"scope.row.ratio"}}):e("span",[t._v(t._s(i.row.ratio))])]}},{key:"table-header-weight",fn:function(){return[e("div",{staticClass:"set-sort"},[e("span",[t._v("重量(公斤)")])])]},proxy:!0},{key:"table-column-weight",fn:function({scope:i}){return[t.costWeight?e("el-input",{ref:"add-price-input",staticStyle:{width:"80%"},attrs:{focus:"",size:"mini"},on:{blur:function(e){return t.changeInputValue(i.row,"weight")}},model:{value:i.row.weight,callback:function(e){t.$set(i.row,"weight",e)},expression:"scope.row.weight"}}):e("span",[t._v(t._s(i.row.weight))])]}},{key:"slot-download-price-btn",fn:function(){return[e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.downloadPrice(1)}}},[t._v("批发价格表")]),e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.downloadPrice(0)}}},[t._v("零售价格表")]),e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.downloadStock()}}},[t._v("下载库存表")])]},proxy:!0},{key:"slot-add-goods-btn",fn:function(){return[e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.$util.pageTo({url:"/item/import"})}}},[t._v("批量添加花材")])]},proxy:!0},{key:"slot-addNew-goods-btn",fn:function(){return[e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.replaceBtnFn(0)}}},[t._v("新增")])]},proxy:!0},{key:"slot-option-area",fn:function(){return[e("el-input",{ref:"itemSearchRef",staticStyle:{width:"160px"},attrs:{placeholder:"搜索花材",size:"mini"},on:{input:function(e){return t.changeSearch()},focus:function(e){return t.clearSearch()}},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}),e("el-select",{staticStyle:{width:"150px","margin-left":"10px"},attrs:{size:"mini",placeholder:"分类",clearable:""},on:{change:t.getItemClass},model:{value:t.currentItemClassName,callback:function(e){t.currentItemClassName=e},expression:"currentItemClassName"}},t._l(t.itemClassList,(function(t){return e("el-option",{key:t.value,attrs:{label:t.name,value:t.id}})})),1),e("el-select",{staticStyle:{width:"110px","margin-left":"10px"},attrs:{size:"mini",placeholder:"采购人",clearable:!0},on:{change:t.getCgStaff},model:{value:t.currentCgStaffName,callback:function(e){t.currentCgStaffName=e},expression:"currentCgStaffName"}},t._l(t.staffList,(function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1),e("el-radio-group",{staticStyle:{"padding-top":"6px","margin-left":"10px"},on:{change:t.changeHasStock},model:{value:t.hasStock,callback:function(e){t.hasStock=e},expression:"hasStock"}},[e("el-radio",{attrs:{label:"-1"}},[t._v("全部")]),e("el-radio",{attrs:{label:"0"}},[t._v("没库存")]),e("el-radio",{attrs:{label:"1"}},[t._v("有库存")])],1)]},proxy:!0},{key:"slot-more-do-btn",fn:function(){return[e("el-dropdown",{attrs:{size:"medium","split-button":"",type:"primary"},on:{click:t.batchChangeCgStaff,command:function(e){return t.bottomDoMore(e)}}},[t._v(" 修改采购人 "),e("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e("el-dropdown-item",{attrs:{command:"batchChangeKd"}},[t._v("修改开单人")])],1)],1)]},proxy:!0}])}),e("item-list-layer",{attrs:{show:t.showItemModal,classId:t.classId,className:t.className},on:{"update:show":function(e){t.showItemModal=e},"update:classId":function(e){t.classId=e},"update:class-id":function(e){t.classId=e},"update:className":function(e){t.className=e},"update:class-name":function(e){t.className=e},confirm:t.selectItemFn,cancel:function(e){t.showItemModal=!1}}}),e("el-dialog",{attrs:{title:"花材",visible:t.addDialog,"close-on-click-modal":!1,width:"600px"},on:{"update:visible":function(e){t.addDialog=e}}},[e("div",{staticClass:"ad-modal-content"},[e("el-form",{ref:"replaceForm",staticClass:"demo-form",attrs:{model:t.replaceForm,rules:t.replaceFormRules,"label-width":"100px"}},[e("el-form-item",{attrs:{label:"名称",prop:"name"}},[e("el-input",{attrs:{placeholder:"请输入名称",size:"small"},on:{input:function(e){return t.fillName(e)}},model:{value:t.replaceForm.name,callback:function(e){t.$set(t.replaceForm,"name",e)},expression:"replaceForm.name"}})],1),e("el-form-item",{attrs:{label:"拼音缩写",prop:"py"}},[e("el-input",{attrs:{placeholder:"拼音缩写",size:"small"},model:{value:t.replaceForm.py,callback:function(e){t.$set(t.replaceForm,"py",e)},expression:"replaceForm.py"}})],1),e("el-form-item",{attrs:{label:"图片",prop:"cover"}},[e("cl-upload",{attrs:{successFun:t.uploadSuccess},model:{value:t.replaceForm.cover,callback:function(e){t.$set(t.replaceForm,"cover",e)},expression:"replaceForm.cover"}}),e("p",{staticStyle:{"font-size":"14px",color:"#cccccc"}},[t._v("建议上传图片比例 400X400")])],1),e("el-form-item",{attrs:{label:"分类",prop:"classId"}},[e("el-select",{attrs:{size:"small",placeholder:"请选择分类"},on:{change:t.selClassFn},model:{value:t.replaceForm.className,callback:function(e){t.$set(t.replaceForm,"className",e)},expression:"replaceForm.className"}},t._l(t.itemClassList,(function(i,s){return e("el-option",{key:s,attrs:{value:i.name}},[t._v(t._s(i.name))])})),1)],1),e("el-form-item",{attrs:{label:"库存",prop:"stock"}},[e("el-input",{attrs:{placeholder:"请输入",size:"small"},on:{focus:function(e){t.replaceForm.stock=""}},model:{value:t.replaceForm.stock,callback:function(e){t.$set(t.replaceForm,"stock",e)},expression:"replaceForm.stock"}})],1),e("el-form-item",{attrs:{label:"大单位",prop:"bigUnitId"}},[e("el-select",{attrs:{size:"small",placeholder:"请选择单位"},on:{change:t.selBigUnitFn},model:{value:t.replaceForm.bigUnit,callback:function(e){t.$set(t.replaceForm,"bigUnit",e)},expression:"replaceForm.bigUnit"}},t._l(t.unitList,(function(i,s){return e("el-option",{key:s,attrs:{value:i.name}},[t._v(t._s(i.name))])})),1)],1),e("el-form-item",{attrs:{label:"小单位",prop:"smallUnitId"}},[e("el-select",{attrs:{size:"small",placeholder:"请选择单位"},on:{change:t.selSmallUnitFn},model:{value:t.replaceForm.smallUnit,callback:function(e){t.$set(t.replaceForm,"smallUnit",e)},expression:"replaceForm.smallUnit"}},t._l(t.unitList,(function(i,s){return e("el-option",{key:s,attrs:{value:i.name}},[t._v(t._s(i.name))])})),1)],1),e("el-form-item",{attrs:{label:"单位比",prop:"ratio"}},[e("el-input",{attrs:{placeholder:"1扎=20支,请输入20",size:"small"},model:{value:t.replaceForm.ratio,callback:function(e){t.$set(t.replaceForm,"ratio",e)},expression:"replaceForm.ratio"}})],1),e("el-form-item",{attrs:{label:"库存预警",prop:"stockWarning"}},[e("el-input",{attrs:{placeholder:"请输入数值",size:"small"},model:{value:t.replaceForm.stockWarning,callback:function(e){t.$set(t.replaceForm,"stockWarning",e)},expression:"replaceForm.stockWarning"}})],1),e("el-form-item",{attrs:{label:"每扎重量",prop:"weight"}},[e("el-input",{attrs:{placeholder:"请输入斤数",size:"small"},model:{value:t.replaceForm.weight,callback:function(e){t.$set(t.replaceForm,"weight",e)},expression:"replaceForm.weight"}})],1),e("el-form-item",{attrs:{label:"成本",prop:"cost"}},[e("el-input",{attrs:{placeholder:"请输入成本",size:"small"},model:{value:t.replaceForm.cost,callback:function(e){t.$set(t.replaceForm,"cost",e)},expression:"replaceForm.cost"}})],1),e("el-form-item",{attrs:{label:"加价",prop:"addPrice"}},[e("el-input",{attrs:{placeholder:"请输入加价",size:"small"},model:{value:t.replaceForm.addPrice,callback:function(e){t.$set(t.replaceForm,"addPrice",e)},expression:"replaceForm.addPrice"}})],1)],1)],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{size:"small"},on:{click:t.resetForm}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.replaceConfirmFn}},[t._v("确认")])],1)]),e("el-dialog",{attrs:{width:"600px",title:"批量修改",visible:t.dialogFormVisible},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[e("div",{staticClass:"flex-center"},[e("el-input",{attrs:{placeholder:"批量修改",autocomplete:"off"},model:{value:t.batchAlterNum,callback:function(e){t.batchAlterNum=e},expression:"batchAlterNum"}}),e("el-button",{staticStyle:{margin:"0 30px"},attrs:{type:"primary"},on:{click:t.batchAlterNumFun}},[t._v("确 定")])],1),e("div",{staticClass:"flex-center",staticStyle:{"margin-top":"30px"}},[e("el-input",{attrs:{placeholder:"批量加价",autocomplete:"off"},model:{value:t.batchAddNum,callback:function(e){t.batchAddNum=e},expression:"batchAddNum"}}),e("el-button",{staticStyle:{margin:"0 30px"},attrs:{type:"primary"},on:{click:t.batchAddNumFun}},[t._v("确 定")])],1)]),e("stock-detail",{ref:"stockDetailRef",attrs:{itemData:t.itemData},on:{searchFocus:t.searchFocus}}),e("cost-change",{ref:"costChangeRef",attrs:{costData:t.costData},on:{searchFocus:t.searchFocus}}),e("select-staff",{ref:"selectStaffRef",attrs:{staffData:t.staffData},on:{getStaff:t.getStaff}})],1)},a=[],r=(i("b138"),i("8f26"),i("666b"),i("963e"),i("209c"),i("f803"),i("f08f")),n=i("3b9e"),c=i("3e71"),o=i("d284"),l={name:"list",components:{itemListLayer:r["default"],stockDetail:c["default"],selectStaff:o["default"],costChange:n["default"]},data(){return{currentItemClassName:"",staffData:{},app:null,hasStock:"-1",sortLink:"",operateData:{},statusOption:[{value:"3",label:"全部"},{value:"1",label:"上架"},{value:"2",label:"下架"}],tabIndex:"0",tabsData:[{text:"全部花材",key:"0"},{text:"上架",key:"1"},{text:"下架",key:"2"},{text:"已删除",key:"3"}],selects:{},status:0,delStatus:2,sort:{status:!1},batchAlterNum:"",batchAddNum:"",dialogFormVisible:!1,selectedData:[],canAddPrice:!1,canSkAddPrice:!1,canByAddPrice:!1,canHjAddPrice:!1,canZsAddPrice:!1,canAddRatio:!1,costPrice:!1,costWeight:!1,priceInput:!1,shelfLifeInput:!1,stockWarningInput:!1,classId:0,className:"",showItemModal:!1,dataList:{form:{data:"",type:""}},initData:[],addDialog:!1,replaceForm:{name:"",py:"",stock:"",classId:"",className:"",cover:"",bigUnit:"",smallUnit:"",stockWarning:"",cost:"",addPrice:"",weight:""},replaceFormRules:{name:{required:!0,message:"名称不能为空"},cover:{required:!0,message:"图片不能为空"},classId:{required:!0,message:"请选择分类"},bigUnitId:{required:!0,message:"请选择大单位"},smallUnitId:{required:!0,message:"请选择小单位"},ratio:{required:!0,message:"比例不能为空"},stockWarning:{required:!0,message:"最低库存不能为空"},cost:{required:!0,message:"运费不能为空"},stock:{required:!0,message:"没有库存请填0"},addPrice:{required:!0,message:"加价不能为空"},weight:{required:!0,message:"重量不能为空"}},itemClassList:[],unitList:[],currentItemId:0,itemData:{},costData:{},search:"",currentCgStaffName:"",currentCgStaffId:0,currentCgStaffName:"",staffList:[]}},computed:{},mounted(){let t=this;this.init(),this.$nextTick(()=>{this.$refs.itemSearchRef.focus()}),t.$service.shopAdmin.getAllStaff().then(e=>{t.staffList=e.list})},methods:{changeStock(t){},getItemClass(t){this.classId=t,this.refreshData()},getCgStaff(t){this.currentCgStaffId=t,this.refreshData()},batchChangeCgStaff(){if(this.$util.isEmpty(this.selectedData))return this.$message.error("请选择花材"),!1;this.staffData={title:"修改采购负责人",changeType:"batchChangeCgStaff",obj:null},this.$refs.selectStaffRef.init()},bottomDoMore(t){"batchChangeKd"==t&&this.$message.error("开发中")},getStaff(t){let e=this;if("changeCgStaff"==this.staffData.changeType){let i=this.staffData.obj,s=JSON.stringify([i.id]);this.$service.product.batchModifyCgStaff({ids:s,staffId:t.id}).then(t=>{this.$message.success("修改成功"),setTimeout(()=>{e.refreshData()},1e3)})}if("batchChangeCgStaff"==this.staffData.changeType){let i=this.selectedData.map(t=>t.id);this.$service.product.batchModifyCgStaff({ids:JSON.stringify(i),staffId:t.id}).then(t=>{this.$message.success("修改成功"),setTimeout(()=>{e.refreshData()},1e3)})}},changeCgStaff(t){this.staffData={title:"修改采购负责人",changeType:"changeCgStaff",obj:t},this.$refs.selectStaffRef.init()},doMore(t,e){if("downCode"==t){let t=e.id,i=this.$service.item.downMiniCode(t);location.href=i}"costChange"==t&&(this.costData={id:e.id,name:e.name},setTimeout(()=>{this.$refs.costChangeRef.init()}))},searchFocus(){let t=this;setTimeout(()=>{t.$refs.itemSearchRef.focus()},1e3)},changeHasStock(t){this.hasStock=t,this.refreshData()},clearSearch(){""!=this.search&&(this.search="",this.changeSearch())},changeSearch(){let t=this;null!=this.T&&clearTimeout(this.T),this.T=setTimeout((function(){t.refreshData()}),650)},refreshData(){let t=this;t.app.refresh({classId:t.classId,status:t.status,delStatus:t.delStatus,showPage:1,name:t.search,hasStock:t.hasStock,cgStaffId:this.currentCgStaffId})},getStockList(t){this.itemData={id:t.id,name:t.name},setTimeout(()=>{this.$refs.stockDetailRef.init()})},downloadPrice(t){this.$service.product.generatePriceTable({level:t}).then(t=>{t.file&&(window.location.href=t.file)})},downloadStock(){this.$service.product.generateStockTable().then(t=>{t.file&&(window.location.href=t.file)})},copyProduct(t){this.$message({message:"开发中",type:"warning"})},cancelCopyProduct(t){this.$refs["popover-"+t].doClose()},fillName(t){this.$service.product.py({name:t}).then(t=>{t.py&&(this.replaceForm.py=t.py)}).catch(t=>{console.log(t)})},init(){this.getAllClass(),this.getAllUnit()},selectItemFn(t){let e=t.list,i=t.classId,s=[];e.forEach(t=>{let e={};e.itemId=t.id,e.classId=i,e.cost=t.cost,e.addPrice=t.addPrice,e.stockWarning=t.stockWarning,s.push(e)}),s=JSON.stringify(s),this.$service.item.batchAdd({data:s}).then(t=>{this.$message.success("操作成功!"),this.showItemModal=!1,this.$router.go(0)}).catch(t=>{console.log(t)})},getAllClass(){if(!this.$util.isEmpty(this.itemClassList))return this.itemClassList;this.$service.itemClass.getAllClass().then(t=>{this.itemClassList=t.list})},getAllUnit(){if(!this.$util.isEmpty(this.unitList))return this.unitList;this.$service.unit.getAllUnit().then(t=>{this.unitList=t.list})},addFn(){this.showItemModal=!0},selClassFn(t){let e=this.itemClassList.findIndex(e=>e.name==t);this.replaceForm.classId=this.itemClassList[e].id,this.replaceForm.className=this.itemClassList[e].name,this.$forceUpdate()},selBigUnitFn(t){let e=this.unitList.findIndex(e=>e.name==t);this.replaceForm.bigUnitId=this.unitList[e].id},selSmallUnitFn(t){let e=this.unitList.findIndex(e=>e.name==t);this.replaceForm.smallUnitId=this.unitList[e].id},resetForm(){this.goodsData={},this.$refs["replaceForm"].resetFields(),this.addDialog=!1},setStatusFun(t,e){this.$service.product.changeStatus({id:t,status:e}).then(t=>{this.$message.success("操作成功!"),this.app.refresh()}).catch(t=>{})},setDelStatusFun(t,e){this.$message({message:"开发中",type:"warning"})},replaceConfirmFn(){let t=this.$util.copyObject(this.replaceForm);"http"==this.replaceForm.cover.substr(0,4).toLowerCase()&&(t.cover=this.replaceForm.shortCover),this.$refs.replaceForm.validate(e=>{e&&(0==this.currentItemId?this.$service.product.addProduct(JSON.parse(JSON.stringify(this.replaceForm))).then(t=>{this.$message.success("操作成功!"),this.addDialog=!1,this.app.refresh()}):this.$service.product.update(t).then(t=>{this.$message.success("操作成功!"),this.addDialog=!1,this.app.refresh()}).catch(t=>{}))})},tabClick(t){let e=t.index;0==e?this.app.refresh({status:0,delStatus:2}):1==e?this.app.refresh({status:1,delStatus:0}):2==e?this.app.refresh({status:2,delStatus:0}):3==e&&this.app.refresh({delStatus:1,status:0})},onLoad({ctx:t,app:e}){this.app=e,this.$route.query.classId&&(this.classId=Number(this.$route.query.classId)),""!=this.$route.query.className&&(this.currentItemClassName=this.$route.query.className),this.$route.query.status&&(this.status=this.$route.query.status),this.$route.query.delStatus&&(this.delStatus=this.$route.query.delStatus),t.service(this.$service.product).set("table",{columns:[{type:"selection",align:"center",width:"40"},{prop:"id",label:"ID",align:"center","min-width":70},{prop:"name",label:"名称",align:"center","min-width":140},{prop:"cover",label:"图片",align:"center","min-width":60},{prop:"cost",label:"成本",align:"center","min-width":90},{prop:"hjPrice",label:"大客价",align:"center",minWidth:90},{prop:"price",label:"批发价",align:"center",minWidth:90},{prop:"skPrice",label:"零售价",align:"center",minWidth:90},{prop:"stockWarning",label:"库存预警",align:"center","min-width":80},{prop:"className",label:"分类",align:"center","min-width":90},{prop:"stock",label:"库存",align:"center","min-width":70},{prop:"weight",label:"重量(公斤)",align:"center","min-width":100},{prop:"inTurn",label:"排序",align:"center",minWidth:70},{prop:"unit",label:"单位比",align:"center","min-width":70},{prop:"status",label:"上架",align:"center",minWidth:60},{prop:"cgStaffName",label:"采购人",align:"center",minWidth:90},{prop:"delStatus",label:"状态",align:"center",minWidth:60}],on:{"selection-change":t=>{this.selectedData=t.map(t=>({id:t.id}))}},op:{visible:!0,props:{width:420,align:"center",fixed:"right",label:"操作"},layout:["slot-modify"]}}).set("pagination",{size:50}).set("layout",[["slot-tabs"],["slot-option-area","flex1","slot-addNew-goods-btn","slot-add-goods-btn","slot-download-price-btn","refresh-btn"],["data-table"],["slot-more-do-btn","flex1","pagination"]]).done(),e.refresh({classId:this.classId,status:this.status,delStatus:this.delStatus,showPage:1,name:this.search,hasStock:this.hasStock,cgStaffId:this.currentCgStaffId})},uploadSuccess(){console.log("valid",this.$refs["replaceForm"].validateField("cover"))},refresh(t){this.app.refresh(t)},showAddPrice(){this.initData=[],this.priceInput=!1,this.shelfLifeInput=!1,this.stockWarningInput=!1,this.sort.status=!1,this.costPrice=!1,this.canAddRatio=!1,this.costWeight=!1,this.canAddPrice=!0,this.canSkAddPrice=!1,this.canByAddPrice=!1,this.canHjAddPrice=!1,this.canZsAddPrice=!1},showSkAddPrice(){this.initData=[],this.priceInput=!1,this.shelfLifeInput=!1,this.stockWarningInput=!1,this.sort.status=!1,this.costPrice=!1,this.canAddRatio=!1,this.costWeight=!1,this.canAddPrice=!1,this.canSkAddPrice=!0,this.canByAddPrice=!1,this.canHjAddPrice=!1,this.canZsAddPrice=!1},showByAddPrice(){this.initData=[],this.priceInput=!1,this.shelfLifeInput=!1,this.stockWarningInput=!1,this.sort.status=!1,this.costPrice=!1,this.canAddRatio=!1,this.costWeight=!1,this.canAddPrice=!1,this.canSkAddPrice=!1,this.canByAddPrice=!0,this.canHjAddPrice=!1,this.canZsAddPrice=!1},showHjAddPrice(){this.initData=[],this.priceInput=!1,this.shelfLifeInput=!1,this.stockWarningInput=!1,this.sort.status=!1,this.costPrice=!1,this.canAddRatio=!1,this.costWeight=!1,this.canAddPrice=!1,this.canSkAddPrice=!1,this.canByAddPrice=!1,this.canHjAddPrice=!0,this.canZsAddPrice=!1},showZsAddPrice(){this.initData=[],this.priceInput=!1,this.shelfLifeInput=!1,this.stockWarningInput=!1,this.sort.status=!1,this.costPrice=!1,this.canAddRatio=!1,this.costWeight=!1,this.canAddPrice=!1,this.canSkAddPrice=!1,this.canByAddPrice=!1,this.canHjAddPrice=!1,this.canZsAddPrice=!0},showAddRatio(){this.initData=[],this.canAddRatio=!0,this.priceInput=!1,this.stockWarningInput=!1,this.sort.status=!1,this.shelfLifeInput=!1,this.costPrice=!1,this.costWeight=!1,this.canAddPrice=!1,this.canSkAddPrice=!1,this.canByAddPrice=!1,this.canHjAddPrice=!1,this.canZsAddPrice=!1},showWeight(){this.initData=[],this.costWeight=!0,this.priceInput=!1,this.stockWarningInput=!1,this.sort.status=!1,this.costPrice=!1,this.canAddRatio=!1,this.canAddPrice=!1,this.canSkAddPrice=!1,this.canByAddPrice=!1,this.canHjAddPrice=!1,this.canZsAddPrice=!1},showInTurn(t){this.initData=[],this.sort.status=!0,this.priceInput=!1,this.shelfLifeInput=!1,this.stockWarningInput=!1,this.costPrice=!1,this.canAddRatio=!1,this.costWeight=!1,this.canAddPrice=!1,this.canSkAddPrice=!1,this.canByAddPrice=!1,this.canHjAddPrice=!1,this.canZsAddPrice=!1},showPriceInput(t){this.initData=[],this.priceInput=!0,this.shelfLifeInput=!1,this.stockWarningInput=!1,this.sort.status=!1,this.costPrice=!1,this.canAddRatio=!1,this.costWeight=!1,this.canAddPrice=!1,this.canSkAddPrice=!1,this.canByAddPrice=!1,this.canHjAddPrice=!1,this.canZsAddPrice=!1},showStockWarningInput(t){this.initData=[],this.shelfLifeInput=!1,this.priceInput=!1,this.stockWarningInput=!0,this.sort.status=!1,this.costPrice=!1,this.canAddRatio=!1,this.costWeight=!1,this.canAddPrice=!1,this.canSkAddPrice=!1,this.canByAddPrice=!1,this.canHjAddPrice=!1,this.canZsAddPrice=!1},showShelfLifeInputInput(){this.initData=[],this.shelfLifeInput=!0,this.priceInput=!1,this.stockWarningInput=!1,this.sort.status=!1,this.costPrice=!1,this.canAddRatio=!1,this.costWeight=!1,this.canAddPrice=!1,this.canSkAddPrice=!1,this.canByAddPrice=!1,this.canHjAddPrice=!1,this.canZsAddPrice=!1},hiddenInput(t){switch(t){case"inTurn":this.sort.status=!1;break;case"cost":this.costPrice=!1;break;case"addPrice":this.canAddPrice=!1;break;case"skAddPrice":this.canSkAddPrice=!1;break;case"byAddPrice":this.canByAddPrice=!1;break;case"hjAddPrice":this.canHjAddPrice=!1;break;case"zsAddPrice":this.canZsAddPrice=!1;break;case"ratio":this.canAddRatio=!1;break;case"weight":this.costWeight=!1;break;case"price":this.priceInput=!1;break;case"stockWarning":this.stockWarningInput=!1;break;case"shelfLife":this.shelfLifeInput=!1;break}},commitChange(t){if(this.$util.isEmpty(this.initData))return this.hiddenInput(t),!1;const e=this.$loading({lock:!0,text:"处理中"});this.dataList.form.data=JSON.stringify(this.initData),this.$service.product.productBatchUpdate(this.dataList.form).then(i=>{"price"==t&&this.app.refresh(),e.close(),this.hiddenInput(t)}).catch(t=>{e.close()})},replaceBtnFn(t){this.$message({message:"开发中",type:"warning"})},batchAddNumFun(){if(""==this.batchAddNum)return;let t=this.$refs["xCrud"].table.data;t.forEach(t=>{if("addPrice"==this.dataList.form.type){let e=(Number(this.batchAddNum)+Number(t.addPrice)).toFixed(2);t.addPrice=e,this.initData.push({id:t.id,addPrice:t.addPrice})}else if("skAddPrice"==this.dataList.form.type){let e=(Number(this.batchAddNum)+Number(t.skAddPrice)).toFixed(2);t.skAddPrice=e,this.initData.push({id:t.id,skAddPrice:t.skAddPrice})}else if("byAddPrice"==this.dataList.form.type){let e=(Number(this.batchAddNum)+Number(t.byAddPrice)).toFixed(2);t.byAddPrice=e,this.initData.push({id:t.id,byAddPrice:t.byAddPrice})}else if("hjAddPrice"==this.dataList.form.type){let e=(Number(this.batchAddNum)+Number(t.hjAddPrice)).toFixed(2);t.hjAddPrice=e,this.initData.push({id:t.id,hjAddPrice:t.hjAddPrice})}else if("zsAddPrice"==this.dataList.form.type){let e=(Number(this.batchAddNum)+Number(t.zsAddPrice)).toFixed(2);t.zsAddPrice=e,this.initData.push({id:t.id,zsAddPrice:t.zsAddPrice})}else if("stockWarning"==this.dataList.form.type){let e=(Number(this.batchAddNum)+Number(t.stockWarning)).toFixed(2);t.stockWarning=e,this.initData.push({id:t.id,stockWarning:t.stockWarning})}else if("shelfLife"==this.dataList.form.type){let e=(Number(this.batchAddNum)+Number(t.shelfLife)).toFixed(2);t.shelfLife=e,this.initData.push({id:t.id,shelfLife:t.shelfLife})}}),this.dialogFormVisible=!1},batchAlterNumFun(){if(""==this.batchAlterNum)return;let t=this.$refs["xCrud"].table.data;t.forEach(t=>{"addPrice"==this.dataList.form.type?(t.addPrice=this.batchAlterNum,this.initData.push({id:t.id,addPrice:this.batchAlterNum})):"skAddPrice"==this.dataList.form.type?(t.skAddPrice=this.batchAlterNum,this.initData.push({id:t.id,skAddPrice:this.batchAlterNum})):"byAddPrice"==this.dataList.form.type?(t.byAddPrice=this.batchAlterNum,this.initData.push({id:t.id,byAddPrice:this.batchAlterNum})):"hjAddPrice"==this.dataList.form.type?(t.hjAddPrice=this.batchAlterNum,this.initData.push({id:t.id,hjAddPrice:this.batchAlterNum})):"zsAddPrice"==this.dataList.form.type?(t.zsAddPrice=this.batchAlterNum,this.initData.push({id:t.id,zsAddPrice:this.batchAlterNum})):"stockWarning"==this.dataList.form.type?(t.stockWarning=this.batchAlterNum,this.initData.push({id:t.id,stockWarning:this.batchAlterNum})):"shelfLife"==this.dataList.form.type&&(t.shelfLife=this.batchAlterNum,this.initData.push({id:t.id,shelfLife:this.batchAlterNum}))}),this.dialogFormVisible=!1},showMultiplePop(t,e){this.batchAlterNum="",this.batchAddNum="",this.dialogFormVisible=!0,this.dataList.form.type=e},changeInputValue(t,e){this.dataList.form.type=e;let i={id:t.id};"inTurn"==e?i.inTurn=t.inTurn:"addPrice"==e?i.addPrice=t.addPrice:"skAddPrice"==e?i.skAddPrice=t.skAddPrice:"byAddPrice"==e?i.byAddPrice=t.byAddPrice:"hjAddPrice"==e?i.hjAddPrice=t.hjAddPrice:"zsAddPrice"==e?i.zsAddPrice=t.zsAddPrice:"cost"==e?i.cost=t.cost:"weight"==e?i.weight=t.weight:"ratio"==e?i.ratio=t.ratio:"price"==e?i.price=t.price:"stockWarning"==e?i.stockWarning=t.stockWarning:"shelfLife"==e&&(i.shelfLife=t.shelfLife),this.initData.push(i)}}},d=l,h=(i("68a4"),i("1805")),u=Object(h["a"])(d,s,a,!1,null,"84a35880",null);e["default"]=u.exports},aa05:function(t,e,i){},be60:function(t,e,i){"use strict";i("2531")},d284:function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:t.title,visible:t.showDtail,top:"1vh",width:"40%"},on:{"update:visible":function(e){t.showDtail=e}}},[e("el-table",{attrs:{data:t.staffList}},[e("el-table-column",{attrs:{property:"id",label:"ID",width:"120",align:"center"}}),e("el-table-column",{attrs:{property:"name",label:"姓名",width:"190",align:"center"}}),e("el-table-column",{attrs:{property:"mobile",label:"手机号",width:"130",align:"center"}}),e("el-table-column",{attrs:{prop:"cover",label:"操作",align:"center"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.getStaff(i.row)}}},[t._v("选择")])]}}])})],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.showDtail=!1}}},[t._v("关 闭")])],1)],1)},a=[],r={name:"select-staff",props:{staffData:{type:Object,default:()=>{}}},data(){return{showDtail:!1,staffList:[],title:"请选择"}},computed:{},methods:{init(){this.staffData.title&&(this.title=this.staffData.title),this.staffList=[],this.showDtail=!0,this.$service.shopAdmin.getAllStaff().then(t=>{this.staffList=t.list})},closeFn(){this.showDtail=!1},getStaff(t){this.$emit("getStaff",t),this.closeFn()}}},n=r,c=i("1805"),o=Object(c["a"])(n,s,a,!1,null,null,null);e["default"]=o.exports},e0fe:function(t,e,i){"use strict";i("aa05")},f08f:function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:"选择花材",visible:t.selDialog,"close-on-click-modal":!1,"append-to-body":!0,width:"950px"},on:{"update:visible":function(e){t.selDialog=e},close:function(e){return t.$emit("update:show",!1)}}},[e("div",{staticClass:"recharge-modal-content"},[e("el-checkbox-group",{staticClass:"radio-wrap",model:{value:t.checkList,callback:function(e){t.checkList=e},expression:"checkList"}},[e("x-crud",{staticClass:"liu-crud-wrap",on:{load:t.onLoad},scopedSlots:t._u([{key:"table-column-radio",fn:function({scope:i}){return[e("div",[2==i.row.select?e("el-checkbox",{attrs:{disabled:"",label:i.row}},[t._v(t._s(i.row.id))]):e("el-checkbox",{attrs:{label:i.row},nativeOn:{click:function(e){return e.stopPropagation(),t.stop.apply(null,arguments)}}},[t._v(t._s(i.row.id))])],1)]}},{key:"table-column-select",fn:function({scope:i}){return[2==i.row.select?e("span",[t._v("✔")]):e("span")]}},{key:"table-column-stockWarning",fn:function({scope:i}){return[e("el-input",{attrs:{placeholder:"库存预警值",size:"small"},nativeOn:{click:function(e){return e.stopPropagation(),t.stop.apply(null,arguments)}},model:{value:i.row.stockWarning,callback:function(e){t.$set(i.row,"stockWarning",e)},expression:"scope.row.stockWarning"}})]}},{key:"table-column-cost",fn:function({scope:i}){return[e("el-input",{attrs:{placeholder:"成本价",size:"small"},nativeOn:{click:function(e){return e.stopPropagation(),t.stop.apply(null,arguments)}},model:{value:i.row.cost,callback:function(e){t.$set(i.row,"cost",e)},expression:"scope.row.cost"}})]}},{key:"table-column-addPrice",fn:function({scope:i}){return[e("el-input",{attrs:{placeholder:"加价",size:"small"},nativeOn:{click:function(e){return e.stopPropagation(),t.stop.apply(null,arguments)}},model:{value:i.row.addPrice,callback:function(e){t.$set(i.row,"addPrice",e)},expression:"scope.row.addPrice"}})]}},{key:"table-column-cover",fn:function({scope:i}){return[e("div",[e("cl-avatar",{style:{margin:"auto"},attrs:{shape:"square",size:40,src:t._f("default_avatar")(i.row.cover)}})],1)]}}])})],1),e("div",[e("span",[t._v("花材分类:")]),e("el-select",{staticStyle:{width:"300px"},attrs:{size:"small",placeholder:"请选择分类"},on:{change:t.selClassFn},model:{value:t.sonClassName,callback:function(e){t.sonClassName=e},expression:"sonClassName"}},t._l(t.itemClassList,(function(i,s){return e("el-option",{key:s,attrs:{value:i.name}},[t._v(t._s(i.name))])})),1)],1)],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{size:"small"},on:{click:t.resetForm}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.confirmFn}},[t._v("确定")])],1)])},a=[],r=(i("8f26"),i("963e"),{name:"sj-list-layer",props:{show:{type:Boolean,default:!1},classId:{type:Number,default:0},multi:{type:Boolean,default:!1},className:{type:String,default:""}},data(){return{selDialog:!1,ruleForm:{},checkList:[],list:[],itemClassList:[],sonClassId:0,sonClassName:"",newApp:""}},computed:{},watch:{show(t){this.selDialog=this.show}},created(){},methods:{stop(){},selClassFn(t){let e=this.itemClassList.findIndex(e=>e.name==t);this.sonClassId=this.itemClassList[e].id},getAllClass(){this.$service.itemClass.getAllClass({pageSize:1e3}).then(t=>{this.itemClassList=t.list})},confirmFn(){return 0==this.checkList.length?(this.$message.warning("请选择花材"),!1):0==this.sonClassId?(this.$message.warning("请选择分类"),!1):void this.$emit("confirm",{list:this.checkList,classId:this.sonClassId})},resetForm(){this.$emit("cancel")},selectItem(t){if(console.log(1212121121),console.log(t),2==t.select)return!1;let e=this.checkList.findIndex(e=>e.id==t.id);-1===e?this.checkList=[t,...this.checkList]:this.checkList.splice(e,1)},onLoad({ctx:t,app:e}){this.sonClassId=this.classId,this.sonClassName=this.className,this.app=e,this.getAllClass(),t.service(this.$service.ptItem).set("table",{columns:[{prop:"radio",label:"选择",align:"center",width:110},{prop:"cover",label:"图片",align:"center",width:120},{prop:"name",label:"名称",align:"center"},{prop:"stockWarning",label:"库存预警值",align:"center"},{prop:"cost",label:"成本价",align:"center"},{prop:"addPrice",label:"加价",align:"center"},{prop:"weight",label:"重量",align:"center"},{prop:"select",label:"已添加",align:"center"}],on:{"row-click":(t,e)=>{this.selectItem(t)}},op:{visible:!1}}).set("dict",{search:{keyWord:"search"}}).set("search",{key:{placeholder:"花材名称,支持拼音首字母搜索"}}).set("pagination",{size:6}).set("layout",[["slot-tabs"],["search-key","flex1","refresh-btn"],["data-table"],["flex1","pagination"]]).on("refresh",async(t,{next:e,render:i})=>{let{list:s}=await e(t);s.map((t,e)=>{t.index=e}),this.list=s,i(s)}).done(),e.refresh()}}}),n=r,c=(i("be60"),i("1805")),o=Object(c["a"])(n,s,a,!1,null,null,null);e["default"]=o.exports}}]);